-- spiral outwards and place torches -- it never stops local mv = require("movement") local function ensureSpaceAbove() local success, data = turtle.inspectUp() if success and not data.name:find("torch") then turtle.digUp() end turtle.suck() end local function placeTorch() local i = 0 while not turtle.detectDown() do mv.down() i = i+1 end if i == 0 then ensureSpaceAbove() turtle.turnRight() if not turtle.placeUp() then turtle.digDown() mv.placeItem("torch", turtle.placeDown) end turtle.turnLeft() else mv.up() mv.placeItem("torch", turtle.placeDown) mv.nTimes(i-1, mv.up) end end local function forward() ensureSpaceAbove() mv.forward() end local function main(delta) local i = 1 while true do for j=1,2 do for k=1,i do placeTorch() mv.nTimes(delta, forward) end turtle.turnRight() end i = i+1 end end local args = {...} main(tonumber(args[1] or 1))