View difference between Paste ID: ENf136gm and H5XKxpuD
SHOW: | | - or go back to the newest paste.
1
print("Test Loaded")
2
function f(loc)
3-
	while not turtle[loc]() do
3+
while not turtle[loc]() do
4-
		sleep(0.5)
4+
sleep(0.5)
5-
	end
5+
6
end
7
print("Test1")
8
function up() f("up") end
9
function down() f("down") end
10
function fw() f("forward") end
11
function back() f("back") end
12
function l() f("turnLeft") end
13
function r() f("turnRight") end
14
function d() turtle.dig() end
15
function du() turtle.digUp() end
16
function dd() turtle.digDown() end
17
function c(x)
18-
	for i=1,x do d() fw() du() dd() end
18+
for i=1,x do d() fw() du() dd() end
19
end
20
print("test2")
21
function reFuelTurt()
22
23-
	if turtle.getFuelLevel() <= 50 then
23+
if turtle.getFuelLevel() <= 50 then
24-
		turtle.select(2)
24+
turtle.select(2)
25-
		turtle.refuel(4)
25+
turtle.refuel(4)
26-
	end
26+
27
end
28
29
function cutTree()
30-
	print("Tree Cut")
30+
print("Tree Cut")
31-
	hi = 0
31+
hi = 0
32
	
33-
	while not turtle.detectUp() do
33+
while not turtle.detectUp() do
34-
		up() hi=hi+1
34+
up() hi=hi+1
35-
	end
35+
36
	
37-
	du() up() du() up() du() l() l()
37+
du() up() du() up() du() l() l()
38-
	c(1) r() c(2) r() c(4) r() c(4) r()
38+
c(1) r() c(2) r() c(4) r() c(4) r()
39-
	c(4) r() c(1) r() c(3) l() c(2) l()
39+
c(4) r() c(1) r() c(3) l() c(2) l()
40-
	c(2) back() l() c(1) l() down()
40+
c(2) back() l() c(1) l() down()
41
	
42-
	for r=1,hi do dd() down() end
42+
for r=1,hi do dd() down() end
43
	
44-
	dd() turtle.placeDown() back()
44+
dd() turtle.placeDown() back()
45-
	down() down()
45+
down() down()
46
	
47-
	print(hi)
47+
print(hi)
48
end
49
50
function scanTree()
51-
	if not turtle.detectDown() then
51+
if not turtle.detectDown() then
52-
		r() fw() fw()
52+
r() fw() fw()
53
		
54-
		for k=3,15 do
54+
for k=3,15 do
55-
			turtle.select(k)
55+
turtle.select(k)
56-
			turtle.drop()
56+
turtle.drop()
57-
		end
57+
58
		
59-
		turtle.select(1)
59+
turtle.select(1)
60-
		back() back()
60+
back() back()
61-
		l()
61+
l()
62-
	end
62+
63
	
64-
	up() sleep(1) turtle.select(16) turtle.place() turtle.select(1)
64+
up() sleep(1) turtle.select(16) turtle.place() turtle.select(1)
65
	
66-
	if turtle.detect() then
66+
if turtle.detect() then
67-
		up()
67+
up()
68-
		if turtle.detect() then
68+
if turtle.detect() then
69-
			down()
69+
down()
70-
			cutTree()
70+
cutTree()
71-
		else
71+
else
72-
			down()
72+
down()
73-
			down()
73+
down()
74-
		end
74+
75-
	else
75+
else
76-
		turtle.select(1) turtle.place()
76+
turtle.select(1) turtle.place()
77-
		down()
77+
down()
78-
	end
78+
79
	
80-
	l() if turtle.detect() then
80+
l() if turtle.detect() then
81-
			back() r() fw() e() fw()
81+
back() r() fw() e() fw()
82-
			fw() fw()
82+
fw() fw()
83-
		else
83+
else
84-
			l() l()
84+
l() l()
85
			
86-
			if turtle.detect() then
86+
if turtle.detect() then
87-
				back() l() fw() l() fw()
87+
back() l() fw() l() fw()
88-
				fw() fw()
88+
fw() fw()
89-
			else
89+
else
90-
				fw() l() fw() fw() l() fw() r() fw()
90+
fw() l() fw() fw() l() fw() r() fw()
91-
				fw() fw()
91+
fw() fw()
92-
			end
92+
93-
		end
93+