Guest User

cactus.lua

a guest
Jun 11th, 2026
19
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.70 KB | None | 0 0
  1. local l,w = ...
  2. for i=1,3 do turtle.up() end
  3. local b=true
  4. local s=0
  5. local function rotate()
  6.     if b then
  7.         turtle.turnRight()
  8.         turtle.forward()
  9.         turtle.turnRight()
  10.         s=1
  11.     else
  12.         turtle.turnLeft()
  13.         turtle.forward()
  14.         turtle.turnLeft()
  15.         s=2
  16.     end
  17.     b=not b
  18. end
  19.  
  20. for i=1,w do
  21.     local dl
  22.     if s==1 then dl=l-1 else dl=l end
  23.     for i=1,dl do
  24.     if s==0 then
  25.         turtle.forward()
  26.         turtle.forward()
  27.     elseif s==1 then
  28.         turtle.forward()
  29.     else
  30.         turtle.back()
  31.     end
  32.        
  33.     turtle.digDown()
  34.     turtle.down()
  35.     turtle.digDown()
  36.     turtle.up()
  37.     s=0
  38.     end
  39.     rotate()
  40. end
  41.    
  42.  
Advertisement
Add Comment
Please, Sign In to add comment