SHOW:
|
|
- or go back to the newest paste.
| 1 | function movetotree() | |
| 2 | for i=1,7 do | |
| 3 | turtle.forward() | |
| 4 | end | |
| 5 | end | |
| 6 | ||
| 7 | function drop() | |
| 8 | for d=1,15 do | |
| 9 | turtle.select(i) | |
| 10 | turtle.dropDown() | |
| 11 | end | |
| 12 | end | |
| 13 | ||
| 14 | function cut() | |
| 15 | turtle.dig() | |
| 16 | turtle.forward() | |
| 17 | while true do | |
| 18 | if turtle.digUp() then | |
| 19 | turtle.up() | |
| 20 | else if not turtle.down() then | |
| 21 | turtle.back() | |
| 22 | break | |
| 23 | end | |
| 24 | end | |
| 25 | end | |
| 26 | end | |
| 27 | ||
| 28 | function movetodrop() | |
| 29 | for g=1,7 do | |
| 30 | turtle.back() | |
| 31 | end | |
| 32 | end | |
| 33 | ||
| 34 | function refuel() | |
| 35 | - | if (turtle.getFuelLevel()=="Unlimited") then |
| 35 | + | if turtle.getFuelLevel()<600 then |
| 36 | - | return true |
| 36 | + | refuel2() |
| 37 | - | else if turtle.getFuelLevel()<600 then |
| 37 | + | |
| 38 | - | refuel2() |
| 38 | + | |
| 39 | ||
| 40 | function refuel2() | |
| 41 | turtle.select(16) | |
| 42 | turtle.turnRight() | |
| 43 | turtle.turnRight() | |
| 44 | turtle.suck() | |
| 45 | turtle.refuel(64) | |
| 46 | turtle.select(1) | |
| 47 | turtle.turnLeft() | |
| 48 | turtle.turnLeft() | |
| 49 | end | |
| 50 | ||
| 51 | function plant() | |
| 52 | turtle.select(14) | |
| 53 | turtle.place() | |
| 54 | turtle.select(1) | |
| 55 | end | |
| 56 | ||
| 57 | function saplings() | |
| 58 | turtle.select(14) | |
| 59 | turtle.turnRight() | |
| 60 | turtle.suck() | |
| 61 | turtle.select(1) | |
| 62 | turtle.turnLeft() | |
| 63 | end | |
| 64 | ||
| 65 | function getbonemeal() | |
| 66 | turtle.select(15) | |
| 67 | turtle.up() | |
| 68 | turtle.turnRight() | |
| 69 | turtle.suck() | |
| 70 | turtle.select(1) | |
| 71 | turtle.turnLeft() | |
| 72 | turtle.down() | |
| 73 | end | |
| 74 | ||
| 75 | function bonemeal() | |
| 76 | turtle.select(15) | |
| 77 | turtle.place() | |
| 78 | turtle.place() | |
| 79 | turtle.place() | |
| 80 | turtle.place() | |
| 81 | turtle.select(1) | |
| 82 | end | |
| 83 | while true do | |
| 84 | refuel() | |
| 85 | saplings() | |
| 86 | getbonemeal() | |
| 87 | movetotree() | |
| 88 | for z=1,16 do | |
| 89 | plant() | |
| 90 | bonemeal() | |
| 91 | cut() | |
| 92 | end | |
| 93 | movetodrop() | |
| 94 | drop() | |
| 95 | end |