Advertisement
Guest User

reactor

a guest
Sep 1st, 2014
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.46 KB | None | 0 0
  1. print("running reactor")
  2. reactor = peripheral.wrap("BigReactors-Reactor_8")
  3. cell1 = peripheral.wrap("cofh_thermalexpansion_energycell_21")
  4. cell2 = peripheral.wrap("cofh_thermalexpansion_energycell_20")
  5. cell3 = peripheral.wrap("cofh_thermalexpansion_energycell_19")
  6. cell4 = peripheral.wrap("cofh_thermalexpansion_energycell_18")
  7. cell5 = peripheral.wrap("cofh_thermalexpansion_energycell_17")
  8. monitor = peripheral.wrap("right")
  9. monitor.clear()
  10. monitor.setCursorPos(1,1)
  11. monitor.write("Current Energy Stored:")
  12. monitor.setCursorPos(1,2)
  13. monitor.write("Reactor Status:")
  14. monitor.setCursorPos(1,3)
  15. monitor.write("Fuel Status(mb):")
  16. monitor.setCursorPos(1,4)
  17. monitor.write("Redstone Flux Per Tick:")
  18. monitor.setCursorPos(23,1)
  19. while true do
  20.   totalEnergy = cell1.getEnergyStored("east") + cell2.getEnergyStored("east") + cell3.getEnergyStored("east") + cell4.getEnergyStored("east") + cell5.getEnergyStored("east")
  21.   monitor.setCursorPos(23,1)
  22.   monitor.write(tostring(totalEnergy))
  23.   sleep(.5)
  24.   monitor.setCursorPos(17,3)
  25.   monitor.write(reactor.getFuelAmount())
  26.   monitor.setCursorPos(24,4)
  27.   monitor.write(tostring(reactor.getEnergyProducedLastTick()))
  28.   if(totalEnergy <=50000000)then
  29.     reactor.setActive(true)
  30.   end
  31.   if(totalEnergy >= 240000000)then
  32.     reactor.setActive(false)
  33.   end
  34.   if(reactor.getActive()) then
  35.     monitor.setCursorPos(16,2)
  36.     monitor.write("Active  ")
  37.   else
  38.     monitor.setCursorPos(16,2)
  39.     monitor.write("Inactive")
  40.   end
  41. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement