View difference between Paste ID: tH3XG5pT and 0dW6Dqne
SHOW: | | - or go back to the newest paste.
1
function movetotree()
2
   for i=1,7 do
3
      turtle.forward()
4
   end
5
end
6
7
function drop()
8
   for d=1,15 do
9
      turtle.select(i)
10
      turtle.dropDown()
11
   end
12
end
13
14
function cut()
15
   turtle.dig()
16-
      if not turtle.digUp() then
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
27
function movetodrop()
28
   for g=1,7 do
29
      turtle.back()
30
   end
31
end
32
33
function refuel()
34
   if (turtle.getFuelLevel()=="Unlimited") then
35
      return true
36
      end
37
   turtle.select(16)
38
   turtle.turnRight()
39
   turtle.turnRight()
40
   turtle.suck()
41
   turtle.refuel(64)
42
   turtle.select(1)
43
   turtle.turnLeft()
44
   turtle.turnLeft()
45
end
46
47
function plant()
48
   turtle.select(15)
49
   turtle.place()
50
   turtle.select(1)
51
end
52
53
function saplings()
54
   turtle.select(15)
55
   turtle.turnRight()
56
   turtle.suck()
57
   turtle.select(1)
58
   turtle.turnLeft()
59
end
60
61
while true do
62
   refuel()
63
   saplings()
64
   movetotree()
65
   for z=1,64 do
66
      plant()
67
      sleep(180)
68
      cut()
69
   end
70
   movetodrop()
71
   drop()
72
end