SHOW:
|
|
- or go back to the newest paste.
| 1 | local tArgs = { ... }
| |
| 2 | local nCount = tArgs[1] | |
| 3 | - | local nDir = tArgs[2] |
| 3 | + | |
| 4 | - | function restock() |
| 4 | + | |
| 5 | - | if turtle.getItemCount(1) < 36 then |
| 5 | + | print("Usage: dig <count>")
|
| 6 | - | for i=15,2,-1 do |
| 6 | + | return |
| 7 | - | if turtle.getItemCount(i) > 0 then |
| 7 | + | |
| 8 | - | sleep(0.25) |
| 8 | + | |
| 9 | - | turtle.select(i) |
| 9 | + | |
| 10 | - | turtle.transferTo(1) |
| 10 | + | print("Arg 1, <count> must be greater than zero!")
|
| 11 | - | turtle.select(1) |
| 11 | + | return |
| 12 | - | end |
| 12 | + | |
| 13 | - | if turtle.getItemCount(1) > 36 then |
| 13 | + | |
| 14 | - | return true |
| 14 | + | while nCount do |
| 15 | - | end |
| 15 | + | |
| 16 | - | end |
| 16 | + | turtle.forward() |
| 17 | - | return false |
| 17 | + | nCount = nCount - 1 |
| 18 | else | |
| 19 | - | return true |
| 19 | + | turtle.dig() |
| 20 | - | end |
| 20 | + | |
| 21 | end |