SHOW:
|
|
- or go back to the newest paste.
| 1 | local h = 1 | |
| 2 | local fuelSlot = 1 | |
| 3 | local stonePlace = 5 | |
| 4 | local stoneReserve = 6 | |
| 5 | local stoneReserveX = 7 | |
| 6 | local glassPlace = 9 | |
| 7 | local glassReserve = 10 | |
| 8 | local glassReserveX = 11 | |
| 9 | ||
| 10 | local blanks = 0 | |
| 11 | ||
| 12 | function filler() | |
| 13 | if turtle.getFuelLevel()<10 then | |
| 14 | turtle.select(fuelSlot) | |
| 15 | turtle.refuel(1) | |
| 16 | end | |
| 17 | if turtle.getItemCount(stonePlace)<3 then | |
| 18 | if turtle.getItemCount(stoneReserve)>=1 then | |
| 19 | turtle.select(stoneReserve) | |
| 20 | else | |
| 21 | turtle.select(stoneReserveX) | |
| 22 | end | |
| 23 | turtle.transferTo(stonePlace) | |
| 24 | end | |
| 25 | - | turtle.select(glassReserve) |
| 25 | + | |
| 26 | - | turtle.transferTo(glassPlace) |
| 26 | + | if turtle.getItemCount(stoneReserve)>=1 then |
| 27 | turtle.select(glassReserve) | |
| 28 | else | |
| 29 | turtle.select(glassReserveX) | |
| 30 | end | |
| 31 | turtle.transferTo(glassPlace) | |
| 32 | end | |
| 33 | end | |
| 34 | ||
| 35 | turtle.select(stonePlace) | |
| 36 | end | |
| 37 | ||
| 38 | function digMove() | |
| 39 | turtle.down() | |
| 40 | turtle.digDown() | |
| 41 | end | |
| 42 | ||
| 43 | function digToBedrock() | |
| 44 | turtle.digDown() | |
| 45 | while not turtle.detectDown() do | |
| 46 | filler() | |
| 47 | digMove() | |
| 48 | end | |
| 49 | end | |
| 50 | ||
| 51 | function checkForward() | |
| 52 | turtle.select(glassPlace) | |
| 53 | if (not turtle.detect()) or (turtle.compare()) then | |
| 54 | blanks = blanks + 1 | |
| 55 | end | |
| 56 | end | |
| 57 | ||
| 58 | function placeWhat() | |
| 59 | blanks = 0 | |
| 60 | checkForward() | |
| 61 | turtle.turnLeft() | |
| 62 | checkForward() | |
| 63 | turtle.turnRight() | |
| 64 | turtle.turnRight() | |
| 65 | checkForward() | |
| 66 | turtle.turnLeft() | |
| 67 | if (blanks == 0) then | |
| 68 | turtle.select(stonePlace) | |
| 69 | else | |
| 70 | turtle.select(glassPlace) | |
| 71 | end | |
| 72 | end | |
| 73 | ||
| 74 | function movePlace() | |
| 75 | if turtle.up() then | |
| 76 | turtle.placeDown() | |
| 77 | h = h + 1 | |
| 78 | else | |
| 79 | turtle.digUp() | |
| 80 | end | |
| 81 | end | |
| 82 | ||
| 83 | function run() | |
| 84 | digToBedrock() | |
| 85 | ||
| 86 | while h < 123 do | |
| 87 | filler() | |
| 88 | if h < 70 then | |
| 89 | placeWhat() | |
| 90 | else | |
| 91 | turtle.select(stonePlace) | |
| 92 | end | |
| 93 | movePlace() | |
| 94 | end | |
| 95 | end | |
| 96 | ||
| 97 | run() |