Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- screen = peripheral.wrap("monitor_20")
- reactor1 = peripheral.wrap("BigReactors-Reactor_3")
- reactor2 = peripheral.wrap("BigReactors-Reactor_4")
- fuelt1 = 0
- fuelt2 = 0
- while true do
- Fuel1 = reactor1.getFuelAmount()
- Waste1 = reactor1.getWasteAmount()
- Max1 = reactor1.getFuelAmountMax()
- Rods1 = reactor1.getControlRodLevel(0)
- CasingTemp1 = math.floor(reactor1.getCasingTemperature())
- FuelTemp1 = math.floor(reactor1.getFuelTemperature())
- Battery1 = reactor1.getEnergyStored()
- RFT1 = math.floor(reactor1.getEnergyProducedLastTick())
- Fuelpercent1 = math.floor((Fuel1/Max1)*100)
- Wastepercent1 = math.floor((Waste1/Max1)*100)
- Batterypercent1 = math.floor((Battery1/10000000)*100)
- Fuel2 = reactor2.getFuelAmount()
- Waste2 = reactor2.getWasteAmount()
- Max2 = reactor2.getFuelAmountMax()
- Rods2 = reactor2.getControlRodLevel(0)
- CasingTemp2 = math.floor(reactor2.getCasingTemperature())
- FuelTemp2 = math.floor(reactor2.getFuelTemperature())
- Battery2 = reactor2.getEnergyStored()
- RFT2 = math.floor(reactor2.getEnergyProducedLastTick())
- Fuelpercent2 = math.floor((Fuel2/Max2)*100)
- Wastepercent2 = math.floor((Waste2/Max2)*100)
- Batterypercent2 = math.floor((Battery2/10000000))
- if reactor1.getActive() == true then
- active1 = 1
- else
- active1 = 0
- end
- if reactor2.getActive() == true then
- active2 = 1
- else
- active2 = 0
- end
- screen.setTextScale(2)
- screen.setBackgroundColor(32768)
- screen.clear()
- screen.setBackgroundColor(1)
- screen.setTextColor(1)
- screen.setCursorPos(1,10)
- screen.clearLine()
- screen.setCursorPos(1,20)
- screen.clearLine()
- if active1 == 1 then
- if Fuelpercent1 > 70 then
- screen.setBackgroundColor(32)
- end
- if Fuelpercent1 < 71 then
- screen.setBackgroundColor(16)
- end
- if Fuelpercent1 < 41 then
- screen.setBackgroundColor(2)
- end
- if Fuelpercent1 < 21 then
- screen.setBackgroundColor(16384)
- end
- screen.setCursorPos(1,1)
- screen.clearLine()
- screen.setCursorPos(1,2)
- screen.clearLine()
- screen.setCursorPos(1,3)
- screen.clearLine()
- screen.setCursorPos(1,4)
- screen.clearLine()
- screen.setCursorPos(1,5)
- screen.clearLine()
- screen.setCursorPos(1,6)
- screen.clearLine()
- screen.setCursorPos(1,7)
- screen.clearLine()
- screen.setCursorPos(1,8)
- screen.clearLine()
- screen.setCursorPos(1,9)
- screen.clearLine()
- screen.setCursorPos(1,1)
- screen.write("________________Reactor 1________________")
- screen.setCursorPos(1,3)
- screen.write("Fuel: "..Fuelpercent1.."%")
- screen.setCursorPos(1,4)
- screen.write("Waste: "..Wastepercent1.."%")
- screen.setCursorPos(1,5)
- screen.write("Control Rods: "..Rods1.."%")
- screen.setCursorPos(1,6)
- screen.write("Casing Temperature: "..CasingTemp1.."C")
- screen.setCursorPos(1,7)
- screen.write("Fuel Temperature: "..FuelTemp1.."C")
- screen.setCursorPos(1,8)
- screen.write("Producing: "..RFT1.." RF/t")
- screen.setCursorPos(1,9)
- screen.write("Battery: "..Battery1.." RF / "..Batterypercent1.."%")
- else
- screen.setBackgroundColor(32768)
- screen.setCursorPos(1,1)
- screen.clearLine()
- screen.setCursorPos(1,2)
- screen.clearLine()
- screen.setCursorPos(1,3)
- screen.clearLine()
- screen.setCursorPos(1,4)
- screen.clearLine()
- screen.setCursorPos(1,5)
- screen.clearLine()
- screen.setCursorPos(1,6)
- screen.clearLine()
- screen.setCursorPos(1,7)
- screen.clearLine()
- screen.setCursorPos(1,8)
- screen.clearLine()
- screen.setCursorPos(1,9)
- screen.clearLine()
- screen.setCursorPos(1,1)
- screen.write("________________Reactor 1________________")
- screen.setCursorPos(17,4)
- screen.setTextColor(16384)
- screen.write("Disabled")
- screen.setTextColor(1)
- end
- if active2 == 1 then
- if Fuelpercent2 > 70 then
- screen.setBackgroundColor(32)
- end
- if Fuelpercent2 < 71 then
- screen.setBackgroundColor(16)
- end
- if Fuelpercent2 < 41 then
- screen.setBackgroundColor(2)
- end
- if Fuelpercent2 < 21 then
- screen.setBackgroundColor(16384)
- end
- screen.setCursorPos(1,11)
- screen.clearLine()
- screen.setCursorPos(1,12)
- screen.clearLine()
- screen.setCursorPos(1,13)
- screen.clearLine()
- screen.setCursorPos(1,14)
- screen.clearLine()
- screen.setCursorPos(1,15)
- screen.clearLine()
- screen.setCursorPos(1,16)
- screen.clearLine()
- screen.setCursorPos(1,17)
- screen.clearLine()
- screen.setCursorPos(1,18)
- screen.clearLine()
- screen.setCursorPos(1,19)
- screen.clearLine()
- screen.setCursorPos(1,11)
- screen.write("________________Reactor 2________________")
- screen.setCursorPos(1,13)
- screen.write("Fuel: "..Fuelpercent2.."%")
- screen.setCursorPos(1,14)
- screen.write("Waste: "..Wastepercent2.."%")
- screen.setCursorPos(1,15)
- screen.write("Control Rods: "..Rods2.."%")
- screen.setCursorPos(1,16)
- screen.write("Casing Temperature: "..CasingTemp2.."C")
- screen.setCursorPos(1,17)
- screen.write("Fuel Temperature: "..FuelTemp2.."C")
- screen.setCursorPos(1,18)
- screen.write("Producing: "..RFT2.." RF/t")
- screen.setCursorPos(1,19)
- screen.write("Battery: "..Battery2.." RF / "..Batterypercent2.."%")
- else
- screen.setBackgroundColor(32768)
- screen.setCursorPos(1,11)
- screen.clearLine()
- screen.setCursorPos(1,12)
- screen.clearLine()
- screen.setCursorPos(1,13)
- screen.clearLine()
- screen.setCursorPos(1,14)
- screen.clearLine()
- screen.setCursorPos(1,15)
- screen.clearLine()
- screen.setCursorPos(1,16)
- screen.clearLine()
- screen.setCursorPos(1,17)
- screen.clearLine()
- screen.setCursorPos(1,18)
- screen.clearLine()
- screen.setCursorPos(1,19)
- screen.clearLine()
- screen.setCursorPos(1,11)
- screen.write("________________Reactor 2________________")
- screen.setCursorPos(17,14)
- screen.setTextColor(16384)
- screen.write("Disabled")
- screen.setTextColor(1)
- end
- if blink == 1 then
- blink = 0
- if Fuelpercent1 == 0 then
- if Fuelpercent2 == 0 then
- outoffuel = 3
- else
- outoffuel = 1
- end
- else
- if Fuelpercent2 == 0 then
- outoffuel = 2
- else
- outoffuel = 0
- end
- end
- if active1 == 0 then
- if outoffuel == 3 then
- outoffuel = 2
- end
- if outoffuel == 1 then
- outoffuel = 0
- end
- end
- if active2 == 0 then
- if outoffuel == 3 then
- outoffuel = 1
- end
- if outoffuel == 2 then
- outoffuel = 0
- end
- end
- if outoffuel > 0 then
- screen.setBackgroundColor(1)
- screen.setCursorPos(11,7)
- screen.write("---------------------")
- screen.setCursorPos(11,13)
- screen.write("---------------------")
- screen.setCursorPos(11,8)
- screen.write("---------------------")
- screen.setCursorPos(11,9)
- screen.write("---------------------")
- screen.setCursorPos(11,10)
- screen.write("---------------------")
- screen.setCursorPos(11,11)
- screen.write("---------------------")
- screen.setCursorPos(11,12)
- screen.write("---------------------")
- screen.setCursorPos(17,8)
- screen.setTextColor(16384)
- screen.write("Wanrning")
- screen.setTextColor(32768)
- if outoffuel == 3 then
- screen.setCursorPos(15,10)
- screen.write("Reactor")
- screen.setCursorPos(23,10)
- screen.write("1&2")
- screen.setCursorPos(26,10)
- screen.write("are")
- else
- screen.setCursorPos(16,10)
- screen.write("Reactor")
- screen.setCursorPos(24,10)
- if outoffuel == 1 then
- screen.write("1")
- else
- screen.write("2")
- screen.setCursorPos(26,10)
- screen.write("is")
- end
- end
- screen.setCursorPos(16,11)
- screen.write("out")
- screen.setCursorPos(20,11)
- screen.write("of")
- screen.setCursorPos(23,11)
- screen.write("fuel.")
- end
- else
- blink = 1
- end
- if active1 == 1 then
- if (Fuel1 == 70) or (Fuel1 < 70) then
- if fuelt1 == 0 then
- if rs.testBundledInput("left",1) then
- rs.setBundledOutput("left",4)
- sleep(0.3)
- rs.setBundledOutput("left",0)
- else
- rs.setBundledOutput("left",2)
- sleep(0.3)
- rs.setBundledOutput("left",0)
- end
- else
- fuelt1 = fuelt1 - 1
- end
- end
- end
- if active2 == 1 then
- if (Fuel2 == 70) or (Fuel2 < 70) then
- if fuelt2 == 0 then
- if rs.testBundledInput("left",1) then
- rs.setBundledOutput("left",16)
- sleep(0.3)
- rs.setBundledOutput("left",0)
- else
- rs.setBundledOutput("left",8)
- sleep(0.3)
- rs.setBundledOutput("left",0)
- end
- else
- fuelt2 = fuelt2 - 1
- end
- end
- end
- if Batterypercent1 >= 10 then
- reactor1.setAllControlRodLevels(Batterypercent1)
- end
- sleep(0)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement