Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Dig Shaft
- -- Dig 1x3 Function digIt
- function digIt()
- while turtle.detect() do
- turtle.dig()
- os.sleep(0.5)
- end
- turtle.forward()
- while turtle.detectDown() or turtle.detectUp() do
- turtle.digUp()
- turtle.digDown()
- end
- end
- -- Place torch behind
- function placeTorch()
- turtle.down()
- turtle.back()
- turtle.right()
- turtle.right()
- turtle.select(16)
- turtle.placeForward()
- turtle.right()
- turtle.right()
- turtle.forward()
- turtle.up()
- end
- --set everything to 0
- local run = 0
- local y = 0
- local z = 0
- --Enter length
- term.write("Branch length: ")
- run = read()
- for x = 1, run do
- y = x - 1
- z = y % 10
- if z == 1 then
- placeTorch()
- end
- digIt()
- end
- -- Place final torch mid wall
- turtle.down()
- turtle.turnRight()
- turtle.turnRight()
- turtle.select(16)
- turtle.placeUp()
- --Return to start
- for x = 1, run do
- turtle.forward()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement