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