Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local l,w = ...
- if l==nil then
- l,w = settings.get("cactus_l",16),settings.get("cactus_w",8)
- print("Size not specified, defaulting to preset... ("..l.."x"..w..")")
- else
- print("Saved size. Now can be called without args.")
- settings.set("cactus_l",l)
- settings.set("cactus_w",w)
- settings.save()
- end
- for i=1,3 do turtle.up() end
- local b=true
- local s=0
- local function rotate()
- if b then
- turtle.turnRight()
- turtle.forward()
- turtle.turnRight()
- s=1
- else
- turtle.turnLeft()
- turtle.forward()
- turtle.turnLeft()
- s=2
- end
- b=not b
- end
- for i=1,w do
- local dl
- if s==1 then dl=l-1 else dl=l end
- for i=1,dl do
- if s==0 then
- turtle.forward()
- turtle.forward()
- elseif s==1 then
- turtle.forward()
- else
- turtle.back()
- end
- turtle.digDown()
- turtle.down()
- turtle.digDown()
- turtle.up()
- s=0
- end
- rotate()
- end
- while turtle.down() do end
Advertisement
Add Comment
Please, Sign In to add comment