Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local mon = peripheral.wrap("monitor_1")
- local cell = peripheral.wrap("cofh_thermalexpansion_energycell_0")
- local reactor = peripheral.wrap("BigReactors-Reactor_0")
- while true do
- mon.clear()
- mon.setCursorPos(1,1)
- mon.setTextColor(colors.white)
- energyStored = math.floor(cell.getEnergyStored("default") + 0.5)
- maxEnergy = cell.getMaxEnergyStored("default")
- energyPerc = math.floor(energyStored / maxEnergy * 100 + 0.5)
- mon.write("Energy stored: ")
- mon.setTextColor(colors.green)
- mon.write(energyStored / 1000)
- mon.write("k")
- mon.setTextColor(colors.white)
- mon.setCursorPos(1,2)
- mon.write("Energy Percentage: ")
- mon.setTextColor(colors.green)
- mon.write(energyPerc)
- mon.write("%")
- mon.setTextColor(colors.white)
- mon.setCursorPos(1,4)
- mon.write("Reactor Status: ")
- if reactor.getActive() == true then
- mon.setTextColor(colors.green)
- mon.write("Active")
- else
- mon.setTextColor(colors.red)
- mon.write("Inactive")
- end
- if reactor.getActive() == true then
- mon.setTextColor(colors.white)
- mon.setCursorPos(1,5)
- mon.write("Reactor Power: ")
- mon.setTextColor(colors.green)
- mon.write(math.floor(reactor.getEnergyProducedLastTick() + 0.5))
- mon.write(" RF/Tick")
- end
- if energyPerc < 90 then
- reactor.setActive(true)
- else
- reactor.setActive(false)
- end
- sleep(5)
- end
Advertisement
Add Comment
Please, Sign In to add comment