Advertisement
Guest User

oxy

a guest
Jun 6th, 2014
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.71 KB | None | 0 0
  1. os.loadAPI("ocs/apis/sensor")
  2. rednet.open("back")
  3. local monitor = peripheral.wrap("top")
  4. prox = sensor.wrap("left")
  5. term.clear()
  6.  
  7.  
  8. monitor.setBackgroundColor(colors.black)
  9. monitor.clear()
  10. monitor.setTextColor(colors.lightBlue)
  11. monitor.setCursorPos(8,1)
  12. monitor.write("Oxygen Central")
  13. monitor.setTextColor(colors.white)
  14. monitor.setCursorPos(1,3)
  15. monitor.write("Main Control")
  16. monitor.setCursorPos(1,4)
  17. monitor.write("Oxygen Module")
  18. monitor.setCursorPos(1,5)
  19. monitor.write("Right Wing")
  20. monitor.setCursorPos(1,6)
  21. monitor.write("Liquid Store")
  22. monitor.setCursorPos(1,7)
  23. monitor.write("Laboratory")
  24. monitor.setCursorPos(1,8)
  25. monitor.write("Bee Tech")
  26. monitor.setCursorPos(1,9)
  27. monitor.write("Left Wing")
  28. monitor.setCursorPos(1,10)
  29. monitor.write("Refectory")
  30. monitor.setCursorPos(1,11)
  31. monitor.write("Quarters")
  32. monitor.setCursorPos(1,12)
  33. monitor.write("Cartography")
  34. monitor.setCursorPos(1,13)
  35. monitor.write("Nuclear Core")
  36. monitor.setCursorPos(1,14)
  37. monitor.write("Energy Store")
  38. monitor.setCursorPos(1,15)
  39. monitor.write("------------------------------------")
  40. monitor.setCursorPos(6,16)
  41. monitor.setTextColor(colors.orange)
  42. monitor.write("Nuclear Reactor Core")
  43. monitor.setCursorPos(1,18)
  44. monitor.setTextColor(colors.white)
  45. monitor.write("ACTIVE:")
  46. monitor.setCursorPos(1,19)
  47. monitor.write("HEAT:")
  48.  
  49. term.setCursorPos(1,1)
  50. print("OXYGEN SYSTEMS")
  51.  
  52.  
  53. while true do
  54.  
  55. if rs.getInput("right") == true then
  56.  monitor.setCursorPos(15,3)
  57.  monitor.setBackgroundColor(colors.lime)
  58.  monitor.write("ON ")
  59. end
  60.  
  61. if rs.getInput("right") == false then
  62.  monitor.setCursorPos(15,3)
  63.  monitor.setBackgroundColor(colors.red)
  64.  monitor.write("OFF")
  65. end
  66.  
  67. local id, message = rednet.receive()
  68. if message == "o1" and id == 63 then
  69.  monitor.setCursorPos(15,4)
  70.  monitor.setBackgroundColor(colors.cyan)
  71.  monitor.write("ON ")
  72. end
  73.  
  74. local id, message = rednet.receive()
  75. if message == "o1n" and id == 63 then
  76.  monitor.setCursorPos(15,4)
  77.  monitor.setBackgroundColor(colors.orange)
  78.  monitor.write("OFF")
  79. end
  80.  
  81. local id, message = rednet.receive()
  82. if message == "o2" and id == 77 then
  83.  monitor.setCursorPos(15,5)
  84.  monitor.setBackgroundColor(colors.lime)
  85.  monitor.write("ON ")
  86. end
  87.  
  88. local id, message = rednet.receive()
  89. if message == "o2n" and id == 77 then
  90.  monitor.setCursorPos(15,5)
  91.  monitor.setBackgroundColor(colors.red)
  92.  monitor.write("OFF")
  93.  end
  94.  
  95. local id, message = rednet.receive()
  96. if message == "o3" and id == 78 then
  97.  monitor.setCursorPos(15,6)
  98.  monitor.setBackgroundColor(colors.cyan)
  99.  monitor.write("ON ")
  100. end
  101.  
  102. local id, message = rednet.receive()
  103. if message == "o3n" and id == 78 then
  104.  monitor.setCursorPos(15,6)
  105.  monitor.setBackgroundColor(colors.orange)
  106.  monitor.write("OFF")
  107. end
  108.  
  109. local id, message = rednet.receive()
  110. if message == "o4" and id == 79 then
  111.  monitor.setCursorPos(15,7)
  112.  monitor.setBackgroundColor(colors.lime)
  113.  monitor.write("ON ")
  114. end
  115.  
  116. local id, message = rednet.receive()
  117. if message == "o4n" and id == 79 then
  118.  monitor.setCursorPos(15,7)
  119.  monitor.setBackgroundColor(colors.red)
  120.  monitor.write("OFF")
  121. end
  122.  
  123. local id, message = rednet.receive()
  124. if message == "o5" and id == 80 then
  125.  monitor.setCursorPos(15,8)
  126.  monitor.setBackgroundColor(colors.cyan)
  127.  monitor.write("ON ")
  128. end
  129.  
  130. local id, message = rednet.receive()
  131. if message == "o5n" and id == 80 then
  132.  monitor.setCursorPos(15,8)
  133.  monitor.setBackgroundColor(colors.orange)
  134.  monitor.write("OFF")
  135. end      
  136.  
  137. local id, message = rednet.receive()
  138. if message == "o6" and id == 81 then
  139.  monitor.setCursorPos(15,9)
  140.  monitor.setBackgroundColor(colors.lime)
  141.  monitor.write("ON ")
  142. end
  143.  
  144. local id, message = rednet.receive()
  145. if message == "o6n" and id == 81 then
  146.  monitor.setCursorPos(15,9)
  147.  monitor.setBackgroundColor(colors.red)
  148.  monitor.write("OFF")
  149. end
  150.  
  151. local id, message = rednet.receive()
  152. if message == "o7" and id == 82 then
  153.  monitor.setCursorPos(15,10)
  154.  monitor.setBackgroundColor(colors.cyan)
  155.  monitor.write("ON ")
  156. end
  157.  
  158. local id, message = rednet.receive()
  159. if message == "o7n" and id == 82 then
  160.  monitor.setCursorPos(15,10)
  161.  monitor.setBackgroundColor(colors.orange)
  162.  monitor.write("OFF")
  163. end
  164.  
  165. local id, message = rednet.receive()
  166. if message == "o8" and id == 85 then
  167.  monitor.setCursorPos(15,11)
  168.  monitor.setBackgroundColor(colors.lime)
  169.  monitor.write("ON ")
  170. end
  171.  
  172. local id, message = rednet.receive()
  173. if message == "o8n" and id == 85 then
  174.  monitor.setCursorPos(15,11)
  175.  monitor.setBackgroundColor(colors.red)
  176.  monitor.write("OFF")
  177. end
  178.  
  179. local id, message = rednet.receive()
  180. if message == "o9" and id == 86 then
  181.  monitor.setCursorPos(15,12)
  182.  monitor.setBackgroundColor(colors.cyan)
  183.  monitor.write("ON ")
  184. end
  185.  
  186. local id, message = rednet.receive()
  187. if message == "o9n" and id == 86 then
  188.  monitor.setCursorPos(15,12)
  189.  monitor.setBackgroundColor(colors.orange)
  190.  monitor.write("OFF")
  191. end
  192.  
  193. local id, message = rednet.receive()
  194. if message == "o10" and id == 87 then
  195.  monitor.setCursorPos(15,13)
  196.  monitor.setBackgroundColor(colors.lime)
  197.  monitor.write("ON ")
  198. end
  199.  
  200. local id, message = rednet.receive()
  201. if message == "o10n" and id == 87 then
  202.  monitor.setCursorPos(15,13)
  203.  monitor.setBackgroundColor(colors.red)
  204.  monitor.write("OFF")
  205. end
  206.  
  207. local id, message = rednet.receive()
  208. if message == "o11" and id == 88 then
  209.  monitor.setCursorPos(15,14)
  210.  monitor.setBackgroundColor(colors.cyan)
  211.  monitor.write("ON ")
  212. end
  213.  
  214. local id, message = rednet.receive()
  215. if message == "o11n" and id == 88 then
  216.  monitor.setCursorPos(15,14)
  217.  monitor.setBackgroundColor(colors.orange)
  218.  monitor.write("OFF")
  219. end
  220.  
  221. moreDetails = prox.getTargetDetails("6,-8,1")
  222. monitor.setCursorPos(15,18)
  223. monitor.setBackgroundColor(colors.black)
  224. monitor.write(moreDetails.Active)
  225. monitor.setCursorPos(15,19)
  226. monitor.write(moreDetails.Heat)
  227.  
  228. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement