Advertisement
plantag

JLI

Sep 1st, 2014
246
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 7.41 KB | None | 0 0
  1. --By planty for JLI
  2. term.clear()
  3. print('Turbine & Reactor Monitor engaged.')
  4.  
  5. emptyflag=0
  6. offlineflag=0
  7. flashflag=0
  8.  
  9. -- List Turbines variables
  10. reactor1=peripheral.wrap('BigReactors-Reactor_0')
  11.  
  12. turbine1=peripheral.wrap('BigReactors-Turbine_1')
  13. turbine2=peripheral.wrap('BigReactors-Turbine_2')
  14. turbine3=peripheral.wrap('BigReactors-Turbine_3')
  15. turbine4=peripheral.wrap('BigReactors-Turbine_4')
  16.  
  17. monitor=peripheral.wrap('monitor_0')
  18.  
  19. monitor.setTextScale(1)
  20. monitor.setBackgroundColor(colors.black)
  21.  
  22. while true do
  23. monitor.clear()
  24. monitor.setTextColor(colors.lightBlue)
  25. monitor.setTextScale(1)
  26. monitor.setCursorPos(16,1)
  27. monitor.write('Turbine Monitoring')
  28.  
  29.  
  30. -- Headline
  31. monitor.setCursorPos(6,3)
  32. monitor.setTextColor(colors.white)
  33. monitor.write('RPM')
  34.  
  35. monitor.setCursorPos(16,3)
  36. monitor.setTextColor(colors.white)
  37. monitor.write('STEAM')
  38.  
  39. monitor.setCursorPos(26,3)
  40. monitor.setTextColor(colors.white)
  41. monitor.write('RF/T')
  42.  
  43. monitor.setCursorPos(38,3)
  44. monitor.setTextColor(colors.white)
  45. monitor.write('PSU')
  46.  
  47.  
  48. -- Turbine List
  49. monitor.setCursorPos(1,4)
  50. monitor.setTextColor(colors.white)
  51. monitor.write('T1')
  52.  
  53. monitor.setCursorPos(1,5)
  54. monitor.setTextColor(colors.white)
  55. monitor.write('T2')
  56.  
  57. monitor.setCursorPos(1,6)
  58. monitor.setTextColor(colors.white)
  59. monitor.write('T3')
  60.  
  61. monitor.setCursorPos(1,7)
  62. monitor.setTextColor(colors.white)
  63. monitor.write('T4')
  64.  
  65.  
  66.  
  67. -- Turbine RPM
  68. monitor.setCursorPos(6,4)
  69. if turbine1.getRotorSpeed()>800 and turbine1.getRotorSpeed()<1000 then
  70.    monitor.setTextColor(colors.green)
  71.    elseif turbine1.getRotorSpeed()>1840 and turbine1.getRotorSpeed()<1842 then
  72.       monitor.setTextColor(colors.green)
  73.    else  
  74.       monitor.setTextColor(colors.red)
  75. end
  76. monitor.write((math.floor(turbine1.getRotorSpeed()+0.1))..' RPM')
  77.  
  78. monitor.setCursorPos(6,5)
  79. if turbine2.getRotorSpeed()>800 and turbine2.getRotorSpeed()<1000 then
  80.    monitor.setTextColor(colors.green)
  81.    elseif turbine2.getRotorSpeed()>1840 and turbine2.getRotorSpeed()<1842 then
  82.       monitor.setTextColor(colors.green)
  83.    else  
  84.       monitor.setTextColor(colors.red)
  85. end
  86. monitor.write((math.floor(turbine2.getRotorSpeed()+0.1))..' RPM')
  87.  
  88. monitor.setCursorPos(6,6)
  89. if turbine3.getRotorSpeed()>800 and turbine3.getRotorSpeed()<1000 then
  90.    monitor.setTextColor(colors.green)
  91.    elseif turbine3.getRotorSpeed()>1840 and turbine3.getRotorSpeed()<1842 then
  92.       monitor.setTextColor(colors.green)
  93.    else  
  94.       monitor.setTextColor(colors.red)
  95. end
  96. monitor.write((math.floor(turbine3.getRotorSpeed()+0.1))..' RPM')
  97.  
  98. monitor.setCursorPos(6,7)
  99. if turbine4.getRotorSpeed()>800 and turbine4.getRotorSpeed()<1000 then
  100.    monitor.setTextColor(colors.green)
  101.    elseif turbine4.getRotorSpeed()>1840 and turbine4.getRotorSpeed()<1842 then
  102.       monitor.setTextColor(colors.green)
  103.    else  
  104.       monitor.setTextColor(colors.red)
  105. end
  106. monitor.write((math.floor(turbine4.getRotorSpeed()+0.1))..' RPM')
  107.  
  108. monitor.setCursorPos(6,8)
  109.  
  110.  
  111. -- Turbine STEAM
  112. monitor.setCursorPos(16,4)
  113. if turbine1.getFluidFlowRate()>940 and turbine1.getFluidFlowRate()<970 then
  114.     monitor.setTextColor(colors.green)
  115.    else  
  116.       monitor.setTextColor(colors.red)
  117. end
  118. monitor.write(turbine1.getFluidFlowRate().. ' mB/t')
  119.  
  120. monitor.setCursorPos(16,5)
  121. if turbine2.getFluidFlowRate()>940 and turbine2.getFluidFlowRate()<970 then
  122.     monitor.setTextColor(colors.green)
  123.    else  
  124.       monitor.setTextColor(colors.red)
  125. end
  126. monitor.write(turbine2.getFluidFlowRate().. ' mB/t')
  127.  
  128. monitor.setCursorPos(16,6)
  129. if turbine3.getFluidFlowRate()>940 and turbine3.getFluidFlowRate()<970 then
  130.     monitor.setTextColor(colors.green)
  131.    else  
  132.       monitor.setTextColor(colors.red)
  133. end
  134. monitor.write(turbine3.getFluidFlowRate().. ' mB/t')
  135.  
  136. monitor.setCursorPos(16,7)
  137. if turbine4.getFluidFlowRate()>940 and turbine4.getFluidFlowRate()<970 then
  138.     monitor.setTextColor(colors.green)
  139.    else  
  140.       monitor.setTextColor(colors.red)
  141. end
  142. monitor.write(turbine4.getFluidFlowRate().. ' mB/t')
  143.  
  144.  
  145.  
  146. -- Turbine RFT
  147. monitor.setCursorPos(26,4)
  148. if turbine1.getEnergyProducedLastTick()>10360 and turbine1.getEnergyProducedLastTick()<10500 then
  149.    monitor.setTextColor(colors.green)
  150.    else
  151.       monitor.setTextColor(colors.red)
  152. end
  153. monitor.write(math.floor((turbine1.getEnergyProducedLastTick()+0.5)).. ' RF/t')
  154.  
  155. monitor.setCursorPos(26,5)
  156. if turbine2.getEnergyProducedLastTick()>10360 and turbine2.getEnergyProducedLastTick()<10500 then
  157.    monitor.setTextColor(colors.green)
  158.    else
  159.       monitor.setTextColor(colors.red)
  160. end
  161. monitor.write(math.floor((turbine2.getEnergyProducedLastTick()+0.5)).. ' RF/t')
  162.  
  163. monitor.setCursorPos(26,6)
  164. if turbine3.getEnergyProducedLastTick()>10360 and turbine3.getEnergyProducedLastTick()<10500 then
  165.    monitor.setTextColor(colors.green)
  166.    else
  167.       monitor.setTextColor(colors.red)
  168. end
  169. monitor.write(math.floor((turbine3.getEnergyProducedLastTick()+0.5)).. ' RF/t')
  170.  
  171. monitor.setCursorPos(26,7)
  172. if turbine4.getEnergyProducedLastTick()>10360 and turbine4.getEnergyProducedLastTick()<10500 then
  173.    monitor.setTextColor(colors.green)
  174.    else
  175.       monitor.setTextColor(colors.red)
  176. end
  177. monitor.write(math.floor((turbine4.getEnergyProducedLastTick()+0.5)).. ' RF/t')
  178.  
  179. monitor.setCursorPos(26,8)
  180.  
  181.  
  182.  
  183. -- Turbine PSU
  184. monitor.setCursorPos(38,4)
  185. if turbine1.getEnergyStored()>900000 then
  186.    monitor.setTextColor(colors.green)
  187.    else
  188.       monitor.setTextColor(colors.red)
  189. end
  190. monitor.write(math.floor((turbine1.getEnergyStored()+0.1))..' RF')
  191.  
  192. monitor.setCursorPos(38,5)
  193. if turbine2.getEnergyStored()>900000 then
  194.    monitor.setTextColor(colors.green)
  195.    else
  196.       monitor.setTextColor(colors.red)
  197. end
  198. monitor.write(math.floor((turbine2.getEnergyStored()+0.1))..' RF')
  199.  
  200. monitor.setCursorPos(38,6)
  201. if turbine3.getEnergyStored()>900000 then
  202.    monitor.setTextColor(colors.green)
  203.    else
  204.       monitor.setTextColor(colors.red)
  205. end
  206. monitor.write(math.floor((turbine3.getEnergyStored()+0.1))..' RF')
  207.  
  208. monitor.setCursorPos(38,7)
  209. if turbine4.getEnergyStored()>900000 then
  210.    monitor.setTextColor(colors.green)
  211.    else
  212.       monitor.setTextColor(colors.red)
  213. end
  214. monitor.write(math.floor((turbine4.getEnergyStored()+0.1))..' RF')
  215.  
  216. monitor.setCursorPos(38,8)
  217.  
  218.  
  219. -- Reactor Monitor
  220. monitor.setTextColor(colors.lightBlue)
  221. monitor.setTextScale(1)
  222. monitor.setCursorPos(16,20)
  223. monitor.write('Reactor Monitoring')
  224.  
  225. monitor.setCursorPos(6,22)
  226. monitor.setTextColor(colors.white)
  227. monitor.write('FUEL')
  228.  
  229. monitor.setCursorPos(16,22)
  230. monitor.setTextColor(colors.white)
  231. monitor.write('STEAM')
  232.  
  233. monitor.setCursorPos(26,22)
  234. monitor.setTextColor(colors.white)
  235. monitor.write('C.TEMP')
  236.  
  237. monitor.setCursorPos(38,22)
  238. monitor.setTextColor(colors.white)
  239. monitor.write('ROD')
  240.  
  241. -- Reactor List
  242. monitor.setCursorPos(1,23)
  243. monitor.setTextColor(colors.white)
  244. monitor.write('R1')
  245.  
  246.  
  247. -- Reactor Fuel
  248. monitor.setCursorPos(6,23)
  249. monitor.setTextColor(colors.green)
  250. monitor.write(math.floor(((reactor1.getFuelAmount()/reactor1.getFuelAmountMax())*100)+0.5)..'%')
  251.  
  252.  
  253. -- Reactor Steam
  254. monitor.setCursorPos(16,23)
  255. monitor.setTextColor(colors.green)
  256. monitor.write((math.floor(reactor1.getEnergyProducedLastTick()+0.5)).. ' mb/t')
  257.  
  258.  
  259.  
  260. -- Reactor C.Temp
  261. monitor.setCursorPos(26,23)
  262. monitor.setTextColor(colors.green)
  263. monitor.write((math.floor(reactor1.getFuelTemperature()+0.1))..' C')
  264.  
  265.  
  266.  
  267. -- Reactor1 Rod
  268. monitor.setCursorPos(38,23)
  269. monitor.setTextColor(colors.green)
  270. monitor.write((reactor1.getControlRodLevel(0))..'% Depth')
  271.  
  272.  
  273. sleep(1)
  274.  
  275. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement