Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local timer_reset=5 --time in seconds between checking for activity
- --------------------------------------------------------
- local active=false
- local run=true
- os.startTimer(timer_reset)
- while run do
- local event=os.pullEvent()
- if event == "turtle_inventory" then -- if something is messing with the inventory
- active=true -- the miner is active
- elseif event == "timer" then -- if the timer has timed out
- if active then -- if it has done something since last timer
- os.startTimer(timer_reset) -- start a new timer
- active=false -- reset boolean
- else -- otherwise
- rs.setOutput("top",true) -- output redstone on top face
- run=false -- stop running
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment