Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local x = 1
- function df() -- Dig forward on block
- turtle.dig()
- turtle.forward()
- turtle.digUp()
- turtle.digDown()
- end
- function line() -- Dig a line x blocks long
- for i = 1,x do
- df()
- end
- end
- function leftAround() --turn around to the left
- turtle.turnLeft()
- df()
- turtle.turnLeft()
- end
- function rightAround() --turn around to the right
- turtle.turnRight()
- df()
- turtle.turnRight()
- end
- function reverse() --does a full 180 in the same block
- turtle.turnLeft()
- turtle.turnLeft()
- end
- function layer() --digs a plane 3 blocks wide
- line()
- leftAround()
- line()
- rightAround()
- line()
- end
- function round() --moves one layer down and does a 180
- turtle.down()
- reverse()
- end
- -- Main Function --
- term.write("Depth = ") --gets x from the user
- x = tonumber(read())
- layer() --hard coded tunnel
- round()
- for i = 1,x do --returns to the beginning of the tunnel
- turtle.forward()
- end
- turtle.turnLeft()
- turtle.forward()
- turtle.turnRight()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement