RTS_Dmitriy

Untitled

Jun 12th, 2024 (edited)
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- 1 - glass
  2. -- 2 - black
  3. -- 3 - red
  4. Slots = {
  5.     {
  6.         {2, 3, 3, 2},
  7.         {3, 0, 0, 3},
  8.         {3, 0, 0, 3},
  9.         {2, 3, 3, 2}
  10.     },
  11.     {
  12.         {3, 0, 0, 3},
  13.         {0, 0, 0, 0},
  14.         {0, 0, 0, 0},
  15.         {3, 0, 0, 3}
  16.     }
  17. }
  18.  
  19.  
  20.  
  21.  
  22. for layer = 1, #Slots do
  23.     -- From 1 to number of elements in Slots (2)
  24.     for line = 1, #Slots[layer] do
  25.         -- When program starts line == 1
  26.         -- From 1 to number of elements
  27.         -- in line number `line` (7)
  28.         -- On the second time line == 2
  29.         for elem = 1, #Slots[layer][line] do
  30.           -- When program starts elem == 1
  31.           -- Then Slots[line][elem] == Slots[1][1] == 1
  32.           -- On the second time
  33.           -- elem == 2
  34.           -- Then Slots[line][elem] == Slots[2][1] == 1
  35.           slot = Slots[line][elem]
  36.           if slot ~= 0 then
  37.               turtle.select(slot)
  38.               turtle.placeDown()
  39.           end
  40.           turtle.forward()
  41.         end
  42.  
  43.         for turt = 1, #Slots[line] do
  44.           turtle.back()
  45.         end
  46.         turtle.up()
  47.     end
  48.     turtle.turnRight()
  49.     turtle.forward()
  50.     turtle.turnLeft()
  51.     for i = 1, #Slots do
  52.        turtle.down()
  53.     end
  54. end
Add Comment
Please, Sign In to add comment