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