Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local reactor = peripheral.wrap("front")
- local wired = peripheral.wrap("right")
- local wireless = peripheral.wrap("left")
- local relayID = 6
- local active, euOutput, heat, heatMax
- local failsafeOn = false
- function OpenWireless()
- rednet.open("left")
- end
- function SendToRelay(msg)
- rednet.send(relayID, msg)
- end
- function MainLoop()
- while true do
- sleep(1)
- term.clear()
- active = reactor.getMetadata().reactor.active
- euOutput = reactor.getOfferedEnergy()
- heat = reactor.getMetadata().reactor.heat
- heatMax = reactor.getMetadata().reactor.maxHeat
- 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