SHOW:
|
|
- or go back to the newest paste.
1 | local h = 0 | |
2 | function TreeUp() | |
3 | while turtle.detectUp() do | |
4 | turtle.digUp() | |
5 | turtle.up() | |
6 | h=h+1 | |
7 | end | |
8 | ||
9 | - | while not turtle.detectDown() do |
9 | + | |
10 | ||
11 | function TreeDown() | |
12 | while h>=0 do | |
13 | turtle.down() | |
14 | turtle.digDown() | |
15 | h=h-1 | |
16 | end | |
17 | end | |
18 | ||
19 | function TreePlant1x1() | |
20 | turtle.up() | |
21 | turtle.forward() | |
22 | turtle.select(1) | |
23 | turtle.placeDown() | |
24 | turtle.back() | |
25 | turtle.down() | |
26 | sleep(120) | |
27 | end | |
28 | ||
29 | ||
30 | function TreePlant2x2() | |
31 | turtle.up() | |
32 | turtle.forward() | |
33 | turtle.select(1) | |
34 | turtle.placeDown() | |
35 | turtle.forward() | |
36 | turtle.placeDown() | |
37 | turtle.turnRight() | |
38 | turtle.forward() | |
39 | turtle.placeDown() | |
40 | turtle.turnRight() | |
41 | turtle.forward() | |
42 | turtle.placeDown() | |
43 | turtle.turnRight() | |
44 | turtle.forward() | |
45 | turtle.turnLeft() | |
46 | turtle.forward() | |
47 | turtle.down() | |
48 | turtle.turnRight() | |
49 | turtle.turnRight() | |
50 | sleep(300) | |
51 | end | |
52 | ||
53 | while turtle.getFuelLevel() > 350 do | |
54 | h=0 | |
55 | turtle.select(2) | |
56 | turtle.dig() | |
57 | turtle.forward() | |
58 | if turtle.detect(true) then | |
59 | TreeUp() | |
60 | turtle.dig() | |
61 | turtle.forward() | |
62 | TreeDown() | |
63 | turtle.turnRight() | |
64 | turtle.dig() | |
65 | turtle.forward() | |
66 | TreeUp() | |
67 | turtle.turnRight() | |
68 | turtle.dig() | |
69 | turtle.forward() | |
70 | TreeDown() | |
71 | turtle.turnRight() | |
72 | turtle.forward() | |
73 | turtle.turnLeft() | |
74 | turtle.forward() | |
75 | turtle.turnRight() | |
76 | turtle.turnRight() | |
77 | TreePlant2x2() | |
78 | else | |
79 | TreeUp() | |
80 | TreeDown() | |
81 | turtle.forward() | |
82 | turtle.turnRight() | |
83 | turtle.turnRight() | |
84 | TreePlant1x1() | |
85 | end | |
86 | print("out of fuel") | |
87 | end |