Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.unloadAPI("/miner/movement")
- os.loadAPI("/miner/movement")
- local depth
- local torchPlacementInterval=7
- local maxRetryCount=20
- function returnAfterRetryFailed()
- movement.move(0, 0, 0)
- movement.face("NORTH")
- write("\Move retry count reached!\n")
- print("Did you reach bedrock?")
- error()
- end
- function mineBlockAndMoveDown()
- local retryCount=0
- while movement.down()==false do
- if retryCount>=maxRetryCount then
- returnAfterRetryFailed()
- end
- if turtle.digDown()==false then
- turtle.attackDown()
- end
- sleep(0.500)
- retryCount=retryCount+1
- end
- end
- function digDown(depth)
- for i=1,depth do
- mineBlockAndMoveDown()
- end
- end
- local args={...}
- if #args >= 1 then
- depth=tonumber(args[1])
- digDown(depth)
- else
- print("digDown [depth]")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement