Advertisement
Guest User

controls

a guest
Aug 1st, 2015
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.43 KB | None | 0 0
  1. term.clear()
  2. term.setCursorPos(1,1)
  3. print("Hello")
  4. sleep(2)
  5. print("What would you like to do?")
  6. sleep(2)
  7. print("1 = Blue Light")
  8. print("2 = Red Light")
  9. print("3 = Green Light")
  10. print("4 = Yellow Light")
  11. code = read("*")
  12. write("")
  13. if code == "1" then
  14. rs.setOutput("top",true)
  15. print("Enter Passcode")
  16. pass = read("*")
  17. write("")
  18. if pass == "hi" then
  19. print("Thank You")
  20. rs.setOutput("top",true)
  21. sleep(5)
  22. rs.setOutput("top",false)
  23. repeat
  24. until "i==3"
  25. else
  26. print("Wrong Passcode")
  27. sleep(3)
  28. os.shutdown()
  29. repeat
  30. until "i==3"
  31. end
  32. elseif code == "2" then
  33. print("Enter Passcode")
  34. second = read("*")
  35. write("")
  36. if second == "hi" then
  37. print("Thank You")
  38. rs.setOutput("right",true)
  39. sleep(5)
  40. rs.setOutput("right",false)
  41. os.shutdown()
  42. else
  43. print("Wrong Passcode")
  44. sleep(3)
  45. os.shutdown()
  46. repeat
  47. until "i==3"
  48. end
  49. elseif code == "3" then
  50. print("Enter Passcode")
  51. third = read("*")
  52. write("")
  53. if third == "hi" then
  54. rs.setOutput("bottom",true)
  55. print("Thank You")
  56. sleep(5)
  57. rs.setOutput("bottom",false)
  58. os.shutdown()
  59. else
  60. print("Wrong Passcode")
  61. sleep(3)
  62. os.shutdown()
  63. repeat
  64. until "i==3"
  65. end
  66. elseif code == "4" then
  67. print("Enter Passcode")
  68. forth = read("*")
  69. if forth == "hi" then
  70. rs.setOutput("left",true)
  71. print("Thank You")
  72. sleep(5)
  73. rs.setOutput("left",false)
  74. os.shutdown()
  75. else
  76. print("Wrong Passcode")
  77. sleep(3)
  78. os.shutdown()
  79. repeat
  80. until "i==3"
  81. end
  82. else
  83. print("Wrong Input")
  84. sleep(3)
  85. os.shutdown()
  86. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement