View difference between Paste ID: t70X8hMQ and cLKs1GqH
SHOW: | | - or go back to the newest paste.
1
function f(loc)
2
 while not turtle[loc]() do
3
  sleep(0.5)
4
 end
5
end
6
function up() f("up") end
7
function down() f("down") end
8
function fw() f("forward") end
9
function back() f("back") end
10
function l() f("turnLeft") end
11
function r() f("turnRight") end
12
function d() turtle.dig() end
13
function du() turtle.digUp() end
14
function dd() turtle.digDown() end
15
function c(x)
16
for i=1,x do d() fw() du() dd() end
17
end
18
19-
function makeTree()
19+
20-
        if turtle.getItemCount(1)==0 then
20+
21-
	print("Not enough Saplings.")
21+
22-
	return
22+
23-
	end
23+
24
end
25-
        if turtle.getItemCount(2)==0 then
25+
26-
	print("Not enough BoneMeal.")
26+
27-
	return
27+
28-
	end
28+
29-
turtle.select(1)
29+
30-
turtle.place()
30+
31-
sleep(1)
31+
32-
turtle.select(2)
32+
33-
turtle.place()
33+
34-
sleep(1)
34+
35
cutTree()
36
end