Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Daelie Nuclear MOX Control Program Version 1.0
- --temperature variables
- runningTemp = 36000
- shutdownTemp = 37000
- --interfaces
- overclockInterface = "east"
- coolantInterface = "west"
- --peripheral
- reactor = peripheral.wrap("back")
- rednet.open('top')
- function getHeat()
- getHeat = 0
- getHeat = reactor.getHeat()
- print("Current Temp.: "..getHeat)
- end
- function getOutput()
- getOutput = reactor.getEUOutput()
- --Output reported 5x lower than should be
- getOutput = getOutput*5
- print("Current Output (Eu/t): "..getOutput)
- end
- function checkOverheat()
- --overheat conditions reactor on shutdowntemp
- if reactor.isActive() == true then
- if getHeat >= shutdownTemp then
- --enter the cooldown phase
- rednet.send( 1,"off" )
- print("Reactor overheating, shutdown")
- --loop to swap coolant for overclockers
- overclockSlot = 1
- for i = 37,40,1 do
- reactor.pushItem(coolantInterface, i, 1)
- reactor.pullItemIntoSlot(overclockInterface, overclockSlot, 1, i)
- overclockSlot = overclockSlot + 1
- end
- else
- print("Reactor currently below shutdown")
- end
- end
- end
- function restartAfterOverheat()
- --reactor would be off, below shutdown
- if reactor.isActive() == false then
- if getHeat < shutdownTemp then
- --reswap the coolants
- coolantSlot = 1
- for i = 37, 40, 1 do
- reactor.pushItem(overclockInterface, i, 1)
- reactor.pullItemIntoSlot(coolantInterface, coolantSlot, 1, i)
- coolantSlot = coolantSlot + 1
- end
- --turn back on the reactor
- rednet.send( 1,"on" )
- end
- else
- print("Reactor On, No Restart Required")
- end
- end
- while true do
- getHeat()
- checkOverheat()
- restartAfterOverheat()
- sleep(0.8)
- end
Advertisement
Add Comment
Please, Sign In to add comment