View difference between Paste ID: tjn22cvu and rUyfBQuc
SHOW: | | - or go back to the newest paste.
1
function movetotree()
2-
   for i=1,7 do
2+
   for i=1,4 do
3
      turtle.forward()
4
   end
5
end
6
7
function drop()
8
   for d=1,14 do
9
      turtle.select(i)
10
      turtle.dropDown()
11
   end
12
end
13
14
function cut()
15
   turtle.dig()
16
   turtle.forward()
17
   while true do
18
      if turtle.digUp() then
19
      turtle.up()
20
      else if not turtle.down() then
21
      turtle.back()
22
      break
23
      end
24
   end
25
end
26
end
27
28
function movetodrop()
29
   for g=1,7 do
30
      turtle.back()
31
   end
32
end
33
34
function refuel()
35
  if turtle.getFuelLevel()<600 then
36
     refuel2()
37
   end
38
end
39
40
function refuel2()
41
   turtle.select(16)
42
   turtle.turnRight()
43
   turtle.turnRight()
44
   turtle.suck()
45
   turtle.refuel(64)
46
   turtle.select(1)
47
   turtle.turnLeft()
48
   turtle.turnLeft()
49
end
50
51
function plant()
52
   turtle.select(14)
53
   turtle.place()
54
   turtle.select(1)
55
end
56
57
function saplings()
58
   turtle.select(14)
59
   turtle.turnRight()
60
   turtle.suck()
61
   turtle.select(1)
62
   turtle.turnLeft()
63
end
64
65
function getbonemeal()
66
   turtle.select(15)
67
   turtle.up()
68
   turtle.turnRight()
69
   turtle.suck()
70
   turtle.select(1)
71
   turtle.turnLeft()
72
   turtle.down()
73
end
74
75
function bonemeal()
76
   turtle.select(15)
77
   turtle.place()
78
   turtle.place()
79
   turtle.place()
80
   turtle.place()
81
   turtle.select(1)
82
end
83
84
85
while true do
86
   refuel()
87
   saplings()
88-
   for z=1,16 do
88+
89-
      plant()
89+
   plant()
90-
      bonemeal()
90+
   bonemeal()
91-
      cut()
91+
   cut()
92
   movetotree()
93-
   movetodrop()
93+
   plant()
94
   bonemeal()
95
   cut()
96
   turtle.turnLeft()
97
   movetotree()
98
   plant()
99
   bonemeal()
100
   cut()
101
   turtle.turnLeft()
102
   movetotree()
103
   plant()
104
   bonemeal()
105
   cut()
106
   turtle.turnLeft()
107
   movetotree()
108
   turtle.forward()
109
   turtle.turnLeft()
110
   turtle.back()
111
   drop()
112
   sleep(60)
113
end