Advertisement
einsteinmaster96

makeroom.lua

Jan 4th, 2025 (edited)
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. width = tonumber(arg[1])
  2. length = tonumber(arg[2])
  3. height = tonumber(arg[3])
  4.  
  5. require("movement")
  6.  
  7. -- mod three layers
  8. for z=0,(math.floor(height/3)-1) do
  9.     layer = 3*z+1
  10.     move_z_to(layer)
  11.     for x=0,(width-1) do
  12.         if x % 2 == 0 then
  13.             for y=0,(length-1) do
  14.                 move_to(x,y)
  15.                 turtle.digUp()
  16.                 turtle.digDown()
  17.             end
  18.         else
  19.             for y=0,(length-1) do
  20.                 move_to(x,length-y-1)
  21.                 turtle.digUp()
  22.                 turtle.digDown()
  23.             end
  24.         end
  25.     end
  26. end
  27.  
  28. -- remainder term
  29. for z=0,((height%3)-1) do
  30.     layer = 3*math.floor(height/3)+z
  31.     move_z_to(layer)
  32.     for x=0,(width-1) do
  33.         if x % 2 == 0 then
  34.             for y=0,(length-1) do
  35.                 move_to(x,y)
  36.             end
  37.         else
  38.             for y=0,(length-1) do
  39.                 move_to(x,length-y-1)
  40.             end
  41.         end
  42.     end
  43. end
  44.  
  45. -- go back
  46. move_to(0,0)
  47. move_z_to(0)
  48.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement