Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- password = "1234"
- side = "left"
- opentime = 5
- invertedSignal = false
- local fail = 0
- while true do
- term.clear()
- term.setCursorPos(1,1)
- print() -- empty line
- write(" Password: ")
- input = read("*")
- if input == password then
- print("Access granted!")
- if invertedSignal then
- rs.setOutput(side, false)
- sleep(opentime)
- rs.setOutput(side, true)
- else
- rs.setOutput(side, true)
- sleep(opentime)
- rs.setOutput(side, false)
- end
- else
- fail = fail+1
- print("Access denied!")
- if fail == 3 then
- print(" Failed 3 times")
- print(" Rebooting...")
- sleep(2)
- os.shutdown()
- end
- end
- sleep(0.2)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement