SHOW:
|
|
- or go back to the newest paste.
| 1 | length = tonumber(arg[1]) | |
| 2 | if length == nil then | |
| 3 | print("set length please")
| |
| 4 | exit() | |
| 5 | end | |
| 6 | if turtle.getFuelLevel() <= (3*length) then | |
| 7 | print("not enough fuel")
| |
| 8 | end | |
| 9 | current = 0 | |
| 10 | while current < length do | |
| 11 | res = turtle.dig() | |
| 12 | if not res then break end | |
| 13 | res = turtle.forward() | |
| 14 | if not res then break end | |
| 15 | current = current + 1 | |
| 16 | res = turtle.digUp() | |
| 17 | if not res then break end | |
| 18 | end | |
| 19 | turtle.turnLeft() | |
| 20 | turtle.turnLeft() | |
| 21 | while current > 0 do | |
| 22 | turtle.dig() | |
| 23 | if turtle.forward() then | |
| 24 | current = current - 1 | |
| 25 | end | |
| 26 | end | |
| 27 |