SHOW:
|
|
- or go back to the newest paste.
| 1 | local minFuel = 600 | |
| 2 | function checkFuel() | |
| 3 | if turtle.getFuelLevel() < minFuel then | |
| 4 | turtle.select(16) | |
| 5 | if turtle.compareDown() then | |
| 6 | - | while turtle.getFuelLevel() < minFuel then |
| 6 | + | while turtle.getFuelLevel() < minFuel do |
| 7 | - | turtle.select(15) |
| 7 | + | turtle.select(14) |
| 8 | turtle.suckDown() | |
| 9 | turtle.refuel() | |
| 10 | if turtle.getFuelLevel() < minFuel then | |
| 11 | sleep(60) | |
| 12 | end | |
| 13 | end | |
| 14 | end | |
| 15 | end | |
| 16 | end | |
| 17 | ||
| 18 | function tryDump() | |
| 19 | turtle.select(16) | |
| 20 | if turtle.compareUp() then | |
| 21 | - | for i = 1,15 do |
| 21 | + | for i = 1,14 do |
| 22 | if turtle.getItemCount(i) > 0 then | |
| 23 | turtle.select(i) | |
| 24 | while not turtle.dropUp() do | |
| 25 | sleep(30) | |
| 26 | end | |
| 27 | end | |
| 28 | end | |
| 29 | end | |
| 30 | end | |
| 31 | ||
| 32 | function isTurn() | |
| 33 | turtle.select(15) | |
| 34 | return turtle.compare() | |
| 35 | - | if turtle.detect() then |
| 35 | + | |
| 36 | ||
| 37 | while true do | |
| 38 | checkFuel() | |
| 39 | tryDump() | |
| 40 | if isTurn() then | |
| 41 | - | turtle.forwards() |
| 41 | + | |
| 42 | sleep(5) | |
| 43 | end | |
| 44 | turtle.select(1) | |
| 45 | turtle.dig() | |
| 46 | turtle.forward() | |
| 47 | end |