Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- while true do
- local reactor = peripheral.wrap("BigReactors-Reactor_0")
- local turbine = peripheral.wrap("BigReactors-Turbine_0")
- local mon = peripheral.wrap("monitor_0")
- local MaxPower = 1000000
- local RPM = math.floor(turbine.getRotorSpeed())
- local Coil = turbine.getInductorEngaged()
- local SteamReady = turbine.getInputAmount()
- local SteamRate = turbine.getFluidFlowRate()
- local LowCent = 40
- local HighCent = 80
- local LowPower = ((LowCent/100)*MaxPower)
- local HighPower = ((HighCent/100)*MaxPower)
- local PowerNow = math.floor(turbine.getEnergyStored())
- local Percent = math.floor((PowerNow/MaxPower)*100)
- local PowerSimple = 0
- local Unit = " Err"
- local State = "Off"
- if reactor.getActive() then
- State = "On"
- else
- State = "Off"
- end
- if SteamReady >= 2000 then
- reactor.setActive(false)
- else
- reactor.setActive(true)
- end
- if PowerNow >= 0 and PowerNow <= 9999 then
- PowerSimple = PowerNow
- Unit = " RF"
- end
- if PowerNow >= 10000 and PowerNow <= 999999 then
- PowerSimple = PowerNow/1000
- Unit = " KRF"
- end
- if PowerNow >= 1000000 then
- PowerSimple = PowerNow/1000000
- Unit = " MRF"
- end
- if PowerNow >= HighPower then
- -- reactor.setActive(false)
- turbine.setActive(false)
- turbine.setInductorEngaged(false)
- end
- turbine.setInductorEngaged(false)
- if RPM >= 1700 and RPM <= 1900 then
- turbine.setInductorEngaged(true)
- end
- if RPM >= 850 and RPM <= 1050 then
- turbine.setInductorEngaged(true)
- end
- if RPM >= 2300 then
- turbine.setInductorEngaged(true)
- end
- if PowerNow <= LowPower then
- --reactor.setActive(true)
- turbine.setActive(true)
- end
- mon.clear()
- mon.setCursorPos(1,1)
- mon.setTextColor(colors.white)
- mon.write("Reactor: ")
- mon.setTextColor(colors.lime)
- mon.write(State)
- mon.setCursorPos(1,2)
- mon.setTextColor(colors.white)
- mon.write("Threshold; Low: ")
- mon.setTextColor(colors.lime)
- mon.write(string.format("%.1d",LowCent))
- mon.write("% ")
- mon.setTextColor(colors.white)
- mon.write("High: ")
- mon.setTextColor(colors.lime)
- mon.write(string.format("%.1d",HighCent))
- mon.write("%")
- mon.setCursorPos(1,3)
- mon.setTextColor(colors.white)
- mon.write("Producing: ")
- mon.setTextColor(colors.lime)
- mon.write(string.format("%.1d",turbine.getEnergyProducedLastTick()))
- mon.write(" RF/t")
- mon.setCursorPos(1,4)
- mon.setTextColor(colors.white)
- mon.write("Stored: ")
- mon.setTextColor(colors.lime)
- mon.write(string.format("%.1d",PowerSimple))
- mon.write(Unit)
- mon.write("(")
- mon.write(string.format("%.1d",Percent))
- mon.write("%)")
- mon.setCursorPos(1,5)
- mon.setTextColor(colors.white)
- mon.write("Casing Temp: ")
- mon.setTextColor(colors.lime)
- mon.write(string.format("%.1d",reactor.getCasingTemperature()))
- mon.write("'C")
- mon.setCursorPos(1,6)
- mon.setTextColor(colors.white)
- mon.write("Rod Temp: ")
- mon.setTextColor(colors.lime)
- mon.write(string.format("%.1d",reactor.getFuelTemperature()))
- mon.write("'C")
- mon.setCursorPos(1,7)
- mon.setTextColor(colors.white)
- mon.write("RPM: ")
- mon.setTextColor(colors.lime)
- mon.write(string.format("%.1d",RPM))
- mon.setCursorPos(1,8)
- mon.setTextColor(colors.white)
- mon.write("Charging: ")
- mon.setTextColor(colors.lime)
- mon.write(Coil)
- mon.setCursorPos(1,9)
- mon.setTextColor(colors.white)
- mon.write("Steam in turbine: ")
- mon.setTextColor(colors.lime)
- mon.write(string.format("%.1d",SteamReady))
- mon.write(" (")
- mon.write(string.format("%.1d",SteamRate))
- mon.write("mb/t)")
- sleep(1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement