Advertisement
NekoTiki

Untitled

Feb 22nd, 2019
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.60 KB | None | 0 0
  1. -- Monitors Variables
  2. local monL = peripheral.wrap("left")
  3. local monR = peripheral.wrap("right")
  4. local monT = peripheral.wrap("monitor_4")
  5.  
  6. -- Turbines Variables
  7. local turb1 = peripheral.wrap("BigReactors-Turbine_3")
  8. local turb2 = peripheral.wrap("BigReactors-Turbine_2")
  9.  
  10. local turb3 = peripheral.wrap("BigReactors-Turbine_4")
  11. local turb4 = peripheral.wrap("BigReactors-Turbine_5")
  12.  
  13. -- Getting Monitors (Right / Left) Size
  14. local w, h = monL.getSize()
  15.  
  16. -- Main Program
  17. while true do
  18. -- Clearing Monitors
  19. monL.clear()
  20. monR.clear()
  21. monT.clear()
  22.  
  23. -- Creating a middle Line on
  24. -- (Right and Left) monitors
  25. for x = 1,w do
  26. monL.setCursorPos(x, 10)
  27. monL.setBackgroundColor(colors.yellow)
  28. monL.write(" ")
  29.  
  30. monR.setCursorPos(x, 10)
  31. monR.setBackgroundColor(colors.yellow)
  32. monR.write(" ")
  33. end
  34.  
  35. -- Reset of Background Color on
  36. -- (Right and Left) monitors
  37. monL.setBackgroundColor(colors.black)
  38. monR.setBackgroundColor(colors.black)
  39.  
  40. -- Titles Left
  41. monL.setTextColor(colors.lime)
  42.  
  43. monL.setCursorPos(math.ceil(w/2) - 5,2)
  44. monL.write("Turbine N-1")
  45.  
  46. monL.setCursorPos(math.ceil(w/2) - 5,12)
  47. monL.write("Turbine N-2")
  48.  
  49. -- Titles Right
  50. monR.setTextColor(colors.lime)
  51.  
  52. monR.setCursorPos(2,2)
  53. monR.write("Turbine N-3")
  54.  
  55. monR.setCursorPos(2,12)
  56. monR.write("Turbine N-4")
  57.  
  58. -- Title Top
  59. monT.setTextColor(colors.lime)
  60.  
  61. monT.setCursorPos(2,2)
  62. monT.write("Overall Stats")
  63.  
  64. -- Set Right/Left monitors text Color
  65. monL.setTextColor(colors.red)
  66. monR.setTextColor(colors.red)
  67.  
  68. -- Left Monitor / Turbines Stats
  69. ---- Turbine N-1
  70. monL.setCursorPos(2,4)
  71. monL.write(" Status:")
  72.  
  73. monL.setCursorPos(2,6)
  74. monL.write("Rotor Speed:")
  75.  
  76. monL.setCursorPos(2,8)
  77. monL.write(" Production:")
  78.  
  79. monL.setTextColor(colors.yellow)
  80. monL.setCursorPos(15,4)
  81. if turb1.getActive() then
  82. if turb1.getInductorEngaged() then
  83. monL.write("Producing")
  84. else
  85. monL.write("Speeding Up")
  86. end
  87. else
  88. monL.write("Shutdown")
  89. end
  90.  
  91. monL.setCursorPos(15,6)
  92. rotorSpeed = math.floor(turb1.getRotorSpeed() * 100) / 100
  93. monL.write(rotorSpeed .. " RPM")
  94.  
  95. monL.setCursorPos(15,8)
  96. energyProduced = math.floor(turb1.getEnergyProducedLastTick() * 100) / 100
  97. monL.write(energyProduced .. " RF/t")
  98.  
  99. ---- Turbine N-3
  100. monL.setCursorPos(2,14)
  101. monL.write(" Status:")
  102.  
  103. monL.setCursorPos(2,16)
  104. monL.write("Rotor Speed:")
  105.  
  106. monL.setCursorPos(2,18)
  107. monL.write(" Production:")
  108.  
  109. monL.setTextColor(colors.yellow)
  110. monL.setCursorPos(15,14)
  111. if turb2.getActive() then
  112. if turb2.getInductorEngaged() then
  113. monL.write("Producing")
  114. else
  115. monL.write("Speeding Up")
  116. end
  117. else
  118. monL.write("Shutdown")
  119. end
  120.  
  121. monL.setCursorPos(15,16)
  122. rotorSpeed = math.floor(turb2.getRotorSpeed() * 100) / 100
  123. monL.write(rotorSpeed .. " RPM")
  124.  
  125. monL.setCursorPos(15,18)
  126. energyProduced = math.floor(turb2.getEnergyProducedLastTick() * 100) / 100
  127. monL.write(energyProduced .. " RF/t")
  128.  
  129. -- Right Monitor / Turbines Stats
  130. ---- Turbine N-4
  131. monR.setCursorPos(2,4)
  132. monR.write(" Status:")
  133.  
  134. monR.setCursorPos(2,6)
  135. monR.write("Rotor Speed:")
  136.  
  137. monR.setCursorPos(2,8)
  138. monR.write(" Production:")
  139.  
  140. monR.setTextColor(colors.yellow)
  141. monR.setCursorPos(15,4)
  142. if turb3.getActive() then
  143. if turb3.getInductorEngaged() then
  144. monR.write("Producing")
  145. else
  146. monR.write("Speeding Up")
  147. end
  148. else
  149. monR.write("Shutdown")
  150. end
  151.  
  152. monR.setCursorPos(15,6)
  153. rotorSpeed = math.floor(turb3.getRotorSpeed() * 100) / 100
  154. monR.write(rotorSpeed .. " RPM")
  155.  
  156. monR.setCursorPos(15,8)
  157. energyProduced = math.floor(turb3.getEnergyProducedLastTick() * 100) / 100
  158. monR.write(energyProduced .. " RF/t")
  159.  
  160. ---- Turbine N-4
  161. monR.setCursorPos(2,14)
  162. monR.write(" Status:")
  163.  
  164. monR.setCursorPos(2,16)
  165. monR.write("Rotor Speed:")
  166.  
  167. monR.setCursorPos(2,18)
  168. monR.write(" Production:")
  169.  
  170. monR.setTextColor(colors.yellow)
  171. monR.setCursorPos(15,14)
  172. if turb4.getActive() then
  173. if turb4.getInductorEngaged() then
  174. monR.write("Producing")
  175. else
  176. monR.write("Speeding Up")
  177. end
  178. else
  179. monR.write("Shutdown")
  180. end
  181.  
  182. monR.setCursorPos(15,16)
  183. rotorSpeed = math.floor(turb4.getRotorSpeed() * 100) / 100
  184. monR.write(rotorSpeed .. " RPM")
  185.  
  186. monR.setCursorPos(15,18)
  187. energyProduced = math.floor(turb4.getEnergyProducedLastTick() * 100) / 100
  188. monR.write(energyProduced .. " RF/t")
  189.  
  190. sleep(0.5)
  191. --break
  192. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement