SHOW:
|
|
- or go back to the newest paste.
1 | --[[ | |
2 | ||
3 | F3l1x Tree Felling Program | |
4 | ||
5 | Starting Turtle inventory: | |
6 | ||
7 | 1- Fuel | |
8 | 2- Bonemeal | |
9 | 3- Sapling | |
10 | 4- Tree Log | |
11 | ||
12 | Items Positioning: | |
13 | ||
14 | t = tree | |
15 | c = chest | |
16 | T = turtle | |
17 | ||
18 | tt | |
19 | tt | |
20 | ccT | |
21 | cc cc | |
22 | c | |
23 | c | |
24 | ||
25 | ]]-- | |
26 | ||
27 | --Apply Bonemeal | |
28 | function bm() | |
29 | turtle.select(3) | |
30 | - | while not turtle.compare() do |
30 | + | while turtle.compare() do |
31 | turtle.select(2) | |
32 | turtle.place() | |
33 | - | turtle.select(4) |
33 | + | turtle.select(3) |
34 | end | |
35 | turtle.select(1) | |
36 | end | |
37 | ||
38 | --Plant Tree | |
39 | function plant() | |
40 | turtle.forward() | |
41 | turtle.forward() | |
42 | turtle.turnRight() | |
43 | turtle.select(3) | |
44 | turtle.place() | |
45 | turtle.turnLeft() | |
46 | turtle.back() | |
47 | turtle.place() | |
48 | turtle.turnRight() | |
49 | turtle.place() | |
50 | turtle.turnLeft() | |
51 | turtle.back() | |
52 | turtle.place() | |
53 | bm() | |
54 | end | |
55 | ||
56 | function fuel() | |
57 | if turtle.getFuelLevel() < 10 then | |
58 | turtle.selet(1) | |
59 | turtle.refuel(5) | |
60 | end | |
61 | end | |
62 | ||
63 | function refill() | |
64 | turtle.turnLeft() | |
65 | turtle.select(3) | |
66 | turtle.suck() | |
67 | turtle.turnLeft() | |
68 | turtle.forward() | |
69 | turtle.turnRight() | |
70 | turtle.select(1) | |
71 | turtle.suck() | |
72 | turtle.turnLeft() | |
73 | turtle.select(2) | |
74 | turtle.suck() | |
75 | turtle.turnLeft() | |
76 | turtle.select(4) | |
77 | turtle.suck() | |
78 | for i = 5, 16 do | |
79 | turtle.select(i) | |
80 | turtle.drop() | |
81 | end | |
82 | end | |
83 | ||
84 | while true do | |
85 | fuel() | |
86 | refill() | |
87 | plant() | |
88 | turtle.dig() | |
89 | turtle.forward() | |
90 | j = 0 | |
91 | while turtle.detectUp() do | |
92 | turtle.digUp() | |
93 | turtle.dig() | |
94 | turtle.up() | |
95 | j++ | |
96 | end | |
97 | turtle.dig() | |
98 | turtle.turnRight() | |
99 | turtle.dig() | |
100 | turtle.forward() | |
101 | turtle.turnLeft() | |
102 | while not j == 0 | |
103 | turtle.dig() | |
104 | turtle.digDown() | |
105 | turtle.down() | |
106 | j-- | |
107 | end | |
108 | turtle.dig() | |
109 | turtle.turnLeft() | |
110 | turtle.forward() | |
111 | turtle.turnRight() | |
112 | turtle.back() | |
113 | sleep(1.5) | |
114 | end |