SHOW:
|
|
- or go back to the newest paste.
1 | - | function getRubber(trees) |
1 | + | function harvest() |
2 | - | if (trees == 0) then |
2 | + | turtle.dig() |
3 | - | while true do |
3 | + | turtle.forward() |
4 | - | |
4 | + | while turtle.detectUp() do |
5 | - | end |
5 | + | turtle.digUp() |
6 | - | else |
6 | + | turtle.up() |
7 | - | for i = 0 trees do |
7 | + | end |
8 | - | turtle.dig() |
8 | + | while not turtle.detectDown() do |
9 | - | turtle.forward() |
9 | + | turtle.down() |
10 | - | while turtle.detectUp() |
10 | + | end |
11 | - | turtle.digUp() |
11 | + | turtle.back() |
12 | - | turtle.up() |
12 | + | turtle.place() |
13 | - | end |
13 | + | turtle.select(2) |
14 | - | end |
14 | + | turtle.place() |
15 | turtle.place() | |
16 | turtle.place() | |
17 | turtle.place() | |
18 | turtle.place() | |
19 | turtle.place() | |
20 | turtle.place() | |
21 | turtle.place() | |
22 | turtle.place() | |
23 | turtle.place() | |
24 | turtle.select(1) | |
25 | end | |
26 | ||
27 | local args = {...} | |
28 | if args[1] ~= 0 then | |
29 | for i = 1, args[1] do | |
30 | harvest() | |
31 | end | |
32 | else | |
33 | while turtle.getItemCount(1) > 0 and turtle.getFuelLevel() >= 2 do | |
34 | harvest() | |
35 | end | |
36 | end |