Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local c_args = { ... }
- local target_depth = tonumber(c_args[1])
- local function find_item()
- for slot_index = 1, 16 do
- if turtle.getItemCount(slot_index) > 0 then
- return slot_index
- end
- end
- return -1
- end
- local function try_place_down()
- if not turtle.placeDown() then
- local slot = find_item()
- if slot == -1 then
- error("can't place, out of blocks")
- end
- turtle.select(slot)
- try_place_down()
- end
- end
- for i = 1, target_depth do
- try_place_down()
- turtle.forward()
- turtle.down()
- if i % 10 == 0 then
- turtle.turnRight()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment