Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local turbine = peripheral.wrap("left")
- local reactor = peripheral.wrap("BigReactors-Reactor_0")
- rednet.open("back")
- while true do
- local tPower = turbine.getEnergyStored()
- local fuel = reactor.getFuelAmount()
- local fuelMax = reactor.getFuelAmountMax()
- local fuelPercent = math.floor(fuel/fuelMax*100)
- local status = {
- ["reactor"] = {
- status = "OK"
- },
- ["turbine"] = {
- status = "OK"
- }
- }
- if tPower <= 990000 or fuelPercent <= 60 then
- redstone.setOutput("right", true)
- print("Turbine power or reactor fuel low... emitting")
- else
- redstone.setOutput("right", false)
- print("Turbine power and reactor fuel OK.")
- end
- if tPower <= 990000 then
- status.turbine.status = "LOW POWER"
- end
- if fuelPercent <= 60 then
- status.reactor.status = "LOW FUEL"
- end
- rednet.send(4, status)
- sleep(2)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement