Advertisement
Guest User

Untitled

a guest
Nov 30th, 2015
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.58 KB | None | 0 0
  1. local running = true
  2. local numFails = 0
  3.  
  4. while running == true do
  5. term.clear ()
  6.  
  7. print ("What would you like to do?")
  8. print ("")
  9. print ("Open")
  10. print ("Close")
  11. print ("Exit")
  12. print ("")
  13.  
  14. local input = read ("*")
  15.  
  16. if input == "Open" then
  17. print ("Enter password: ")
  18. local passInput read ("*")
  19.  
  20. if passInput == "password" then
  21. print ("Door opening...")
  22.  
  23. redstone.setOutput ("back", true)
  24. wait (4)
  25. redstone.setOutput ("back", false)
  26. redstone.setOutput ("left", true)
  27. wait (1)
  28. redstone.setOutput ("left", false)
  29.  
  30. print ("Exiting...")
  31. running = false
  32. else
  33. if numFails >= 3 then
  34. ActivateSec ()
  35. numFails = 0
  36. end
  37.  
  38. print ("Exiting...")
  39. running = false
  40. wait (3)
  41. term.clear ()
  42. end
  43. elseif input == "Close" then
  44. print ("Enter password: ")
  45. local passInput read ("*")
  46.  
  47. if passInput == "password" then
  48. print ("Door closing...")
  49.  
  50. redstone.setOutput ("left", true)
  51. wait (1)
  52. redstone.setOutput ("left", false)
  53. redstone.setOutput ("back", true)
  54. wait (4)
  55. redstone.setOutput ("back", false)
  56.  
  57. print ("Exiting...")
  58. running = false
  59. wait (3)
  60. term.clear ()
  61. else
  62. if numFails >= 3 then
  63. ActivateSec ()
  64. numFails = 0
  65. end
  66.  
  67. print ("Exiting...")
  68. running = false
  69. wait (3)
  70. term.clear ()
  71. end
  72. elseif input == "Exit" then
  73. print ("Exiting...")
  74. running = false
  75. else
  76. print ("Sorry, did not recognise that input...")
  77. sleep (3)
  78.  
  79. print ("Exiting...")
  80. running = false
  81. wait (3)
  82. term.clear ()
  83. end
  84. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement