mariebu

13-Dome

Mar 26th, 2018
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 6.70 KB | None | 0 0
  1. name = "13m Diameter Dome"
  2.  
  3. requirements = {
  4.     slots = {
  5.         [1] = {
  6.             name = "Wall Bricks",
  7.             minCount = 36,
  8.             maxCount = 36,
  9.             exactCount = true,
  10.             readyFunction = nil,
  11.         },
  12.         [2] = {
  13.             name = "Glass",
  14.             minCount = 64,
  15.             maxCount = 64,
  16.             exactCount = true,
  17.             readyFunction = nil,
  18.         },
  19.         [3] = {
  20.             name = "Glass",
  21.             minCount = 64,
  22.             maxCount = 64,
  23.             exactCount = true,
  24.             readyFunction = nil,
  25.         },
  26.         [4] = {
  27.             name = "Glass",
  28.             minCount = 61,
  29.             maxCount = 61,
  30.             exactCount = true,
  31.             readyFunction = nil,
  32.         },
  33.         [5] = {
  34.             name = "Floor Edge Bricks",
  35.             minCount = 40,
  36.             maxCount = 40,
  37.             exactCount = true,
  38.             readyFunction = nil,
  39.         },
  40.         [6] = {
  41.             name = "Floor",
  42.             minCount = 57,
  43.             maxCount = 57,
  44.             exactCount = true,
  45.             readyFunction = nil,
  46.         },
  47.         [7] = {
  48.             name = "Lights",
  49.             minCount = 4,
  50.             maxCount = 4,
  51.             exactCount = true,
  52.             readyFunction = nil,
  53.         },
  54.     },
  55.     fuel = 374,
  56. }
  57.  
  58. instructions = function()
  59.     local function up()
  60.         while not turtle.up() do
  61.             turtle.digUp()
  62.             sleep(0.6)
  63.         end
  64.     end
  65.     local function down()
  66.         if not turtle.down() then
  67.             turtle.digDown()
  68.             turtle.down()
  69.         end
  70.     end
  71.     local function forward()
  72.         while not turtle.forward() do
  73.             turtle.dig()
  74.             sleep(0.6)
  75.         end
  76.     end
  77.     local function back()
  78.         while not turtle.back() do
  79.             turtle.turnLeft()
  80.             turtle.turnLeft()
  81.             while turtle.detect() do
  82.                 turtle.dig()
  83.                 sleep(0.6)
  84.             end
  85.             turtle.turnRight()
  86.             turtle.turnRight()
  87.         end
  88.     end
  89.     local function placeUp()
  90.         while not turtle.placeUp() do
  91.             turtle.digUp()
  92.             sleep(0.6)
  93.         end
  94.     end
  95.     local function place()
  96.         while not turtle.place() do
  97.             turtle.dig()
  98.             sleep(0.6)
  99.         end
  100.     end
  101.     local function placeDown()
  102.         if not turtle.placeDown() then
  103.             if not turtle.compareDown() then
  104.                 --catches the corner ones for floor setting
  105.                 turtle.digDown()
  106.                 turtle.placeDown()
  107.             end
  108.         end
  109.     end
  110.  
  111.     do
  112.         for i = 1, 6 do
  113.             up()
  114.         end
  115.         turtle.select(4)
  116.         for i = 1, 4 do
  117.             place()
  118.             turtle.turnLeft()
  119.         end
  120.         down()
  121.         placeUp()
  122.         forward()
  123.         forward()
  124.         turtle.turnLeft()
  125.         for i = 1, 4 do
  126.             placeUp()
  127.             forward()
  128.             placeUp()
  129.             turtle.turnLeft()
  130.             forward()
  131.             placeUp()
  132.             turtle.turnRight()
  133.             forward()
  134.             placeUp()
  135.             turtle.turnLeft()
  136.             forward()
  137.         end
  138.     end
  139.     do
  140.         down()
  141.         forward()
  142.         forward()
  143.         turtle.turnRight()
  144.         forward()
  145.         turtle.turnRight()
  146.  
  147.         for i = 1, 4 do
  148.             forward()
  149.             placeUp()
  150.             forward()
  151.             placeUp()
  152.             turtle.turnLeft()
  153.             forward()
  154.             up()
  155.             turtle.turnLeft()
  156.             place()
  157.             turtle.turnRight()
  158.             turtle.turnRight()
  159.             place()
  160.             down()
  161.             placeUp()
  162.             forward()
  163.             turtle.turnRight()
  164.             forward()
  165.             placeUp()
  166.             turtle.turnLeft()
  167.             --end six block, start middle bit
  168.             forward()
  169.             placeUp()
  170.             turtle.turnRight()
  171.             forward()
  172.             placeUp()
  173.             turtle.turnLeft()
  174.             forward()
  175.             placeUp()
  176.             turtle.turnRight()
  177.         end
  178.     end
  179.     turtle.select(3)
  180.     do
  181.         down()
  182.         turtle.turnLeft()
  183.         forward()
  184.         turtle.turnLeft()
  185.         for i = 1, 4 do
  186.             placeUp()
  187.             forward()
  188.             placeUp()
  189.             turtle.turnLeft()
  190.             forward()
  191.             placeUp()
  192.             turtle.turnRight()
  193.             forward()
  194.             placeUp()
  195.             turtle.turnLeft()
  196.             forward()
  197.             placeUp()
  198.             --end five corner, move to three side
  199.             forward()
  200.             turtle.turnRight()
  201.             forward()
  202.             turtle.turnLeft()
  203.             --begin three side
  204.             placeUp()
  205.             forward()
  206.             placeUp()
  207.             forward()
  208.             placeUp()
  209.             --end three side, move to five corner
  210.             turtle.turnLeft()
  211.             forward()
  212.             turtle.turnRight()
  213.             forward()
  214.         end
  215.     end
  216.     do
  217.         down()
  218.         forward()
  219.         for i = 1, 4 do
  220.             placeUp()
  221.             forward()
  222.             placeUp()
  223.             turtle.turnLeft()
  224.             forward()
  225.             placeUp()
  226.             --end three corner, move to five side
  227.             forward()
  228.             turtle.turnRight()
  229.             forward()
  230.             turtle.turnLeft()
  231.             --begin five side
  232.             for i = 1, 4 do
  233.                 placeUp()
  234.                 forward()
  235.             end
  236.             placeUp()
  237.             --end five side, move to three corner
  238.             turtle.turnLeft()
  239.             forward()
  240.             turtle.turnRight()
  241.             forward()
  242.         end
  243.     end
  244.     turtle.select(2)
  245.     do
  246.         down()
  247.         forward()
  248.         for i = 1, 4 do
  249.             placeUp()
  250.             --move to next piece
  251.             turtle.turnLeft()
  252.             forward()
  253.             turtle.turnRight()
  254.             forward()
  255.             --start next piece
  256.             turtle.turnLeft()
  257.             placeUp()
  258.             forward()
  259.             placeUp()
  260.             --move to side
  261.             forward()
  262.             turtle.turnRight()
  263.             forward()
  264.             turtle.turnLeft()
  265.             --three side
  266.             placeUp()
  267.             forward()
  268.             placeUp()
  269.             forward()
  270.             placeUp()
  271.             --move to begin corner sweep
  272.             turtle.turnLeft()
  273.             forward()
  274.             turtle.turnRight()
  275.             forward()
  276.             --first part of corner
  277.             placeUp()
  278.             forward()
  279.             placeUp()
  280.             --move to start next loop
  281.             turtle.turnLeft()
  282.             forward()
  283.             turtle.turnRight()
  284.             forward()
  285.         end
  286.     end
  287.     turtle.select(4)
  288.     turtle.transferTo(2)
  289.     turtle.select(2)
  290.     do
  291.         --final, bottom glass layer
  292.         down()
  293.         forward()
  294.         for i = 1, 4 do
  295.             turtle.turnLeft()
  296.             placeUp()
  297.             forward()
  298.             placeUp()
  299.             --move to side
  300.             forward()
  301.             turtle.turnRight()
  302.             forward()
  303.             turtle.turnLeft()
  304.             --do side
  305.             for i = 1, 4 do
  306.                 placeUp()
  307.                 forward()
  308.             end
  309.             placeUp()
  310.             --move to first corner
  311.             turtle.turnLeft()
  312.             forward()
  313.             turtle.turnRight()
  314.             forward()
  315.             --do corner
  316.             placeUp()
  317.             forward()
  318.             placeUp()
  319.             --move to next corner to loop
  320.             turtle.turnLeft()
  321.             forward()
  322.             turtle.turnRight()
  323.             forward()
  324.         end
  325.     end
  326.     do
  327.         local function slideLeft()
  328.             turtle.turnLeft()
  329.             forward()
  330.             turtle.turnRight()
  331.         end
  332.         local function placeWallAndFloor()
  333.             turtle.select(1)
  334.             place()
  335.             turtle.select(5)
  336.             placeDown()
  337.         end
  338.         back()
  339.         for i = 1, 4 do
  340.             placeWallAndFloor()
  341.             slideLeft()
  342.             placeWallAndFloor()
  343.             slideLeft()
  344.             turtle.select(5)
  345.             placeDown()
  346.             --move up and start five side
  347.             forward()
  348.             for i = 1, 4 do
  349.                 placeWallAndFloor()
  350.                 slideLeft()
  351.             end
  352.             placeWallAndFloor()
  353.             --move back and do left wing
  354.             back()
  355.             turtle.select(5)
  356.             placeDown()
  357.             slideLeft()
  358.             placeWallAndFloor()
  359.             slideLeft()
  360.             placeWallAndFloor()
  361.             turtle.turnLeft()
  362.         end
  363.     end
  364.     do
  365.         turtle.select(6)
  366.         for i = 1, 4 do
  367.             turtle.turnLeft()
  368.             for j = 1, 3 do
  369.                 forward()
  370.             end
  371.             for j = 1, 3 do
  372.                 placeDown()
  373.                 forward()
  374.             end
  375.             forward()
  376.             if i < 4 then forward() end
  377.         end
  378.         turtle.turnLeft()
  379.         forward()
  380.         for i = 1, 4 do
  381.             turtle.select(7)
  382.             placeDown()
  383.             turtle.select(6)
  384.             for j = 1, 5 do
  385.                 forward()
  386.                 placeDown()
  387.             end
  388.             if i < 4 then forward() end
  389.             turtle.turnLeft()
  390.         end
  391.         forward()
  392.         for i = 4, 2, -2 do
  393.             for j = 1, 4 do
  394.                 for k = 1, i do
  395.                     placeDown()
  396.                     if j < 4 or k < i then forward() end
  397.                 end
  398.                 turtle.turnLeft()
  399.             end
  400.             forward()
  401.         end
  402.         placeDown()
  403.     end
  404. end
Advertisement
Add Comment
Please, Sign In to add comment