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