Sieder

Door with 4 passwords

Apr 27th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. os.pullEvent = os.pullEventRaw
  2. local side = "left"
  3. local password1 = "on"
  4. local password2 = "rorre"
  5. local password3 = "error"
  6. local passwordadmin = "nimda"
  7. term.clear()
  8. sleep(1)
  9. print("Loading...")
  10. sleep(2)
  11. print("To turn on lights please type 'on'")
  12. write("Password: ")
  13. local input = read()
  14. if input == password1 then
  15. term.clear()
  16. term.setCursorPos(1,1)
  17. print("Password correct! Turning Lights On!")
  18. term.setCursorPos(1,2)
  19. print("Press Any Key To Turn Off!")
  20. rs.setOutput(side,true)
  21. os.pullEvent("key")
  22. os.reboot()
  23. end
  24. if input == password2 then
  25. term.clear()
  26. term.setCursorPos(1,1)
  27. print("Password correct! Error!!!")
  28. rs.setOutput(side,true)
  29. os.pullEvent("key")
  30. os.reboot()
  31. end
  32. if input == password3 then
  33. term.clear()
  34. term.setCursorPos(1,1)
  35. print("Password correct! Error!!!")
  36. rs.setOutput(side,true)
  37. os.pullEvent("key")
  38. rs.setOutput(side,false)
  39. os.reboot()
  40. end
  41. if input == passwordadmin then
  42. term.clear()
  43. term.setCursorPos(1,1)
  44. print("Password correct!")
  45. print("Computer unlocking...")
  46. print("Please type 'reboot' or 'shutdown' before leaving")
  47. os.pullEvent(terminate)
  48.  
  49. else
  50. term.clear()
  51. term.setCursorPos(1,1)
  52. print("Password incorrect!")
  53. sleep(2)
  54. os.reboot()
  55. end
Add Comment
Please, Sign In to add comment