Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tArgs = { ... }
- if #tArgs ~= 1 then
- print( "Usage: tunnel <width>" )
- return
- end
- local width = tonumber( tArgs[1] )
- if width < 1 then
- print( "Tunnel Width must be positive" )
- return
- end
- local move = 0
- print("Tunnelling...")
- loop = 1
- while loop == 1 do
- move = width
- --Start
- if turtle.detect() then
- turtle.dig()
- turtle.forward()
- else
- turtle.forward()
- end
- turtle.turnLeft
- --Side Movement
- while move > 0 do
- if turtle.detectDown() then
- turtle.digDown()
- end
- if turtle.detect() then
- turtle.dig()
- turtle.forward()
- move = move - 1
- else
- turtle.forward()
- move = move - 1
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement