Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local blocksMined = 0
- local col = 0
- local args = {...}
- local colsToMine = args[1]
- local length = args[2]
- function checkFuel()
- turtle.select(16)
- if turtle.getItemCount(16) == 0 then
- print("Add coal to slot 16!")
- sleep(2)
- else
- turtle.refuel(1)
- end
- end
- function dig()
- while turtle.detect() do
- turtle.dig()
- end
- blocksMined = blocksMined + 1
- end
- function forward()
- while not turtle.forward() do
- checkFuel()
- dig()
- end
- checkFuel()
- end
- function turn()
- if col%2 > 0 then
- left()
- col = col + 1
- else
- right()
- col = col + 1
- end
- end
- function left()
- turtle.turnLeft()
- dig()
- forward()
- turtle.turnLeft()
- end
- function right()
- turtle.turnRight()
- dig()
- forward()
- turtle.turnRight()
- end
- function mineCol()
- for i=0, length do
- dig()
- forward()
- end
- turn()
- end
- for i=1, colsToMine do
- print("Mining column "..i)
- mineCol()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement