Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- args = {...}
- length = args[1]
- function checkfuel()
- if turtle.getFuelLevel() <= 4 then
- turtle.select(16)
- turtle.refuel(1)
- turtle.select(1)
- end
- end
- function dig()
- while turtle.detect() do
- turtle.dig()
- os.sleep(.5)
- end
- end
- function digUp()
- while turtle.detectUp() do
- turtle.digUp()
- os.sleep(.5)
- end
- end
- function forward()
- checkfuel()
- while turtle.forward() == false do
- dig()
- turtle.attack()
- checkfuel()
- os.sleep(.5)
- end
- digUp()
- if turtle.detectDown() == false then
- turtle.placeDown()
- end
- end
- function tunnel(x)
- for i=1,x do
- forward()
- if i % 12 == 0 then
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.select(15)
- turtle.place()
- turtle.select(1)
- turtle.turnLeft()
- turtle.turnLeft()
- end
- end
- end
- tunnel(length)
Add Comment
Please, Sign In to add comment