Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- turnDistance = 256
- depth = 256
- local tArgs = { ... }
- if (#tArgs == 1) then
- depth = tonumber(tArgs[1])
- elseif (#tArgs == 2) then
- depth = tonumber(tArgs[1])
- turnDistance = tonumber(tArgs[2])
- end
- function digStairs()
- success = true
- while turtle.detect()==true do
- success = turtle.dig()
- end
- while success and turtle.forward() == false do -- takes care of gravel falling in the way
- success = turtle.dig()
- end
- while success and turtle.detectUp()==true do
- success = turtle.digUp()
- end
- while success and turtle.detect()==true do
- success = turtle.dig()
- end
- while success and turtle.detectDown()==true do
- success= turtle.digDown()
- end
- if success then
- turtle.down()
- end
- return success
- end
- i = 0
- while digStairs()==true and i <depth do
- i = i + 1
- if i % turnDistance == 0 then
- turtle.dig()
- turtle.up()
- turtle.dig()
- turtle.forward()
- turtle.digUp()
- turtle.turnLeft()
- turtle.dig()
- turtle.forward()
- turtle.digUp()
- turtle.digDown()
- turtle.turnLeft()
- turtle.dig()
- turtle.forward()
- turtle.digUp()
- turtle.digDown()
- turtle.down()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment