Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local reactor = peripheral.wrap("back")
- local output
- local looper = true
- function customSleep()
- local timer = os.startTimer(5)
- repeat
- local sEvent, param = os.pullEvent( "timer" )
- until param == timer
- end
- while true do
- output = "" .. os.time()
- if not reactor.getConnected() then
- output = output.. "no reactor connected"
- else
- if reactor.getActive() then
- output = output .. " reactor is active at "
- else
- output = output .. " reactor is disabled at "
- end
- output = output .. reactor.getEnergyStored() .. "RF"
- if reactor.getEnergyStored() < 3000000 then
- reactor.setActive(true)
- end
- if reactor.getEnergyStored() > 7000000 then
- reactor.setActive(false)
- end
- end
- print(output)
- os.startTimer(5)
- os.pullEvent( "timer")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement