Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tArgs = { ... }
- if #tArgs ~= 1 then
- print( "tunnel <length>, where length is the number of 6x5 sections you require." )
- return
- end
- function clear()
- while turtle.detect() do
- turtle.dig()
- sleep(0.8)
- end
- end
- function clearForward()
- while turtle.detect() do
- turtle.dig()
- sleep(0.8)
- end
- while not turtle.forward() do
- turtle.attack()
- end
- end
- function clearUp()
- while turtle.detectUp() do
- turtle.digUp()
- sleep(0.8)
- end
- while not turtle.up() do
- turtle.attack()
- end
- end
- function clearDown()
- if turtle.detectDown() then turtle.digDown() end
- end
- turtle.select(1)
- turtle.refuel(1)
- for k=1,tArgs[1] do
- -- Level 0 & 1
- turtle.turnLeft()
- turtle.forward()
- turtle.turnRight()
- turtle.select(2)
- for i=1,6 do
- clear()
- turtle.forward()
- turtle.digDown()
- turtle.placeDown()
- turtle.turnLeft()
- clear()
- turtle.select(3)
- turtle.place()
- turtle.select(2)
- turtle.turnRight()
- end
- turtle.turnRight()
- clear()
- turtle.forward()
- turtle.turnRight()
- turtle.digDown()
- turtle.placeDown()
- for i=1,5 do
- clear()
- turtle.forward()
- turtle.digDown()
- turtle.placeDown()
- end
- turtle.turnLeft()
- clear()
- turtle.forward()
- turtle.select(3)
- clear()
- turtle.place()
- turtle.select(2)
- turtle.digDown()
- turtle.placeDown()
- turtle.turnLeft()
- for i=1,5 do
- clear()
- turtle.forward()
- turtle.digDown()
- turtle.placeDown()
- turtle.turnRight()
- clear()
- turtle.select(3)
- turtle.place()
- turtle.select(2)
- turtle.turnLeft()
- end
- -- Level 2
- clearUp()
- turtle.select(3)
- turtle.turnRight()
- clear()
- turtle.place()
- turtle.turnRight()
- turtle.select(4)
- for i=1,5 do
- clear()
- turtle.forward()
- turtle.turnLeft()
- clear()
- turtle.place()
- turtle.turnRight()
- end
- turtle.turnRight()
- clear()
- turtle.forward()
- clear()
- turtle.forward()
- clear()
- turtle.place()
- turtle.turnRight()
- for i=1,4 do
- clear()
- turtle.forward()
- turtle.turnLeft()
- clear()
- turtle.place()
- turtle.turnRight()
- end
- turtle.select(3)
- clear()
- turtle.forward()
- turtle.turnLeft()
- clear()
- turtle.place()
- turtle.turnRight()
- -- Level 3
- clearUp()
- turtle.turnLeft()
- clear()
- turtle.place()
- turtle.turnLeft()
- for i=1,5 do
- clear()
- turtle.forward()
- turtle.turnRight()
- clear()
- turtle.place()
- turtle.turnLeft()
- end
- turtle.turnLeft()
- clear()
- turtle.forward()
- clear()
- turtle.forward()
- clear()
- turtle.place()
- turtle.turnLeft()
- for i=1,5 do
- clear()
- turtle.forward()
- turtle.turnRight()
- clear()
- turtle.place()
- turtle.turnLeft()
- end
- turtle.back()
- turtle.place()
- turtle.turnLeft()
- clear()
- turtle.forward()
- turtle.turnRight()
- clear()
- turtle.place()
- turtle.turnLeft()
- clear()
- turtle.forward()
- turtle.turnRight()
- clear()
- turtle.place()
- --level 4
- clearUp()
- clear()
- turtle.place()
- turtle.turnRight()
- clear()
- turtle.forward()
- turtle.turnLeft()
- clear()
- turtle.place()
- turtle.turnRight()
- clear()
- turtle.forward()
- turtle.turnLeft()
- clear()
- turtle.place()
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft()
- for i=1,4 do
- clear()
- turtle.forward()
- end
- turtle.select(4)
- for i=1,5 do
- turtle.turnLeft()
- clear()
- turtle.place()
- turtle.turnRight()
- turtle.turnRight()
- clear()
- turtle.place()
- turtle.turnLeft()
- turtle.back()
- end
- -- Cleanup
- clearDown()
- turtle.down()
- clearDown()
- turtle.placeUp()
- for i=1,4 do
- clear()
- turtle.forward()
- turtle.placeUp()
- clearDown()
- end
- turtle.down()
- turtle.down()
- turtle.turnRight()
- turtle.turnRight()
- for i=1,5 do
- turtle.forward()
- end
- end --overall loop
Advertisement
Add Comment
Please, Sign In to add comment