Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function replace()
- local exist, data = turtle.inspectDown()
- if not exist or data.metadata > 2 then
- turtle.digDown()
- turtle.placeDown()
- end
- end
- local function do_champ(c)
- bottom = peripheral.wrap("bottom")
- if bottom.getItemMeta(bottom.size()) == nil then
- print("start "..c)
- turtle.select(1)
- turtle.suckDown(48)
- l = 7
- x = 0
- y = 0
- direction = 0
- for n = 1,11 do
- for i = 1, l do
- while not turtle.forward() do end
- replace()
- if n % 2 == 1 then
- x = x + 1 - direction
- else
- y = y + 2 - direction
- end
- end
- if c % 4 < 2 then
- turtle.turnLeft()
- direction = (direction + 1) % 4
- else
- turtle.turnRight()
- direction = (direction - 1) % 4
- end
- if n % 2 == 1 then
- l = l - 1
- end
- end
- while not turtle.forward() do end
- replace()
- for i = 1,3 do
- while not turtle.forward() do end
- end
- if c % 4 < 2 then
- turtle.turnLeft()
- else
- turtle.turnRight()
- end
- for i = 1, 3 do
- while not turtle.back() do end
- end
- for i = 1,16 do
- turtle.select(i)
- turtle.dropDown()
- end
- turtle.select(1)
- end
- end
- local function make_moves(min, max)
- print(min.." to "..max)
- for c = min,(max-1) do
- do_champ(c)
- if c % 12 == 6 then
- while not turtle.forward() do end
- turtle.turnLeft()
- while not turtle.forward() do end
- for i = 1, 4 do
- while not turtle.down() do end
- end
- while not turtle.back() do end
- turtle.turnRight()
- while not turtle.back() do end
- elseif c % 12 == 0 then
- while not turtle.back() do end
- for i = 1, 4 do
- while not turtle.down() do end
- end
- while not turtle.forward() do end
- elseif c % 4 == 1 then
- turtle.turnRight()
- while not turtle.forward() do end
- while not turtle.forward() do end
- turtle.turnLeft()
- elseif c % 4 == 3 then
- turtle.turnLeft()
- while not turtle.forward() do end
- while not turtle.forward() do end
- turtle.turnRight()
- elseif c % 12 < 6 then
- for i=1,8 do
- while not turtle.forward() do end
- end
- elseif c % 12 > 6 then
- for i=1,8 do
- while not turtle.back() do end
- end
- end
- end
- if max >= 1 then
- do_champ(max)
- end
- end
- local tArgs = { ... }
- if #tArgs < 1 then
- make_moves(1,12)
- return
- elseif #tArgs == 1 then
- make_moves(1, tonumber(tArgs[1]))
- else
- make_moves(tonumber(tArgs[1]), tonumber(tArgs[2]))
- end
Add Comment
Please, Sign In to add comment