Advertisement
Fadamaka

CC paver

Mar 29th, 2023 (edited)
744
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.35 KB | None | 0 0
  1. local function findItemsToPlace()
  2.     for i = 1, 16,1
  3.     do
  4.         turtle.select(i)
  5.         if(turtle.getItemCount()>2)
  6.         then
  7.             break
  8.         end
  9.     end
  10.  
  11. end
  12.  
  13. args = {...}
  14. gridSize = args[1]
  15. gridWidth = (gridSize/3)
  16.  
  17. turtle.forward()
  18. turtle.down()
  19. turtle.turnLeft()
  20. turtle.turnLeft()
  21.  
  22. for j = 1,gridWidth,1
  23. do
  24.     for i = 1,gridSize-1,1
  25.     do 
  26.         findItemsToPlace()
  27.         turtle.turnLeft()
  28.         turtle.place()
  29.         turtle.turnLeft()
  30.         turtle.turnLeft()
  31.         turtle.place()
  32.         turtle.turnLeft()
  33.         turtle.back()
  34.         turtle.place()
  35.     end
  36.         findItemsToPlace()
  37.         turtle.turnLeft()
  38.         turtle.place()
  39.         turtle.turnLeft()
  40.         turtle.turnLeft()
  41.         turtle.place()
  42.         turtle.turnLeft()
  43.         turtle.up()
  44.         turtle.placeDown()
  45.     if(j%2==1)
  46.     then
  47.         turtle.turnLeft()
  48.         turtle.forward()
  49.         turtle.forward()
  50.         turtle.forward()
  51.         turtle.turnLeft()
  52.         turtle.down()
  53.     else
  54.         turtle.turnRight()
  55.         turtle.forward()
  56.         turtle.forward()
  57.         turtle.forward()
  58.         turtle.turnRight()
  59.         turtle.down()
  60.     end
  61. end
  62.  
  63. turtle.back()
  64.  
  65. if(gridWidth%2==1)
  66. then
  67.     turtle.turnLeft()
  68. else
  69.     turtle.turnRight()
  70. end
  71.  
  72. turtle.up()
  73. turtle.forward()
  74. turtle.forward()
  75. turtle.forward()
  76.  
  77.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement