Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- password = "password"
- maxTrys = 3
- maxFails = 0
- os.pullEvent = os.pullEventRaw
- function password()
- term.clear()
- term.setCursorPos(1,1)
- print("Enter the password.")
- input = read("*")
- if input == password then
- maxFails = 0
- print("Door opening...")
- rs.setOutput("right", true)
- sleep(3)
- rs.setOutput("right", false)
- os.reboot()
- else
- maxFails = maxFails + 1
- print("Incorrect, "..maxFails.." tries left.")
- os.reboot()
- elseif maxFails == maxTrys then
- print("Locked.")
- sleep(60)
- os.reboot()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment