Guest User

startup

a guest
May 15th, 2015
244
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.98 KB | None | 0 0
  1. local nb = peripheral.wrap('noteBlock_0')
  2. local s = peripheral.wrap('speaker_2')
  3. local mc = peripheral.wrap('monitor_2')
  4. local ml = peripheral.wrap('monitor_1')
  5. local mr = peripheral.wrap('monitor_0')
  6. local tl = peripheral.wrap('BigReactors-Turbine_0')
  7. local tr = peripheral.wrap('BigReactors-Turbine_1')
  8. local cb = peripheral.wrap('chatBox_1')
  9.  
  10. s.speak("System Engaged")
  11.  
  12. mc.setBackgroundColor(colors.green)
  13. ml.setBackgroundColor(colors.red)
  14. ml.clear()
  15. ml.setCursorPos(1,1)
  16. mr.setBackgroundColor(colors.red)
  17. mr.clear()
  18. mr.setCursorPos(1,1)
  19. mc.clear()
  20. mc.setCursorPos(1,1)
  21. tr.setActive(false)
  22. tl.setActive(false)
  23.  
  24. while true do
  25. mc.clear()
  26. ml.clear()
  27. mr.clear()
  28.  
  29. local al = rs.getInput("left")
  30. local input = io.read()
  31.  
  32. function airlock()
  33.   mc.setTextColor(32768)
  34.   if al == true then
  35.     mc.setTextScale(3)
  36.     mc.write(al)
  37.   end
  38.   if al == false then
  39.     mc.setTextScale(3)
  40.     mc.write("Unsealed")
  41.   end
  42. end
  43.  
  44. airlock()
  45.  
  46. if input == "restart" then
  47. s.speak("restarting")
  48. mc.setBackgroundColor(colors.red)
  49. off()
  50. sleep(5)
  51. os.reboot()
  52. break
  53. end
  54.  
  55. function off()
  56. mc.setBackgroundColor(colors.red)
  57. mc.clear()
  58. ml.setBackgroundColor(colors.red)
  59. ml.clear()
  60. mr.setBackgroundColor(colors.red)
  61. mr.clear()
  62. end
  63.  
  64. if input == "shutdown" then
  65. s.speak("Shutting Down")
  66. off()
  67. sleep(0)
  68. break
  69. end
  70.  
  71. if input == "startup left" then
  72. ml.setBackgroundColor(colors.green)
  73. ml.clear()
  74. tl.setActive(true)
  75. end
  76.  
  77. if input == "startup right" then
  78. mr.setBackgroundColor(colors.green)
  79. mr.clear()
  80. tr.setActive(true)
  81. end
  82.  
  83. if input == "shutoff left" then
  84. ml.setBackgroundColor(colors.red)
  85. ml.clear()
  86. tl.setActive(false)
  87. end
  88.  
  89. if input == "shutoff right" then
  90. mr.setBackgroundColor(colors.red)
  91. mr.clear()
  92.   tr.setActive(false)
  93.   end
  94.  
  95.   if input == "?" then
  96.   print()
  97.   print("Commands")
  98.   print()
  99.   print("?")
  100.   print("Shutdown")
  101.   print("Restart")
  102.   print("Startup Left")
  103.   print("Startup Right")
  104.   print("Shutoff Left")
  105.   print("Shutoff Right")
  106.   end
  107.  
  108.  
  109. end
Advertisement
Add Comment
Please, Sign In to add comment