Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local args = {...}
- if args[1] == nil then
- print ("Specify the depth to tunnel and place ladders in the turtle's inventory slots, starting at 1.")
- end
- function step()
- while not turtle.forward() do
- turtle.dig()
- end
- end
- function stepBack()
- if not turtle.back() then
- turtle.turnRight()
- turtle.turnRight()
- step()
- turtle.turnRight()
- turtle.turnRight()
- end
- end
- function stepUp()
- while not turtle.up() do
- turtle.digUp()
- end
- end
- function stepDown()
- while not turtle.down() do
- turtle.digDown()
- end
- end
- local depth = tonumber(args[1])
- local slot = 0
- local ladders = 0
- for i = 0, depth, 1 do
- if ladders < 1 then
- slot = slot + 1
- ladders = turtle.getItemCount(slot)
- turtle.select(slot)
- end
- stepDown()
- turtle.dig()
- turtle.place()
- ladders = ladders - 1
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement