File tree Expand file tree Collapse file tree 1 file changed +62
-0
lines changed Expand file tree Collapse file tree 1 file changed +62
-0
lines changed Original file line number Diff line number Diff line change
1
+ local args = {... }
2
+ help = args [1 ]
3
+
4
+
5
+ function checkBlock (cmp , dig )
6
+ local got = false
7
+ for i = 1 ,8 do
8
+ turtle .select (i )
9
+ if (cmp ()) then
10
+ if (dig ) then
11
+ got = dig ()
12
+ else
13
+ got = true
14
+ end
15
+ end
16
+ return got
17
+ end
18
+
19
+
20
+ if help == " help" then
21
+ print (" ==== Obsidian Miner v1.3 ====" )
22
+ print (" By Zach Dyer" )
23
+ print (" Just relax let Obsidian Miner mine that pesky obsidian for you." )
24
+ print (" " )
25
+ print (" USAGE: " )
26
+ print (" 1. Place obsidian in the first slot." )
27
+ print (" " )
28
+ print (" 2. Set turtle by any corner of an obsidian vein and type 'obsidian'" )
29
+
30
+ else
31
+
32
+ local done = false
33
+ local tries = 0
34
+
35
+ if (checkBlock (turtle .compare , null ))
36
+ then
37
+ done = true
38
+ print (" Please add desired block(s) to slots 1 to 8" )
39
+ end
40
+
41
+ while done == false do
42
+ checkBlock (turtle .compareDown ,turtle .digDown )
43
+ checkBlock (turtle .compareUp , turtle .digUp )
44
+ if (checkBlock (turtle .compare , turtle .dig )) then
45
+ turtle .forward ()
46
+ turtle .turnRight ()
47
+ tries = 0
48
+ else
49
+ turtle .turnLeft ()
50
+ tries = tries + 1
51
+ if tries == 5 then
52
+ turtle .back ()
53
+ end
54
+ if tries > 8 then
55
+ done = true
56
+ end
57
+
58
+ end
59
+
60
+ end
61
+ turtle .select (1 )
62
+ end
You can’t perform that action at this time.
0 commit comments