Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- args={...}
- delay=tonumber(args[1] or 1200)
- function ensureFuel()
- while turtle.getFuelLevel()==0 do
- shell.run'refuel all'
- sleep(10)
- end
- end
- function go(action)
- ensureFuel()
- i=0
- while action() do
- i=i+1
- turtle.select(1)
- turtle.digDown()
- turtle.select(16)
- turtle.placeDown()
- sleep(1)
- end
- return i
- end
- local i
- while true do
- i=go(turtle.forward)
- turtle.select(1)
- turtle.drop()
- turtle.select(16)
- turtle.drop(math.min(turtle.getItemCount(16)-i,0))
- sleep(delay)
- i=go(turtle.back)
- end
Advertisement
Add Comment
Please, Sign In to add comment