Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- BigReactor monitor by MikiCZEch
- print("CTRL+T iterupt program.")
- monitor = peripheral.wrap("top")
- reactor = peripheral.wrap("BigReactors-Reactor_50")
- turbine = peripheral.wrap("BigReactors-Turbine_14")
- monitor.clear()
- -- Reactor Template
- monitor.setCursorPos(1,1)
- monitor.setTextColor(colors.blue)
- monitor.write("Reactor Monitor")
- monitor.setCursorPos(1,2)
- monitor.setTextColor(colors.lightGray)
- monitor.write("Status: ")
- monitor.setCursorPos(1,3)
- monitor.write("CoreTemp: ")
- monitor.setCursorPos(1,4)
- monitor.write("SteamGen: ")
- monitor.setCursorPos(1,5)
- monitor.write("Reactivity: ")
- -- Turbine Template
- zpc2 = 20 -- zero position column 2
- monitor.setCursorPos(zpc2,1)
- monitor.setTextColor(colors.blue)
- monitor.write("Turbine Monitor")
- monitor.setCursorPos(zpc2,2)
- monitor.setTextColor(colors.lightGray)
- monitor.write("Status: ")
- monitor.setCursorPos(zpc2,3)
- monitor.write("RotorSpd: ")
- monitor.setCursorPos(zpc2,4)
- monitor.write("EnergyGen: ")
- monitor.setCursorPos(zpc2,5)
- monitor.write("Energy: ")
- monitor.setCursorPos(zpc2,6)
- monitor.write("Transfer: ")
- -- Reactor Function
- function statusR()
- if reactor.getActive() == true then
- monitor.setTextColor(colors.green)
- a = "Online "
- else
- monitor.setTextColor(colors.red)
- a = "Offline"
- end
- monitor.setCursorPos(8,2)
- monitor.write(a)
- monitor.setTextColor(colors.white)
- end
- function coretemp()
- ft = math.floor(reactor.getFuelTemperature())
- local space = ("")
- if ft < 100 then
- space = (" ")
- end
- monitor.setCursorPos(12,3)
- monitor.write(space..ft.."stC")
- end
- function steamgen()
- hfplt = reactor.getHotFluidProducedLastTick()
- local space = ("")
- if hfplt < 1000 then
- space = (" ")
- if hfplt < 100 then
- space = (" ")
- if hfplt < 10 then
- space = (" ")
- end
- end
- end
- monitor.setCursorPos(11,4)
- monitor.write(space..hfplt.."mB/t")
- end
- function reactivity()
- monitor.setCursorPos(12,5)
- fr = math.floor(reactor.getFuelReactivity())
- monitor.write(fr.."%")
- end
- -- Turbine function
- function statusT()
- if turbine.getActive() == true then
- monitor.setTextColor(colors.green)
- a = "Online "
- else
- monitor.setTextColor(colors.red)
- a = "Offline"
- end
- monitor.setCursorPos(zpc2+8,2)
- monitor.write(a)
- monitor.setTextColor(colors.white)
- end
- function rotorspd()
- rs = math.floor(turbine.getRotorSpeed())
- local space = ("")
- if rs < 1000 then
- space = (" ")
- if rs < 100 then
- space = (" ")
- if rs < 10 then
- space = (" ")
- end
- end
- end
- monitor.setCursorPos(zpc2+11,3)
- monitor.write(space..rs.."RPM")
- end
- function energygen()
- eplt = math.floor(turbine.getEnergyProducedLastTick())
- local space = ("")
- if eplt < 1000 then
- space = (" ")
- if eplt < 100 then
- space = (" ")
- if eplt < 10 then
- space = (" ")
- end
- end
- end
- monitor.setCursorPos(zpc2+11,4)
- monitor.write(space..eplt.."RF/t")
- end
- function energy()
- es = math.floor(turbine.getEnergyStored())
- local space = ("")
- if es < 10000000 then
- space = (" ")
- if es < 100000 then
- space = (" ")
- if es < 10000 then
- space = (" ")
- if es < 1000 then
- space = (" ")
- if es < 100 then
- space = (" ")
- if es < 10 then
- space = (" ")
- end
- end
- end
- end
- end
- end
- monitor.setCursorPos(zpc2+8,5)
- monitor.write(space..es.."RF")
- end
- function transfer()
- es1 = turbine.getEnergyStored()
- os.sleep(1)
- es2 = turbine.getEnergyStored()
- et = math.floor((es2 - es1)/20)
- local space = ("")
- if es < 10000 then
- space = (" ")
- if es < 1000 then
- space = (" ")
- if es < 100 then
- space = (" ")
- if es < 10 then
- space = (" ")
- if es < 0 then
- space = (" ")
- if es < -9 then
- space = (" ")
- if es < -99 then
- space = (" ")
- if es < -999 then
- space = ("")
- end
- end
- end
- end
- end
- end
- end
- end
- monitor.setCursorPos(zpc2+10,6)
- monitor.write(space..et.."RF/t")
- end
- -- Program Cycle
- while true do
- statusR()
- coretemp()
- steamgen()
- reactivity()
- statusT()
- rotorspd()
- energygen()
- energy()
- transfer()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement