Computer_Craft_Coder

Untitled

Mar 23rd, 2014
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. password = "password"
  2. maxTrys = 3
  3. maxFails = 0
  4.  
  5. os.pullEvent = os.pullEventRaw
  6.  
  7. function password()
  8. term.clear()
  9. term.setCursorPos(1,1)
  10. print("Enter the password.")
  11. input = read("*")
  12. if input == password then
  13. maxFails = 0
  14. print("Door opening...")
  15. rs.setOutput("right", true)
  16. sleep(3)
  17. rs.setOutput("right", false)
  18. os.reboot()
  19. else
  20. maxFails = maxFails + 1
  21. print("Incorrect, "..maxFails.." tries left.")
  22. os.reboot()
  23. elseif maxFails == maxTrys then
  24. print("Locked.")
  25. sleep(60)
  26. os.reboot()
  27. end
  28. end
  29. end
Advertisement
Add Comment
Please, Sign In to add comment