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