SHOW:
|
|
- or go back to the newest paste.
| 1 | function checkredstone() | |
| 2 | while true do | |
| 3 | if redstone.getInput("left") then
| |
| 4 | Print("Sleeping...")
| |
| 5 | sleep(10) | |
| 6 | else | |
| 7 | break | |
| 8 | end | |
| 9 | end | |
| 10 | end | |
| 11 | ||
| 12 | - | function aircheck() |
| 12 | + | function forward() |
| 13 | - | for z=1,8 do |
| 13 | + | if not turtle.forward() then |
| 14 | - | turtle.down() |
| 14 | + | turtle.dig() |
| 15 | turtle.attack() | |
| 16 | end | |
| 17 | end | |
| 18 | ||
| 19 | function forwardtest() | |
| 20 | while true do | |
| 21 | if not forward() then | |
| 22 | turtle.back() | |
| 23 | break | |
| 24 | end | |
| 25 | end | |
| 26 | end | |
| 27 | ||
| 28 | function forwardturn() | |
| 29 | - | turtle.digDown() |
| 29 | + | |
| 30 | if not turtle.forward() then | |
| 31 | turtle.turnLeft() | |
| 32 | break | |
| 33 | end | |
| 34 | end | |
| 35 | - | turtle.placeDown() |
| 35 | + | |
| 36 | ||
| 37 | function drop() | |
| 38 | for d=1,14 do | |
| 39 | turtle.select(d) | |
| 40 | turtle.dropDown() | |
| 41 | end | |
| 42 | end | |
| 43 | ||
| 44 | function cut() | |
| 45 | - | turtle.turnLeft() |
| 45 | + | |
| 46 | turtle.forward() | |
| 47 | while true do | |
| 48 | if turtle.digUp() then | |
| 49 | turtle.up() | |
| 50 | else if not turtle.down() then | |
| 51 | break | |
| 52 | - | function movetodrop16trees() |
| 52 | + | |
| 53 | - | for g=1,6 do |
| 53 | + | |
| 54 | - | turtle.back() |
| 54 | + | |
| 55 | end | |
| 56 | ||
| 57 | function tree() | |
| 58 | plant() | |
| 59 | bonemeal() | |
| 60 | cut() | |
| 61 | forward() | |
| 62 | forward() | |
| 63 | end | |
| 64 | - | function check16trees() |
| 64 | + | |
| 65 | function movetodrop25trees() | |
| 66 | turtle.turnRight() | |
| 67 | for g=1,16 do | |
| 68 | if not turtle.back() then | |
| 69 | turtle.attack() | |
| 70 | turtle.dig() | |
| 71 | end | |
| 72 | end | |
| 73 | end | |
| 74 | - | turtle.suck() |
| 74 | + | |
| 75 | function check4trees() | |
| 76 | if turtle.getFuelLevel()<175 then | |
| 77 | refuel() | |
| 78 | end | |
| 79 | end | |
| 80 | ||
| 81 | function check25trees() | |
| 82 | if turtle.getFuelLevel()<600 then | |
| 83 | - | turtle.place() |
| 83 | + | |
| 84 | end | |
| 85 | end | |
| 86 | ||
| 87 | function refuel() | |
| 88 | turtle.select(16) | |
| 89 | turtle.turnRight() | |
| 90 | - | turtle.suck() |
| 90 | + | |
| 91 | while true do | |
| 92 | if not turtle.suck() then | |
| 93 | print("No fuel. Sleeping.")
| |
| 94 | else | |
| 95 | turtle.refuel(64) | |
| 96 | turtle.select(1) | |
| 97 | turtle.turnLeft() | |
| 98 | turtle.turnLeft() | |
| 99 | - | turtle.suck() |
| 99 | + | break |
| 100 | end | |
| 101 | end | |
| 102 | end | |
| 103 | ||
| 104 | function plant() | |
| 105 | turtle.select(14) | |
| 106 | while true do | |
| 107 | - | turtle.place() |
| 107 | + | if not turtle.place() then |
| 108 | - | turtle.place() |
| 108 | + | turtle.dig() |
| 109 | - | turtle.place() |
| 109 | + | turtle.attack() |
| 110 | - | turtle.place() |
| 110 | + | else |
| 111 | turtle.select(1) | |
| 112 | break | |
| 113 | end | |
| 114 | end | |
| 115 | end | |
| 116 | - | refuel() |
| 116 | + | |
| 117 | - | saplings() |
| 117 | + | |
| 118 | turtle.select(14) | |
| 119 | turtle.turnRight() | |
| 120 | while true do | |
| 121 | if not turtle.suck() then | |
| 122 | print("No saplings. Sleeping.")
| |
| 123 | - | othermove() |
| 123 | + | else |
| 124 | turtle.select(1) | |
| 125 | - | turtle.back() |
| 125 | + | |
| 126 | break | |
| 127 | end | |
| 128 | end | |
| 129 | - | othermove() |
| 129 | + | |
| 130 | - | othermove() |
| 130 | + | |
| 131 | function getbonemeal() | |
| 132 | - | turtle.back() |
| 132 | + | |
| 133 | turtle.up() | |
| 134 | turtle.turnRight() | |
| 135 | while true do | |
| 136 | - | othermove() |
| 136 | + | if not turtle.suck() then |
| 137 | print("No bonemeal. Sleeping.")
| |
| 138 | else | |
| 139 | turtle.select(1) | |
| 140 | turtle.turnLeft() | |
| 141 | turtle.down() | |
| 142 | - | othermove() |
| 142 | + | break |
| 143 | - | othermove() |
| 143 | + | |
| 144 | end | |
| 145 | end | |
| 146 | ||
| 147 | function bonemeal() | |
| 148 | turtle.select(15) | |
| 149 | while true do | |
| 150 | if not turtle.place() then | |
| 151 | - | sleep(130) |
| 151 | + | turtle.select(1) |
| 152 | break | |
| 153 | end | |
| 154 | end | |
| 155 | end | |
| 156 | ||
| 157 | function firstrow() | |
| 158 | for y=1,4 do | |
| 159 | tree() | |
| 160 | end | |
| 161 | cut() | |
| 162 | forward() | |
| 163 | turtle.turnRight() | |
| 164 | forward() | |
| 165 | forward() | |
| 166 | forward() | |
| 167 | turtle.turnRight() | |
| 168 | end | |
| 169 | ||
| 170 | function secondrow() | |
| 171 | for y=1,4 do | |
| 172 | tree() | |
| 173 | end | |
| 174 | cut() | |
| 175 | forward() | |
| 176 | turtle.turnLeft() | |
| 177 | forward() | |
| 178 | forward() | |
| 179 | forward() | |
| 180 | turtle.turnLeft() | |
| 181 | end | |
| 182 | ||
| 183 | function thirdrow() | |
| 184 | for y=1,4 do | |
| 185 | tree() | |
| 186 | end | |
| 187 | cut() | |
| 188 | forward() | |
| 189 | turtle.turnRight() | |
| 190 | forward() | |
| 191 | forward() | |
| 192 | forward() | |
| 193 | turtle.turnRight() | |
| 194 | end | |
| 195 | ||
| 196 | function fourthrow() | |
| 197 | for y=1,4 do | |
| 198 | tree() | |
| 199 | end | |
| 200 | cut() | |
| 201 | forward() | |
| 202 | turtle.turnLeft() | |
| 203 | forward() | |
| 204 | forward() | |
| 205 | forward() | |
| 206 | turtle.turnLeft() | |
| 207 | end | |
| 208 | ||
| 209 | function fifthrow() | |
| 210 | for y=1,4 do | |
| 211 | tree() | |
| 212 | end | |
| 213 | cut() | |
| 214 | turtle.turnLeft() | |
| 215 | for t=1,12 do | |
| 216 | forward() | |
| 217 | end | |
| 218 | movetodrop25trees() | |
| 219 | end | |
| 220 | ||
| 221 | while true do | |
| 222 | checkredstone() | |
| 223 | check25trees() | |
| 224 | getsaplings() | |
| 225 | getbonemeal() | |
| 226 | for o=1,3 do | |
| 227 | forward() | |
| 228 | end | |
| 229 | firstrow() | |
| 230 | secondrow() | |
| 231 | thirdrow() | |
| 232 | fourthrow() | |
| 233 | fifthrow() | |
| 234 | drop() | |
| 235 | turtle.select(15) | |
| 236 | turtle.up() | |
| 237 | turtle.turnRight() | |
| 238 | turtle.drop() | |
| 239 | turtle.turnLeft() | |
| 240 | turtle.down() | |
| 241 | sleep(90) | |
| 242 | end |