Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Big reactors active cooled reactors
- local reactor = peripheral.wrap("BigReactors-Reactor_5")
- local mon = peripheral.wrap("top")
- local maxfuel = reactor.getFuelAmountMax()
- local maxsteam = reactor.getHotFluidAmountMax()
- local autorod = 0
- local rod = reactor.getControlRodLevel(0)
- local x = 0
- local y = 0
- local function main()
- while true do
- mon.clear()
- mon.setCursorPos(1,1)
- mon.setTextColor(colors.white)
- mon.write("Active:")
- if reactor.getActive() then
- mon.setBackgroundColor(colors.green)
- mon.write(" True")
- else
- mon.setBackgroundColor(colors.red)
- mon.setTextColor(colors.black)
- mon.write(" False")
- end
- mon.setBackgroundColor(colors.black)
- mon.setCursorPos(1,2)
- mon.setTextColor(colors.white)
- mon.write("Steam/t: ")
- mon.setTextColor(colors.lime)
- mon.write(math.floor(reactor.getHotFluidProducedLastTick()))
- mon.write(" mB/t")
- mon.setCursorPos(1,3)
- mon.setTextColor(colors.white)
- mon.write("Steam Stored: ")
- mon.setTextColor(colors.lime)
- mon.write(math.floor(reactor.getHotFluidAmount()))
- mon.write(" mB")
- mon.setCursorPos(1,4)
- mon.setTextColor(colors.white)
- mon.write("Control Rods: ")
- mon.setTextColor(colors.lime)
- mon.write(reactor.getControlRodLevel(0))
- mon.write(" %")
- mon.setCursorPos(1,5)
- mon.setTextColor(colors.white)
- mon.write("Fuel BR: ")
- mon.setTextColor(colors.lime)
- mon.write(tostring(reactor.getFuelConsumedLastTick()))
- mon.write(" mB/t")
- mon.setCursorPos(1,6)
- mon.setTextColor(colors.white)
- mon.write("Fuel Amount: ")
- mon.setTextColor(colors.lime)
- mon.write(reactor.getFuelAmount()*100/maxfuel)
- mon.write(" %")
- mon.setCursorPos(1,7)
- mon.setTextColor(colors.white)
- mon.write("Waste Amount: ")
- mon.setTextColor(colors.lime)
- mon.write(reactor.getWasteAmount()*100/maxfuel)
- mon.write(" %")
- mon.setCursorPos(1,8)
- mon.setTextColor(colors.white)
- mon.write("Core heat: ")
- mon.setTextColor(colors.lime)
- mon.write(math.floor(reactor.getFuelTemperature()))
- mon.write(" C")
- mon.setCursorPos(1,9)
- mon.setTextColor(colors.white)
- mon.write("Casing heat: ")
- mon.setTextColor(colors.lime)
- mon.write(math.floor(reactor.getCasingTemperature()))
- mon.write(" C")
- mon.setCursorPos(1,10)
- mon.setTextColor(colors.white)
- mon.write("Rod auto-adjust:")
- if autorod == 1 then
- mon.setBackgroundColor(colors.green)
- mon.write(" True")
- rod = math.floor(reactor.getHotFluidAmount()*100/maxsteam)
- reactor.setAllControlRodLevels(rod)
- else
- mon.setBackgroundColor(colors.red)
- mon.setTextColor(colors.black)
- mon.write(" False")
- end
- mon.setBackgroundColor(colors.black)
- mon.setCursorPos(1,11)
- mon.setTextColor(colors.white)
- mon.write("Manual rod: ")
- mon.setBackgroundColor(colors.white)
- mon.setTextColor(colors.black)
- mon.write("<->")
- mon.setBackgroundColor(colors.black)
- mon.setTextColor(colors.white)
- mon.write(":")
- mon.setBackgroundColor(colors.white)
- mon.setTextColor(colors.black)
- mon.write("<+>")
- mon.setBackgroundColor(colors.black)
- mon.setCursorPos(1,12)
- mon.setTextColor(colors.white)
- mon.write("Fuel reactivity: ")
- mon.setTextColor(colors.lime)
- mon.write(math.floor(reactor.getFuelReactivity()))
- mon.write("%")
- if (x >= 9) and (x <= 14) and (y == 1) then
- if reactor.getActive() then
- reactor.setActive(false)
- else
- reactor.setActive(true)
- end
- x = 0
- y = 0
- end
- if (x >= 17) and (x <= 22) and (y == 10) then
- if autorod > 0 then
- autorod = 0
- else
- autorod = 1
- end
- x = 0
- y = 0
- end
- if autorod == 0 then
- if (x >= 13) and (x <= 15) and (y == 11) then
- rod = rod - 1
- reactor.setAllControlRodLevels(rod)
- x = 0
- y = 0
- end
- if (x >=17 ) and (x<= 19) and (y == 11) then
- rod = rod + 1
- reactor.setAllControlRodLevels(rod)
- x = 0
- y = 0
- end
- end
- sleep(1)
- end
- end
- local function touch()
- while true do
- _, _, x, y = os.pullEvent("monitor_touch")
- end
- end
- parallel.waitForAny(main,touch)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement