Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2014
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.79 KB | None | 0 0
  1. rednet.open("right")
  2. local mon = peripheral.wrap("front")
  3.  
  4. -- reactor id = 43
  5. -- turbine1 id = 47
  6. -- turbine2 id = 48
  7. -- turbine3 id = 49
  8. -- turbine4 id = 50
  9.  
  10. while true do
  11.  
  12. local id,mes = rednet.receive()
  13.  
  14. if id = 43 then
  15. reactor = {
  16. active = mes.active,
  17. casetemp = mes.casingtemp,
  18. steamtick = mes.energylasttick,
  19. fuel = mes.fuelamount,
  20. fuelmax = mes.fuelmax,
  21. fueleat = mes.fueleatlasttick,
  22. temp = mes.fueltemp,
  23. waste = mes.wasteamount,
  24. }
  25. elseif id = 47 then
  26. t1 = {
  27. active = mes.active,
  28. rotorspeed = mes.rotorspeed,
  29. stored = math.floor(mes.stored,0),
  30. produce = math.floor(mes.produce,0),
  31. }
  32. elseif id = 48 then
  33. t2 = {
  34. active = mes.active,
  35. rotorspeed = mes.rotorspeed,
  36. stored = math.floor(mes.stored,0),
  37. produce = math.floor(mes.produce,0),
  38. }
  39. elseif id = 49 then
  40. t3 = {
  41. active = mes.active,
  42. rotorspeed = mes.rotorspeed,
  43. stored = math.floor(mes.stored,0),
  44. produce = math.floor(mes.produce,0),
  45. }
  46. elseif id = 50 then
  47. t4 = {
  48. active = mes.active,
  49. rotorspeed = mes.rotorspeed,
  50. stored = math.floor(mes.stored,0),
  51. produce = math.floor(mes.produce,0),
  52. }
  53. end
  54.  
  55. totalproduce = t1.produce + t2.produce + t3.produce + t4.produce
  56. totalstored = t1.stored + t2.stored + t3.stored + t4.stored
  57.  
  58. --monitor x = 82
  59. --monitor y = 19
  60.  
  61. term.clear()
  62. term.redirect(mon)
  63. mon.setTextScale(0.5)
  64.  
  65. -- reactor status
  66.  
  67. print("~~~~~~~~~~~~~~~~~~~~ Reactor Status ~~~~~~~~~~~~~~~~~~~~")
  68. print()
  69. write("REACTOR: ")
  70. if reactor.active == true then
  71. mon.setTextColour(colors.lime)
  72. write("ACTIVE")
  73. elseif reactor.active == false then
  74. mon.setTextColour(colors.red)
  75. write("OFFLINE")
  76. end
  77. mon.setTextColour(colors.white)
  78. print()
  79. print()
  80. print("Steam: " .. math.floor(reactor.steamtick,0) .. " mB/t")
  81. print()
  82. print("Fuel: " .. reactor.fuel .. "/" .. reactor.fuelmax .. " mB")
  83. print("Fuel Usage: " .. math.ceil(reactor.fueleat*100)/100 .. " mB/t")
  84. print("Fuel Temp: " .. math.floor(reactor.temp,1) .. " C")
  85. print("Waste: " .. reactor.waste .. " mB")
  86. print()
  87.  
  88.  
  89.  
  90. print("~~~~~~~~~~~~~~~~~~~~ Turbine Status ~~~~~~~~~~~~~~~~~~~~")
  91. print()
  92. write("Turbine 1: ")
  93. if t1.active == true then
  94. mon.setTextColour(colors.lime)
  95. write("ACTIVE")
  96. elseif t1.active == false then
  97. mon.setTextColour(colors.red)
  98. write("OFFLINE")
  99. end
  100. mon.setTextColour(colors.white)
  101. print()
  102. print("Rotor Speed: " .. t1.rotorspeed .. " RPM")
  103. print("Energy Production: " .. t1.produce .." RF/t")
  104. print("Energy Stored: " .. t1.stored .." RF")
  105. print()
  106.  
  107. write("Turbine 2: ")
  108. if t2.active == true then
  109. mon.setTextColour(colors.lime)
  110. write("ACTIVE")
  111. elseif t2.active == false then
  112. mon.setTextColour(colors.red)
  113. write("OFFLINE")
  114. end
  115. mon.setTextColour(colors.white)
  116. print()
  117. print("Rotor Speed: " .. t2.rotorspeed .. " RPM")
  118. print("Energy Production: " .. t2.produce .." RF/t")
  119. print("Energy Stored: " .. t2.stored .." RF")
  120. print()
  121.  
  122. write("Turbine 3: ")
  123. if t3.active == true then
  124. mon.setTextColour(colors.lime)
  125. write("ACTIVE")
  126. elseif t3.active == false then
  127. mon.setTextColour(colors.red)
  128. write("OFFLINE")
  129. end
  130. mon.setTextColour(colors.white)
  131. print()
  132. print("Rotor Speed: " .. t3.rotorspeed .. " RPM")
  133. print("Energy Production: " .. t3.produce .." RF/t")
  134. print("Energy Stored: " .. t3.stored .." RF")
  135. print()
  136.  
  137. write("Turbine 4: ")
  138. if t4.active == true then
  139. mon.setTextColour(colors.lime)
  140. write("ACTIVE")
  141. elseif t4.active == false then
  142. mon.setTextColour(colors.red)
  143. write("OFFLINE")
  144. end
  145. mon.setTextColour(colors.white)
  146. print()
  147. print("Rotor Speed: " .. t4.rotorspeed .. " RPM")
  148. print("Energy Production: " .. t4.produce .." RF/t")
  149. print("Energy Stored: " .. t4.stored .." RF")
  150. print()
  151. print("~~~~~~~~~~~~~~~~~~~~ Total Stats ~~~~~~~~~~~~~~~~~~~~")
  152. print()
  153. print("Total Energy Production: " .. totalproduce .." RF/t")
  154. print("Energy Stored: " .. totalstored .." RF")
  155.  
  156. sleep(1)
  157. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement