-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathminer
More file actions
58 lines (51 loc) · 814 Bytes
/
miner
File metadata and controls
58 lines (51 loc) · 814 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
digit = 100
j = digit
function dig(flag)
if flag == 0 then
if turtle.compare() then
print("find diamond!!!")
return true
else
turtle.dig()
end
else
if turtle.compareUp() then
print("find diamond!!!")
return true
else
turtle.digUp()
end
end
end
function forward()
while not turtle.forward() do
turtle.dig()
end
end
print("start...")
turtle.select(15)
for i = 1, digit do
if dig(0) then
j = i - 1
break
end
forward()
if dig(1) then
j = i - 1
break
end
end
print("back...")
turtle.turnLeft()
turtle.turnLeft()
turtle.select(16)
for i = 1, j do
if i%10 == 1 then
turtle.placeUp()
end
forward()
end
turtle.turnLeft()
turtle.turnLeft()
print("\nThank you for using the program")
print("By Xia_ST")