-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquarry.lua
More file actions
63 lines (58 loc) · 1.06 KB
/
quarry.lua
File metadata and controls
63 lines (58 loc) · 1.06 KB
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
59
60
61
62
63
local maxX,maxY,maxZ = ...
maxX = tonumber(maxX)
maxY = tonumber(maxY)
maxZ = tonumber(maxZ)
y = 0
local function forward()
local result = turtle.forward()
if result == false then
turtle.dig()
turtle.forward()
end
end
local function up()
local result = turtle.up()
if result == false then
turtle.digUp()
turtle.up()
end
end
while y < maxY do
for z = 2, maxZ do
for x = 2, maxX do
forward()
end
if z % 2 == 0 then
turtle.turnRight()
forward()
turtle.turnRight()
else
turtle.turnLeft()
forward()
turtle.turnLeft()
end
end
for x = 2, maxX do
forward()
end
y = y+1
if y < maxY then
up()
turtle.turnRight()
turtle.turnRight()
end
end
turtle.turnRight()
turtle.turnRight()
y = maxY
for i = 2, maxY do
turtle.down()
end
for i = 2, maxX do
turtle.forward()
end
turtle.turnRight()
for i = 2, maxZ do
turtle.forward()
end
turtle.turnRight()