Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --power load balancer
- while true do
- -- start waiting for events
- local event,arg1,arg2,arg3 = os.pullEvent()
- --if a redstone input changed start the timer
- if event == "redstone" then
- timeout = os.startTimer(30)
- end
- --if the timer event triggers then a redstone input has been unchanging for 30 secs so update the balancer
- if event == "timer" and arg1==timeout then
- if redstone.getInput("top") then
- redstone.setOutput("bottom", true)
- print("Balancer updated at "..os.time()..": Power Output Deactivated")
- else
- redstone.setOutput("bottom", false)
- print("Balancer updated at "..os.time()..": Power Output Activated")
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment