Advertisement
Cowz

Untitled

Dec 28th, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.91 KB | None | 0 0
  1. local GeneratingPwr = 1
  2. local HadEnough = 1
  3. while true do
  4. local reactor = peripheral.wrap("BigReactors-Reactor_0")
  5. local mon = peripheral.wrap("left")
  6. mon.clear()
  7. mon.setCursorPos(1,1)
  8. mon.setBackgroundColor(colors.cyan)
  9. mon.setTextColor(colors.black)
  10. mon.write("Xander is an idiot.")
  11. mon.setCursorPos(1,2)
  12. if reactor.getActive() == true then
  13. mon.setBackgroundColor(colors.green)
  14. mon.setTextColor(colors.white)
  15. mon.write("Reactor: Activated.")
  16. else
  17. mon.setBackgroundColor(colors.red)
  18. mon.setTextColor(colors.yellow)
  19. mon.write("Reactor: Deactivated.")
  20. end
  21. mon.setCursorPos(1,3)
  22. if reactor.getFuelAmount() > 5000 then
  23. mon.setBackgroundColor(colors.green)
  24. mon.setTextColor(colors.white)
  25. mon.write("Fuel: "..string.format(math.floor(reactor.getFuelAmount() / reactor.getFuelAmountMax() * 100)).."%")
  26. else
  27. mon.setBackgroundColor(colors.red)
  28. mon.setTextColor(colors.yellow)
  29. mon.write("Fuel: "..string.format(math.floor(reactor.getFuelAmount() / reactor.getFuelAmountMax() * 100)).."%")
  30. end
  31. mon.setCursorPos(1,4)
  32. mon.setBackgroundColor(colors.green)
  33. mon.setTextColor(colors.white)
  34. mon.write("RF/t: "..string.format(math.floor(reactor.getEnergyProducedLastTick())))
  35. mon.setCursorPos(1,5)
  36. mon.write("Control Rods Level: "..string.format(math.floor(reactor.getControlRodLevel(1) / 100)).."%")
  37. mon.setCursorPos(1,6)
  38. mon.write("Casing Temperature: "..string.format(math.floor(reactor.getCasingTemperature())))
  39. mon.setCursorPos(1,7)
  40. mon.write("Fuel Temperature: "..string.format(math.floor(reactor.getFuelTemperature())))
  41. if reactor.getEnergyStored() < 9500000 then
  42. if reactor.getFuelAmount() > 5000 then
  43. GeneratingPwr = 1
  44. else
  45. GeneratingPwr = 0
  46. end
  47.  
  48. else
  49. GeneratingPwr = 0
  50. end
  51.  
  52. mon.setCursorPos(1,8)
  53. mon.setBackgroundColor(colors.gray)
  54. mon.setTextColor(colors.white)
  55. mon.write(" ")
  56. mon.setCursorPos(1,8)
  57. mon.write(" Energy Stored ("..string.format(math.floor((reactor.getEnergyStored() / 10000000 ) * 100)).."%):")
  58. if GeneratingPwr == 1 then
  59. if HadEnough == 0 then
  60. reactor.setActive(true)
  61. else
  62. reactor.setActive(false)
  63. end
  64. else
  65. reactor.setActive(false)
  66. end
  67. if reactor.getEnergyStored() >= 9500000 then
  68. HadEnough = 1
  69. end
  70. if reactor.getEnergyStored() <= 1000000 then
  71. HadEnough = 0
  72. end
  73.  
  74. mon.setCursorPos(1,10)
  75. mon.write(" ")
  76. mon.setCursorPos(1,9)
  77. mon.setBackgroundColor(colors.red)
  78. mon.write(" ")
  79. mon.setCursorPos(1,9)
  80. mon.setBackgroundColor(colors.green)
  81. for l = 1, (((reactor.getEnergyStored() / 10000000 ) * 100) * 0.36) do
  82. mon.write(" ")
  83. end
  84. mon.setCursorPos(1,11)
  85. mon.setBackgroundColor(colors.green)
  86. mon.setTextColor(colors.white)
  87. mon.write("Fuel/t: "..string.format(math.floor(reactor.getFuelConsumedLastTick())).."%")
  88. if HadEnough == 1 then
  89. mon.setCursorPos(1,12)
  90. mon.setBackgroundColor(colors.green)
  91. mon.setTextColor(colors.white)
  92. mon.write("Energy Levels: OK. ("..string.format(math.floor(reactor.getEnergyStored())).." RF)")
  93. else
  94. mon.setCursorPos(1,12)
  95. mon.setBackgroundColor(colors.orange)
  96. mon.setTextColor(colors.white)
  97. mon.write("Energy Levels: BAD, =REGENERATING=.")
  98. end
  99. mon.setCursorPos(1,13)
  100. mon.setBackgroundColor(colors.gray)
  101. mon.write(" ")
  102. mon.setCursorPos(1,13)
  103. mon.write("------------------------------------")
  104. mon.setCursorPos(1,14)
  105. mon.write(" ")
  106. mon.setCursorPos(1,14)
  107. mon.write("Error Status:")
  108. mon.setCursorPos(1,15)
  109. mon.write(" ")
  110. mon.setCursorPos(1,15)
  111. mon.write("------------------------------------")
  112. mon.setCursorPos(1,16)
  113. mon.setCursorPos(1,19)
  114. mon.setBackgroundColor(colors.green)
  115. mon.write("Xander is stupid")
  116. mon.setBackgroundColor(colors.gray)
  117. --Seperator Code, long and just for looks boi
  118. mon.setCursorPos(37, 1)
  119. mon.write(" ")
  120. mon.setCursorPos(38,2)
  121. mon.setCursorPos(37, 2)
  122. mon.write(" ")
  123. mon.setCursorPos(37, 3)
  124. mon.write(" ")
  125. mon.setCursorPos(38,3)
  126. mon.setCursorPos(37, 4)
  127. mon.write(" ")
  128. mon.setCursorPos(37, 5)
  129. mon.write(" ")
  130. mon.setCursorPos(37, 6)
  131. mon.write(" ")
  132. mon.setCursorPos(37, 7)
  133. mon.write(" ")
  134. mon.setCursorPos(37, 8)
  135. mon.write(" ")
  136. mon.setCursorPos(37, 9)
  137. mon.write(" ")
  138. mon.setCursorPos(37, 10)
  139. mon.write(" ")
  140. mon.setCursorPos(37, 11)
  141. mon.write(" ")
  142. mon.setCursorPos(37, 12)
  143. mon.write(" ")
  144. mon.setCursorPos(37, 13)
  145. mon.write(" ")
  146. mon.setCursorPos(37, 14)
  147. mon.write(" ")
  148. mon.setCursorPos(37, 15)
  149. mon.write(" ")
  150. mon.setCursorPos(37, 16)
  151. mon.write(" ")
  152. mon.setCursorPos(37, 17)
  153. mon.write(" ")
  154. mon.setCursorPos(37, 18)
  155. mon.write(" ")
  156. mon.setCursorPos(37, 19)
  157. mon.write(" ")
  158. mon.setCursorPos(37, 20)
  159. mon.write(" ")
  160. -- end of seperator
  161. mon.setBackgroundColor(colors.black)
  162. sleep(0.25)
  163. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement