View difference between Paste ID: SEhn8fgx and 063sbCVu
SHOW: | | - or go back to the newest paste.
1
local dist = 0
2
3
turtle.select(2)
4
5
function digLayer()
6
if turtle.getItemCount(2)<3 then
7
turtle.select(3)
8
turtle.transferTo(2)
9
turtle.select(2)
10
end
11
turtle.turnLeft()
12
turtle.dig()
13
turtle.place()
14
turtle.turnRight()
15
turtle.turnRight()
16
turtle.dig()
17
turtle.place()
18
turtle.turnLeft()
19
turtle.digUp()
20
upity()
21
turtle.placeDown()
22
dist = dist + 1
23
end
24
25
function digEmpty()
26
turtle.turnLeft()
27
turtle.dig()
28
turtle.turnRight()
29
turtle.turnRight()
30
turtle.dig()
31
turtle.turnLeft()
32
turtle.digUp()
33
turtle.up()
34
upity()
35
dist = dist + 1
36
end
37
38
function upity()
39-
if detectUp() then
39+
while detectUp() do
40
turtle.digUp()
41
end
42-
else
42+
43
end
44
45
function filler()
46
if turtle.getFuelLevel()<10 then
47
turtle.select(1)
48
turtle.refuel(1)
49
turtle.select(2)
50
end
51
end
52
53
for i = 1,55,1 do
54
filler()
55
if dist==5 then
56
digLayer()
57
dist=0
58
end
59
if dist == 0 then
60
digLayer()
61
end
62
digEmpty()
63
end
64
65
run()