Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function countblocks()
- return 8
- end
- function Swap()
- turtle.dig()
- turtle.place()
- end
- function SwapDown()
- turtle.digDown()
- turtle.placeDown()
- end
- function SwapUp()
- turtle.digUp()
- turtle.placeUp()
- end
- function refill_blocks()
- turtle.select(16)
- turtle.place()
- for i=1,14 do
- if turtle.getItemCount(i) == 0 then
- while turtle.getItemSpace(i) ~= 0 do
- turtle.select(i)
- turtle.suck()
- end
- end
- end
- turtle.select(16)
- turtle.dig()
- end
- function TunnelIter()
- turtle.dig()
- turtle.forward()
- turtle.turnRight()
- Swap()
- SwapDown()
- turtle.turnLeft()
- turtle.turnLeft()
- turtle.forward()
- Swap()
- SwapDown()
- turtle.digUp()
- turtle.up()
- Swap()
- SwapUp()
- turtle.turnRight()
- turtle.turnRight()
- turtle.dig()
- turtle.forward()
- Swap()
- SwapUp()
- turtle.down()
- turtle.turnLeft()
- end
- function main( args )
- print(args)
- local tunlen = tonumber(args[1])
- local i = 0
- while i < tunlen do
- if turtle.getFuelLevel < 10 then
- if countblocks() >= 8 then
- TunnelIter()
- i=i+1
- else
- refill_blocks()
- turtle.select(1)
- end
- else
- turtle.refuel(15)
- end
- end
- end
- arg = {...}
- main(arg)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement