Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local alvearySlots = {1,3}
- local slabSlots = {2}
- local types = {alveary = alvearySlots, slabs = slabSlots}
- local layerTypes = { "alveary", "alveary", "alveary", "slabs" }
- local turnAltB = false
- local function selectSlot(type)
- local slotsForType = types[type]
- for _,v in pairs(slotsForType) do
- if turtle.getItemCount(v) > 0 then
- turtle.select(v)
- return v
- end
- end
- return nil
- end
- local function placeDown(type)
- selectSlot(type)
- while not turtle.placeDown() do sleep(1) end
- end
- local function placeUp(type)
- selectSlot(type)
- while not turtle.placeUp() do sleep(1) end
- end
- local function place(type)
- selectSlot(type)
- while not turtle.place() do sleep(1) end
- end
- local function goForward()
- while not turtle.forward() do sleep(1) end
- end
- local function goBack()
- while not turtle.back() do sleep(1) end
- end
- local function goUp()
- while not turtle.up() do sleep(1) end
- end
- local function goDown()
- while not turtle.down() do sleep(1) end
- end
- local function buildSlabRow(type,length)
- for i=1,length,1 do
- placeDown(type)
- if i ~= length then goForward() end
- end
- end
- local function turnAlt(toggle)
- if not turnAltB then turtle.turnRight()
- else turtle.turnLeft() end
- if toggle then turnAltB = not turnAltB end
- end
- local function buildAlvRow(type,length)
- local slot = selectSlot(type)
- for i=1,length,1 do
- placeUp(type)
- placeDown(type)
- if i == length then
- turnAlt()
- end
- goBack()
- place(type)
- end
- end
- --[[
- local function buildAlveary()
- turnAltB = false
- for layer=1,4,1 do
- goUp()
- for rows=1,3,1 do
- buildRow(layerTypes[layer],3)
- if rows ~= 3 then
- turnAlt()
- goForward()
- turnAlt(true)
- end
- end
- if layer ~= 4 then
- turnAlt()
- turnAlt()
- end
- end
- end]]
- local function buildAlveary()
- goUp()
- turnAltB = false
- turtle.turnRight()
- turtle.turnRight()
- for i=1,3,1 do
- buildAlvRow("alveary",3)
- turnAlt(true)
- end
- for i=1,3,1 do goUp() end
- turnAltB = false
- turtle.turnLeft()
- goForward()
- turtle.turnLeft()
- for i=1,3,1 do
- buildSlabRow("slabs",3)
- if i ~= 3 then
- turnAlt()
- goForward()
- turnAlt(true)
- end
- end
- end
- local function buildAlvearies()
- for p=1,2,1 do
- buildAlveary()
- turtle.turnLeft()
- turtle.turnLeft()
- for i=1,6,1 do goForward() end
- for i=1,4,1 do goDown() end
- buildAlveary()
- if p ~=2 then
- turtle.turnLeft()
- for i=1,6,1 do goForward() end
- turtle.turnRight()
- for i=1,6,1 do goForward() end
- turtle.turnRight()
- turtle.turnRight()
- for i=1,4,1 do goDown() end
- end
- end
- end
- buildAlvearies()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement