Advertisement
Guest User

Untitled

a guest
Jun 25th, 2018
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.04 KB | None | 0 0
  1. local component = require("component")
  2. local event = require("event")
  3. local colors = { blue = 0x4286F4, purple = 0xB673d6, red = 0xC14141, green = 0xDA841,
  4. black = 0x000000, white = 0xFFFFFF, grey = 0x47494C, lightGrey = 0xBBBBBB, lime = 0x7DFF86}
  5.  
  6. local r = component.br_reactor
  7. local mon = component.gpu
  8.  
  9.  
  10. mon.setResolution(54,18)
  11. --mon.setResolution(150,40)
  12. local w, h = mon.getResolution()
  13. mon.setBackground(colors.black)
  14.  
  15. while true do
  16. local reactorOnline = r.getActive() --Boolean
  17. local energyProduction = r.getEnergyProducedLastTick() --RF/t
  18. local energyStored = r.getEnergyStored() --RF
  19. local fuelTemp = r.getFuelTemperature() --C
  20. local caseTemp = r.getCasingTemperature() --C
  21. local fuelAmount = r.getFuelAmount() --mB
  22. local wasteAmount = r.getWasteAmount() --mB
  23. local fuelReact = r.getFuelReactivity() --%
  24. local rodLevel = r.getControlRodLevel(0) --%
  25. local fuelCons = r.getFuelConsumedLastTick() --mB
  26.  
  27. mon.fill(1,1,w,h," ")
  28.  
  29. --Reactor Online
  30. mon.setForeground(colors.white)
  31. mon.set(1,1, "Active: ")
  32. if reactorOnline then
  33. mon.setForeground(colors.lime)
  34. else
  35. mon.setForeground(colors.red)
  36. end
  37. if reactorOnline then
  38. mon.set(9,1,"True")
  39. else
  40. mon.set(9,1,"False")
  41. end
  42.  
  43. --RF/t Production
  44. mon.setForeground(colors.white)
  45. mon.set(1,2,"RF/t: ")
  46. if energyProduction <= 99 then
  47. mon.setForeground(colors.red)
  48. else
  49. mon.setForeground(colors.lime)
  50. end
  51. mon.set(7,2, math.ceil(energyProduction).." RF/t")
  52.  
  53. --Energy Stored
  54. --mon.setCursor(1,3)
  55. mon.setForeground(colors.white)
  56. mon.set(1,3,"Energy Stored: ")
  57. if energyStored < 1000000 then
  58. mon.setForeground(colors.red)
  59. else
  60. mon.setForeground(colors.lime)
  61. end
  62. mon.set(16,3, math.ceil(energyStored).." RF")
  63.  
  64. --Fuel Temp
  65. --mon.setCursor(1,4)
  66. mon.setForeground(colors.white)
  67. mon.set(1,4, "Fuel Temp: ")
  68. mon.setForeground(colors.lime)
  69. mon.set(12,4, math.ceil(fuelTemp).." C")
  70.  
  71. --Case Temp
  72. --mon.setCursor(1,5)
  73. mon.setForeground(colors.white)
  74. mon.set(1,5, "Case Temp: ")
  75. mon.setForeground(colors.lime)
  76. mon.set(12,5, math.ceil(caseTemp).." C")
  77.  
  78. --Fuel Reactivity
  79. --mon.setCursor(1,6)
  80. mon.setForeground(colors.white)
  81. mon.set(1,6, "Fuel React: ")
  82. mon.setForeground(colors.lime)
  83. mon.set(13,6, math.ceil(fuelReact).."%")
  84.  
  85. --Fuel Amount
  86. --mon.setCursor(1,7)
  87. mon.setForeground(colors.white)
  88. mon.set(1,7, "Fuel: ")
  89. mon.setForeground(colors.lime)
  90. mon.set(6,7, math.ceil(fuelAmount).." mB")
  91.  
  92. --Fuel Consumption
  93. --mon.setCursor(1,8)
  94. mon.setForeground(colors.white)
  95. mon.set(1,8, "Fuel Use: ")
  96. mon.setForeground(colors.lime)
  97. if fuelCons > 0 then
  98. mon.set(11,8, "~")
  99. end
  100. mon.set(12,8, math.ceil(fuelCons * 100 / 10).." mB/t")
  101.  
  102. --Waste Amount
  103. --mon.setCursor(1,9)
  104. mon.setForeground(colors.white)
  105. mon.set(1,9, "Waste: ")
  106.  
  107. if wasteAmount >= 900 then
  108. mon.setForeground(colors.red)
  109. else
  110. mon.setForeground(colors.lime)
  111. end
  112. mon.set(8,9, math.ceil(wasteAmount).." mB")
  113.  
  114. --Activation Button Display
  115. if reactorOnline then
  116. mon.set(19,1, "De-Activate")
  117. else
  118. mon.set(22,1, "Activate")
  119. end
  120.  
  121. --Rod Controller Display
  122. --mon.setCursor(24,7)
  123. mon.setForeground(colors.white)
  124. mon.set(24,7, "Rods")
  125. if rodLevel == 0 then
  126. --mon.setCursor(25,8)
  127. mon.set(25,8, rodLevel.."%")
  128. else
  129. --mon.setCursor(24,8)
  130. mon.set(24,8, rodLevel.."%")
  131. end
  132.  
  133. --mon.setCursor(22,8)
  134. mon.set(22,8, "<")
  135. --mon.setCursor(29,8)
  136. mon.set(29,8, ">")
  137.  
  138. function blank()
  139.  
  140. end
  141.  
  142. --Button Timers
  143. local name, _, x, y = event.pull("touch")
  144. if y == 1 and x < 30 and x > 18 and reactorOnline then
  145. r.setActive(false)
  146. elseif y == 1 and x < 30 and x > 21 then
  147. r.setActive(true)
  148. elseif y == 8 and x == 21 or x == 22 then
  149. r.setAllControlRodLevels(rodLevel - 10)
  150. elseif y == 8 and x == 28 or x == 29 then
  151. r.setAllControlRodLevels(rodLevel + 10)
  152. end
  153. os.sleep(0.1)
  154. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement