Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- monitor = peripheral.wrap("monitor_0")
- reactor = peripheral.wrap("BigReactors-Reactor_1")
- maxCapacity = 10000000
- while true do
- monitor.clear()
- stored = reactor.getEnergyStored()
- tempFuel = reactor.getFuelTemperature()
- tempCase = reactor.getCasingTemperature()
- energypertick = reactor.getEnergyProducedLastTick()
- reactivity = reactor.getFuelReactivity()
- waste = reactor.getWasteAmount()
- fuel = reactor.getFuelAmount()
- feulpT = reactor.getFuelConsumedLastTick()
- RFpmB = energypertick / feulpT --RF per milli Bucket
- ctrlRods = ((stored / maxCapacity) - 0.5 )*400
- if ctrlRods < 0 then
- ctrlRods = 0
- end
- if ctrlRods > 95 then
- ctrlRods = 100
- end
- onoff = ctrlRods < 100
- if onoff then
- monitor.setBackgroundColor(colors.green)
- else
- monitor.setBackgroundColor(colors.red)
- end
- monitor.setCursorPos(1,1)
- if onoff then
- monitor.write("Reactor Status :RUNNING ")
- else
- monitor.write("Reactor Status :NOT RUNNING ")
- end
- monitor.setCursorPos(28,1)
- monitor.write(string.format(" %.1f",100-ctrlRods))
- monitor.write("%")
- reactor.setAllControlRodLevels(ctrlRods)
- monitor.write(" ")
- monitor.setBackgroundColor(colors.black)
- monitor.setCursorPos(1,3)
- monitor.write(string.format("Case temperature: %.1f °C",tempCase))
- monitor.setCursorPos(1,4)
- monitor.write(string.format("Fuel temperature: %.1f °C",tempFuel))
- monitor.setCursorPos(1,5)
- monitor.write(string.format("energy stored: %.0f RF",stored))
- monitor.setCursorPos(1,6)
- monitor.write(string.format("energy produced: %.2f RF/t",energypertick))
- monitor.setCursorPos(1,7)
- monitor.write(string.format("fuel used: %.4f mb/t | %.0f RF/mB",feulpT,RFpmB))
- monitor.setCursorPos(1,8)
- monitor.write(string.format("fuel | waste: %.0f mB | %.0f mB",fuel,waste))
- monitor.setCursorPos(1,9)
- monitor.write(string.format("rectivity: %.2f ",reactivity))
- monitor.write("%")
- monitor.setBackgroundColor(colors.orange)
- monitor.setCursorPos(1,11)
- monitor.write("Reboot ")
- monitor.setBackgroundColor(colors.black)
- monitor.setCursorPos(1,12)
- monitor.write(">> code made by ERiChu <<")
- os.startTimer(1)
- event,side,xpos,ypos = os.pullEvent()
- if event == "monitor_touch" then
- if ypos == 11 then
- shell.run("reboot")
- end
- end
- end
Add Comment
Please, Sign In to add comment