Guest User

CC Forum Code

a guest
May 15th, 2015
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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.  
  26.   mc.clear()
  27.   ml.clear()
  28.   mr.clear()
  29.   local al = rs.getInput("left")
  30.   local input = io.read()
  31.  
  32.   function airlock()
  33.     mc.setTextColor(32768)
  34.  
  35.     if al == true then
  36.       mc.setTextScale(3)
  37.       mc.write(al)
  38.     end
  39.  
  40.     if al == false then
  41.       mc.setTextScale(3)
  42.       mc.write("Unsealed")
  43.     end
  44.   end
  45.  
  46.   airlock()
  47.  
  48.   if input == "restart" then
  49.     s.speak("restarting")
  50.     mc.setBackgroundColor(colors.red)
  51.     off()
  52.     sleep(5)
  53.     os.reboot()
  54.     break
  55.   end
  56.  
  57.   function off()
  58.     mc.setBackgroundColor(colors.red)
  59.     mc.clear()
  60.     ml.setBackgroundColor(colors.red)
  61.     ml.clear()
  62.     mr.setBackgroundColor(colors.red)
  63.     mr.clear()
  64.   end
  65.  
  66.   if input == "shutdown" then
  67.     s.speak("Shutting Down")
  68.     off()
  69.     sleep(0)
  70.     break
  71.   end
  72.  
  73.   if input == "startup left" then
  74.     ml.setBackgroundColor(colors.green)
  75.     ml.clear()
  76.     tl.setActive(true)
  77.   end
  78.  
  79.   if input == "startup right" then
  80.     mr.setBackgroundColor(colors.green)
  81.     mr.clear()
  82.     tr.setActive(true)
  83.   end
  84.  
  85.   if input == "shutoff left" then
  86.     ml.setBackgroundColor(colors.red)
  87.     ml.clear()
  88.     tl.setActive(false)
  89.   end
  90.  
  91.   if input == "shutoff right" then
  92.     mr.setBackgroundColor(colors.red)
  93.     mr.clear()
  94.     tr.setActive(false)
  95.   end
  96.  
  97.   if input == "?" then
  98.     print()
  99.     print("Commands")
  100.     print()
  101.     print("?")
  102.     print("Shutdown")
  103.     print("Restart")
  104.     print("Startup Left")
  105.     print("Startup Right")
  106.     print("Shutoff Left")
  107.     print("Shutoff Right")
  108.   end
  109.  
  110. end
Advertisement
Add Comment
Please, Sign In to add comment