Posted 09 December 2017 - 08:30 AM
I'm making a basic security door which functions perfectly however,
once I get into my base I cannot get out so my solution was to have
the computer read a redstone input (button) and open the door once more
-all blank sections are not mistakes just things I've removed as they may be offensive.
-the door is hidden by pistons so the code both deactivates the piston and opens the door
-the security door section functions properly, the rs.getInput does not work but does not cause errors
-if I get rid of the first "end" the program treats the rs.Input as part of the "else"
-never used lua or computercraft before
any solutions would be appreciated
once I get into my base I cannot get out so my solution was to have
the computer read a redstone input (button) and open the door once more
-all blank sections are not mistakes just things I've removed as they may be offensive.
-the door is hidden by pistons so the code both deactivates the piston and opens the door
-the security door section functions properly, the rs.getInput does not work but does not cause errors
-if I get rid of the first "end" the program treats the rs.Input as part of the "else"
-never used lua or computercraft before
any solutions would be appreciated
Spoiler
rs.setOutput("back",true)
print("L O A D I N G O S")
sleep(1)
print("")
print("Welcome")
sleep(1)
print("Input Correct Password")
password = read()
if password == "" then
term.clear()
print("Password Accepted")
redstone.setOutput("back",false)
print("Welcome")
sleep(5)
redstone.setOutput("back",true)
os.reboot()
else
print("Incorrect Password")
print("")
sleep(2)
os.shutdown()
end
rs.getinput("right")
if true then
rs.setOutput("back",false)
sleep(5)
rs.setOutput("back",true)
end
Edited by