SHOW:
|
|
- or go back to the newest paste.
| 1 | //1st slot should be a bucket, 2nd slot should be a tank, 3rd slot should be an ender chest | |
| 2 | - | function miF() |
| 2 | + | |
| 3 | - | if t.detect() then |
| 3 | + | |
| 4 | - | t.dig() |
| 4 | + | |
| 5 | - | end |
| 5 | + | function f() |
| 6 | if t.detect() then | |
| 7 | - | function moF() |
| 7 | + | t.dig() |
| 8 | - | if not t.detect() then |
| 8 | + | t.forward() |
| 9 | - | t.forward() |
| 9 | + | else |
| 10 | - | end |
| 10 | + | t.forward() |
| 11 | end | |
| 12 | - | function mmF() |
| 12 | + | |
| 13 | - | miF() |
| 13 | + | function d() |
| 14 | - | moF() |
| 14 | + | if t.detectDown() then |
| 15 | t.digDown() | |
| 16 | - | function miU() |
| 16 | + | t.down() |
| 17 | - | if t.detectUp() then |
| 17 | + | else |
| 18 | - | t.digUp() |
| 18 | + | t.down() |
| 19 | - | end |
| 19 | + | end |
| 20 | end | |
| 21 | - | function mm() |
| 21 | + | |
| 22 | - | mmF() |
| 22 | + | function refuel() |
| 23 | - | miU() |
| 23 | + | if t.getFuelLevel() == 0 then |
| 24 | while t.getFuelLevel < t.getFuelLimit() do | |
| 25 | - | function fu(num) |
| 25 | + | pleaseRefill() |
| 26 | - | t.refuel(num/40) |
| 26 | + | end |
| 27 | end | |
| 28 | - | function go(num) |
| 28 | + | |
| 29 | - | while num > 0 do |
| 29 | + | function store() |
| 30 | - | mm() |
| 30 | + | if t.getItemCount(16) > 0 then |
| 31 | - | num = num - 1 |
| 31 | + | pleaseStore() |
| 32 | - | if not t.detectDown() then |
| 32 | + | end |
| 33 | - | t.placeDown() |
| 33 | + | |
| 34 | - | end |
| 34 | + | |
| 35 | - | end |
| 35 | + | function pleaseRefuel() |
| 36 | t.select(2) | |
| 37 | - | function dis() |
| 37 | + | t.placeUp() |
| 38 | - | num = io.read() |
| 38 | + | t.select(1) |
| 39 | - | num = tonumber(num) |
| 39 | + | t.placeUp() |
| 40 | - | return num |
| 40 | + | t.refuel(1) |
| 41 | t.digUp() | |
| 42 | - | function a() |
| 42 | + | |
| 43 | - | print("Input distance: ")
|
| 43 | + | function pleaseStore() |
| 44 | - | num = dis() |
| 44 | + | t.select(3) |
| 45 | - | fu(num) |
| 45 | + | t.digUp() |
| 46 | - | go(num) |
| 46 | + | t.placeUp() |
| 47 | - | t.turnLeft() |
| 47 | + | num = 4 |
| 48 | - | t.turnLeft() |
| 48 | + | while num < 17 do |
| 49 | - | go(num) |
| 49 | + | t.select(num) |
| 50 | t.dropUp() | |
| 51 | end | |
| 52 | - | a() |
| 52 | + | t.digUp() |
| 53 | end | |
| 54 | function checkers() | |
| 55 | pleaseStore() | |
| 56 | pleaseRefuel() | |
| 57 | end | |
| 58 | ||
| 59 | function quarry() | |
| 60 | x = 16 | |
| 61 | z = 16 | |
| 62 | while x > 1 do | |
| 63 | while z > 1 do | |
| 64 | checkers() | |
| 65 | f() | |
| 66 | end | |
| 67 | t.turnRight() | |
| 68 | f() | |
| 69 | t.turnRight() | |
| 70 | end | |
| 71 | d() | |
| 72 | end | |
| 73 | ||
| 74 | quarry() |