View difference between Paste ID: qjNLHkmH and CHkzamMf
SHOW: | | - or go back to the newest paste.
1-
dist = read()
1+
2-
 
2+
3
	while turtle.detect() do
4
		success, data = turtle.inspect()
5
		if success then
6
			if (data.name ~= "computercraft:turtle_normal") and (data.name ~= "computercraft:turtle_advanced") then
7
				turtle.dig()
8
			else
9
				break
10
			end
11
		else
12
			turtle.dig()
13
		end
14
		sleep(0.5)
15
	end
16
end
17
18
function dig_up()
19
	local success, data
20
	while turtle.detectUp() do
21
		success, data = turtle.inspectUp()
22
		if success then
23
			if (data.name ~= "computercraft:turtle_normal") and (data.name ~= "computercraft:turtle_advanced") then
24
				turtle.digUp()
25
			else
26
				break
27
			end
28
		else
29
			turtle.digUp()
30
		end
31
	sleep(0.5)
32
	end
33
end
34
35
function dig_down()
36
	local success, data
37
	while turtle.detectDown() do
38
		success, data = turtle.inspectDown()
39
		if success then
40
			if (data.name ~= "computercraft:turtle_normal") and (data.name ~= "computercraft:turtle_advanced") then
41
				turtle.digDown()
42
			else
43
				break
44
			end
45
		else
46
			turtle.digDown()
47
		end
48
	sleep(0.5)
49
	end
50
end
51
52
while true do
53
	dig_forward()
54-
for i = 1, dist do
54+
55
	dig_up()
56
	turtle.forward()
57
end