View difference between Paste ID: X5KeK6a2 and mCa2a3Wj
SHOW: | | - or go back to the newest paste.
1
local args = {...}
2
3
local stripLength = 35
4
local count = 0
5
local line = 0
6
7
if not #args == 1 then
8
  print("Usage: smine <mines>")
9
  return
10
end
11
12
function strip()
13
  count = 0
14
  for i=1,stripLength do
15
	count = count + 1
16
    checkInv()
17
    while not turtle.forward() do turtle.dig() end
18
    while turtle.detectUp() do
19
      turtle.digUp()
20-
      sleep(0.1)
20+
      sleep(0.2)
21
    end
22
    while turtle.detectDown() do
23
      turtle.digDown()
24-
      sleep(0.1)
24+
      sleep(0.2)
25
    end
26-
    
26+
27-
	if line%8 == 0 then
27+
28-
    	if i%8 == 0 then
28+
29-
     	 turtle.select(16)
29+
30-
    	  while not turtle.forward() do turtle.dig() end
30+
31-
    	  while turtle.detectDown() do
31+
32-
   	     turtle.digDown()
32+
33-
  	      sleep(0.1)
33+
34-
    	  end
34+
35-
      if not turtle.back() then
35+
36-
        turtle.turnLeft()
36+
37-
		turtle.turnLeft()
37+
38-
        while not turtle.forward do turtle.dig() end
38+
39-
        turtle.turnLeft()
39+
40-
		turtle.turnLeft()
40+
41-
      end
41+
42-
	  turtle.down()
42+
43-
	  if not turtle.detectDown() then
43+
44-
		 turtle.select(1)
44+
45-
		 turtle.placeDown()
45+
46-
         turtle.select(16)
46+
47-
      end
47+
48-
	  turtle.up()
48+
49-
      turtle.placeDown()
49+
50-
      turtle.select(1)
50+
51
    end
52
	turtle.select(15)
53
	turtle.digDown()
54
    sleep(0.2)
55
	turtle.select(1)
56
  end
57
end
58
59
function emptyInv()
60
	turtle.select(15)
61
   	while not turtle.placeDown() do turtle.digDown() end
62
   	for i=1,14 do
63
      	turtle.select(i)
64
      	turtle.dropDown()
65
   	end
66
	turtle.select(15)
67
	turtle.digDown()
68
   	sleep(0.2)
69
	turtle.select(1)
70
end
71
72
for x=1,args[1] do
73
  turtle.turnLeft()
74
  strip()
75
  strip()
76
  turtle.turnRight()
77
  while not turtle.forward() do turtle.dig() end
78
    while turtle.detectUp() do
79
      turtle.digUp()
80
      sleep(0.2)
81-
    sleep(0.1)
81+
82
    while turtle.detectDown() do
83
      turtle.digDown()
84
    end
85
  line = line + 1
86
print("Mined " .. x .. ", " .. args[1]-x .. " left to go.")
87
end
88
emptyInv()