SHOW:
|
|
- or go back to the newest paste.
| 1 | -- # One row # | |
| 2 | if turtle.detectDown() then | |
| 3 | turtle.up() | |
| 4 | end | |
| 5 | ||
| 6 | local args = { … }
| |
| 7 | local dist = tonumber(args[1]) | |
| 8 | for i=1,dist,1 do | |
| 9 | turtle.dig() | |
| 10 | turtle.forward() | |
| 11 | turtle.digUp() | |
| 12 | turtle.digDown() | |
| 13 | end | |
| 14 | ||
| 15 | -- # Full inventory # | |
| 16 | turtle.select(9) | |
| 17 | if turtle.getItemCount > 0 then | |
| 18 | turtle.select(7) | |
| 19 | turtle.place() | |
| 20 | turtle.select(1) | |
| 21 | turtle.drop() | |
| 22 | turtle.select(2) | |
| 23 | turtle.drop() | |
| 24 | turtle.select(3) | |
| 25 | turtle.drop() | |
| 26 | turtle.select(4) | |
| 27 | turtle.drop() | |
| 28 | turtle.select(5) | |
| 29 | turtle.drop() | |
| 30 | turtle.select(6) | |
| 31 | turtle.drop() | |
| 32 | turtle.select(7) | |
| 33 | turtle.dig() | |
| 34 | end | |
| 35 | ||
| 36 | -- # Return, placing torches # | |
| 37 | turtle.select(8) | |
| 38 | ||
| 39 | for i=1, dist do | |
| 40 | turtle.back() | |
| 41 | ||
| 42 | if i % 5 == 0 then | |
| 43 | turtle.place() | |
| 44 | end | |
| 45 | ||
| 46 | turtle.turnLeft() | |
| 47 | turtle.forward() | |
| 48 | turtle.forward() | |
| 49 | turtle.forward() | |
| 50 | turtle.turnRight() | |
| 51 | end | |
| 52 | end |