-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.lua
More file actions
50 lines (45 loc) · 977 Bytes
/
build.lua
File metadata and controls
50 lines (45 loc) · 977 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
local tArgs = { ... }
local n = tonumber(tArgs[1])
local h = tonumber(tArgs[2])
local selected = 1
for tier = 1,h do
for side = 1,4 do
local numBlocks;
if side == 1 then
numBlocks = n
else
numBlocks = n - 1
end
for i = 1,numBlocks do
while turtle.getItemCount(selected) == 0 do
print("Searching for building materials...")
selected = selected + 1
if selected == 17 then
selected = 1
end
turtle.select(selected)
end
turtle.place()
turtle.back()
end
if side < 4 then
turtle.turnLeft()
turtle.back()
turtle.turnLeft()
turtle.back()
turtle.back()
turtle.turnRight()
turtle.back()
else
turtle.turnRight()
turtle.back()
turtle.place()
turtle.up()
turtle.forward()
turtle.turnLeft()
turtle.back()
turtle.turnLeft()
turtle.back()
end
end
end