Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local version = "1.5beta"
- r = peripheral.find("BigReactors-Reactor")
- mon = peripheral.wrap("monitor_1")
- bank = peripheral.find("draconicevolution_tileenergypylon")
- timer = 0
- time0 = 0
- time1 = 0
- term.clear()
- if r then
- else
- term.setCursorPos(1,1)
- error("Reactor not found")
- end
- if mon then
- else
- term.setCursorPos(1,1)
- error("Monitor not found")
- end
- mon.clear()
- r.setActive(true)
- --Information Loop
- while true do
- --Checking if reactor was disconnected while program was running
- mon = peripheral.find("monitor")
- r = peripheral.find("BigReactors-Reactor")
- if r then
- else
- term.clear()
- term.setCursorPos(1,1)
- error("Reactor was disconnected")
- end
- if mon then
- else
- term.clear()
- term.setCursorPos(1,1)
- error("Monitor was disconnected")
- end
- if r.getEnergyProducedLastTick() == nil then
- error("There seems to be a chunk boundary between the computer and reactor. This program will not function if this is true")
- end
- term.setTextColor(colors.white)
- mon.setTextColor(colors.white)
- term.setCursorPos(1,1)
- mon.setCursorPos(1,1)
- --SCALE OF THE TEXT ON MONITOR
- mon.setTextScale(1)
- write("Power Status:")
- mon.write("Power Status:")
- term.setCursorPos(1,2)
- mon.setCursorPos(1,2)
- rproduced = r.getEnergyProducedLastTick()
- term.setTextColor(colors.green)
- mon.setTextColor(colors.green)
- write("Generated: "..(math.floor(rproduced+0,5).." RF/t "))
- mon.write("Generated: "..(math.floor(rproduced+0,5).." RF/t "))
- mon.setTextColor(colors.white)
- term.setCursorPos(1,3)
- mon.setCursorPos(1,3)
- bankstored = bank.getEnergyStored()
- bankmax = bank.getMaxEnergyStored()
- storedenergy = r.getEnergyStored()
- if storedenergy < 500000 then
- term.setTextColor(colors.red)
- mon.setTextColor(colors.red)
- write("Stored (Reactor): "..math.floor(r.getEnergyStored()+0,5).." RF ")
- mon.write("Stored (Reactor): "..math.floor(r.getEnergyStored()+0,5).." RF ")
- elseif storedenergy > 7000000 then
- term.setTextColor(colors.green)
- mon.setTextColor(colors.green)
- write("Stored (Reactor): "..math.floor(r.getEnergyStored()+0,5).." RF ")
- mon.write("Stored (Reactor): "..math.floor(r.getEnergyStored()+0,5).." RF ")
- elseif storedenergy > 500000 then
- term.setTextColor(colors.orange)
- mon.setTextColor(colors.orange)
- write("Stored (Reactor): "..math.floor(r.getEnergyStored()+0,5).." RF ")
- mon.write("Stored (Reactor): "..math.floor(r.getEnergyStored()+0,5).." RF ")
- else
- term.setTextColor(colors.green)
- mon.setTextColor(colors.green)
- write("Stored (Reactor): "..math.floor(r.getEnergyStored()+0,5).." RF ")
- mon.write("Stored (Reactor): "..math.floor(r.getEnergyStored()+0,5).." RF ")
- end
- term.setCursorPos(1,4)
- mon.setCursorPos(1,4)
- write("Stored (Bank): "..bankstored.." / "..bankmax.." RF ")
- mon.write("Stored (Bank): "..bankstored.." / "..bankmax.." RF ")
- term.setCursorPos(1,7)
- mon.setCursorPos(1,7)
- term.setTextColor(colors.white)
- mon.setTextColor(colors.white)
- write("Reactor Status:")
- mon.write("Reactor Status:")
- term.setCursorPos(1,8)
- mon.setCursorPos(1,8)
- term.setTextColor(colors.white)
- mon.setTextColor(colors.white)
- term.setCursorPos(1,10)
- mon.setCursorPos(1,10)
- write("Fuel Status:")
- mon.write("Fuel Status:")
- if r.getActive() == true then
- term.setTextColor(colors.green)
- mon.setTextColor(colors.green)
- term.setCursorPos(1,8)
- mon.setCursorPos(1,8)
- write("Online ")
- mon.write("Online ")
- mon.setTextColor(colors.white)
- else
- term.setTextColor(colors.red)
- mon.setTextColor(colors.red)
- term.setCursorPos(1,8)
- mon.setCursorPos(1,8)
- write("Offline")
- mon.write("Offline")
- term.setTextColor(colors.white)
- mon.setTextColor(colors.white)
- end
- term.setCursorPos(1,11)
- mon.setCursorPos(1,11)
- coretemp = r.getFuelTemperature()
- if coretemp < 1000 then
- term.setTextColor(colors.green)
- write("Core Temp: "..math.floor(coretemp+0,5).." C (Low) ")
- mon.setTextColor(colors.green)
- mon.write("Core Temp: "..math.floor(coretemp+0,5).." C (Low) ")
- elseif coretemp > 2000 then
- term.setTextColor(colors.red)
- write("Core Temp: "..math.floor(coretemp+0,5).." C (High!) ")
- mon.setTextColor(colors.red)
- mon.write("Core Temp: "..math.floor(coretemp+0,5).." C (High!) ")
- elseif coretemp > 1000 then
- term.setTextColor(colors.orange)
- write("Core Temp: "..math.floor(coretemp+0,5).." C (Medium) ")
- mon.setTextColor(colors.orange)
- mon.write("Core Temp: "..math.floor(coretemp+0,5).." C (Medium) ")
- end
- term.setTextColor(colors.orange)
- term.setCursorPos(1,12)
- mon.setTextColor(colors.orange)
- mon.setCursorPos(1,12)
- fuelreactivity = r.getFuelReactivity()
- write("Fuel Reactivity: "..math.floor(fuelreactivity+5).."% ")
- mon.write("Fuel Reactivity: "..math.floor(fuelreactivity+5).."% ")
- term.setCursorPos(1,13)
- mon.setCursorPos(1,13)
- fuelburn = r.getFuelConsumedLastTick()/1000
- write("Fuel Burnup: "..fuelburn.." ingots/t ")
- mon.write("Fuel Burnup: "..fuelburn.." ingots/t ")
- fuelamount = r.getFuelAmount()/1000
- wasteamount = r.getWasteAmount()/1000
- maxfuel = r.getFuelAmountMax()/1000
- term.setCursorPos(1,14)
- mon.setCursorPos(1,14)
- write("Fuel Amount: "..fuelamount.." ingots ")
- mon.write("Fuel Amount: "..fuelamount.." ingots ")
- term.setCursorPos(1,15)
- mon.setCursorPos(1,15)
- write("Waste Amount: "..wasteamount.." ingots ")
- mon.write("Waste Amount: "..wasteamount.." ingots ")
- term.setCursorPos(1,16)
- mon.setCursorPos(1,16)
- write("Maximal Fuel: "..maxfuel.." ingots")
- mon.write("Maximal Fuel: "..maxfuel.." ingots")
- w,h = mon.getSize()
- term.setCursorPos(1,20)
- mon.setCursorPos(1,h)
- time0 = time0+1
- if time0 == 600 then
- time1 = time1+1
- time0 = 0
- end
- if time1 == 1 then
- write("Running: "..time1.." minute ")
- mon.write("Running: "..time1.." minute ")
- else
- write("Running for "..time1.." minutes ")
- mon.write("Running: "..time1.." minutes ")
- end
- mon.setCursorPos(12,19)
- --mon.write(" ")
- mon.setTextColor(colors.white)
- timer = timer+1
- if timer == 2 then
- gen2 = (r.getEnergyProducedLastTick())
- in2 = (r.getEnergyStored())
- used = (in1+gen2-in2)
- term.setCursorPos(1,5)
- mon.setCursorPos(1,5)
- if used > rproduced then
- term.setTextColor(colors.red)
- mon.setTextColor(colors.red)
- write("Usage (Reactor): "..math.floor(used+0,5).." RF/t ")
- mon.write("Usage (Reactor): "..math.floor(used+0,5).." RF/t ")
- elseif used < rproduced then
- mon.setTextColor(colors.green)
- term.setTextColor(colors.green)
- write("Usage (Reactor): "..math.floor(used+0,5).." RF/t ")
- mon.write("Usage (Reactor): "..math.floor(used+0,5).." RF/t ")
- else
- term.setTextColor(colors.white)
- mon.setTextColor(colors.white)
- write("Usage (Reactor): "..math.floor(used+0,5).." RF/t (Calculation Error) ")
- mon.write("Usage (Reactor): "..math.floor(used+0,5).." RF/t (Calculation Error) ")
- end
- timer = (timer-2)
- else
- gen1 = (r.getEnergyProducedLastTick())
- in1 = (r.getEnergyStored())
- end
- if storedenergy > 9900000 and r.getActive() == true then
- r.setActive(false)
- errorfix = true
- elseif storedenergy < 9900000 and errorfix == true then
- r.setActive(true)
- errorfix = false
- end
- sleep(0,1)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement