use this instead:
print("Written in DroidEditor")
while true do
term.clear()
term.setCursorPos(1,1)
write("Password: ")
pw = read("*")
if pw ~= "computer" then
print("Incorrect Password")
sleep(1)
else
print("Password accepted")
sleep(2)
return
end
end
This way the same program loops until someone gets the password right or terminates with ctrl+T, ctrl+R or ctrl+S
(if you want to stop people using the shortcuts, you're going to need a more complicated program)
Also, I am assuming from what you said, this is for a lock on a door. Assuming the door is on the left of the computer and will only ever be used to open the door, you will need to use this instead:
print("Written in DroidEditor")
while true do
term.clear()
term.setCursorPos(1,1)
write("Password: ")
pw = read("*")
if pw ~= "computer" then
print("Incorrect Password")
sleep(1)
else
print("Password accepted")
rs.setOutput("left",true)
sleep(2)
rs.setOutput("left",false)
end
end
If you want anything else, quote me and ask again.