Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- args = { ... }
- function declareBlock()
- block = turtle.getItemDetail(1)
- turtle.select(1)
- end
- function organize()
- local j = 16
- while j > 1 do
- if (turtle.getItemCount(1) == 64) then
- break
- end
- if turtle.getItemDetail(j) then
- local data = turtle.getItemDetail(j)
- if data.name == block.name then
- turtle.select(j)
- turtle.transferTo(1)
- end
- end
- j = j - 1
- end
- turtle.select(1)
- end
- function path(input)
- x = tonumber(input)
- y = tonumber(input)
- for i = 1,x do
- for j=1,y do
- count = turtle.getItemCount(1)
- if count <= 1 then
- organize()
- end
- if turtle.placeDown() then end
- if (j ~= y) then
- turtle.forward()
- end
- end
- turn(i)
- end
- end
- function turn(direction)
- if (direction % 2 == 0) then
- turtle.turnRight()
- turtle.back()
- turtle.turnRight()
- else
- turtle.turnLeft()
- turtle.back()
- turtle.turnLeft()
- end
- end
- declareBlock()
- path(args[1])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement