Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- monitor = peripheral.wrap("monitor_0")
- local reactor = peripheral.wrap("BigReactors-Reactor_1") -- Wrap the reactor to the back
- while true do -- Loop forever
- sleep(1) -- This sleeps for 0 seconds, still casing a delay though
- monitor.clear()
- monitor.setCursorPos(1,1)
- monitor.write("Reactor: ")
- if reactor.getActive() then
- monitor.setTextColor(colors.lime)
- monitor.write("Online")
- else
- monitor.setTextColor(colors.red)
- monitor.write("Offline")
- end
- monitor.setTextColor(colors.white)
- monitor.setCursorPos(1, 3)
- monitor.write("Fuel Rods: ")
- monitor.setTextColor(colors.orange)
- monitor.write(tostring(reactor.getControlRodLevel(0)))
- monitor.setTextColor(colors.white)
- monitor.write(" %")
- monitor.setCursorPos(1,5)
- monitor.write("Stored: ")
- monitor.setTextColor(colors.blue)
- if reactor.getEnergyStored() == 10000000 then
- monitor.write("FULL")
- else
- monitor.write(tostring(reactor.getEnergyStored()))
- monitor.setTextColor(colors.white)
- monitor.write(" RF")
- end
- monitor.setCursorPos(1,7)
- monitor.write("Fuel: ")
- if reactor.getFuelAmount()/reactor.getFuelAmountMax() > 0.5 then
- monitor.setTextColor(colors.green)
- elseif reactor.getFuelAmount()/reactor.getFuelAmountMax() > 0.25 then
- monitor.setTextColor(colors.orange)
- else
- monitor.setTextColor(colors.red)
- end
- monitor.write(tostring(math.floor((reactor.getFuelAmount()/reactor.getFuelAmountMax())*100)))
- monitor.setTextColor(colors.white)
- monitor.write(" %")
- monitor.setCursorPos(1,9)
- monitor.write("Rate: ")
- monitor.write(tostring(math.floor(reactor.getEnergyProducedLastTick())))
- monitor.write(" RF/T")
- --if reactor.getEnergyStored() < 10000000 then -- If the reactor has less than 9900000 then
- reactor.setAllControlRodLevels(math.floor((reactor.getEnergyStored()/10000000)*100))
- -- reactor.setActive (true) -- Activate the reactor
- --end
- --if reactor.getEnergyStored() == 10000000 then -- If the reactor has more than 9900000 then
- -- reactor.setAllControlRodLevels(100)
- -- reactor.setActive (false) -- Activate the reactor
- --end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement