Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- reactor = peripheral.wrap("nuclear_reactor_1")
- wired = peripheral.wrap("top")
- wireless = peripheral.wrap("left")
- local relayID = 18
- local active, euOutput, heat, heatMax
- local failsafeOn = false
- function OpenWireless()
- rednet.open("left")
- rednet.close("top")
- end
- function OpenWired()
- rednet.open("top")
- rednet.close("left")
- end
- function SendToRelay(msg)
- rednet.send(relayID, msg)
- end
- function MainLoop()
- while true do
- sleep(1)
- OpenWired()
- term.clear()
- active = reactor.isActive()
- euOutput = reactor.getEUOutput() * 5
- heat = reactor.getHeat()
- heatMax = reactor.getMaxHeat()
- OpenWireless()
- SendToRelay("<active>" .. tostring(active))
- SendToRelay("<euoutput>" .. euOutput)
- SendToRelay("<heat>" .. heat)
- SendToRelay("<heatmax>" .. heatMax)
- end
- end
- function FailSafe()
- sleep(5)
- if heat > (heatMax - 900) and failsafeOn == false then
- redstone.setOutput("front", false)
- failsafeOn = true
- end
- end
- redstone.setOutput("front", true)
- MainLoop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement