Advertisement
Posiedien

ComputerCraft - Build Fortress Walls

May 26th, 2015
3,286
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 43.90 KB | None | 0 0
  1. ------------------------------------------------------
  2. --     Fortress Wall Builder - Jacob Nelson         --
  3. ------------------------------------------------------
  4.  
  5. ---------------------------------------------------------------------
  6. ---------------------------------------------------------------------
  7. ---------------------------------------------------------------------
  8. ---------------- BEFORE RUNNING CODE LOOK AT THIS!!! ----------------
  9. ---------------------------------------------------------------------
  10. ---------------------------------------------------------------------
  11. ---------------------------------------------------------------------
  12.  
  13. -- The program creates a fortress with desired width/depth;
  14. -- It does this by creating 2 different segments and combining them: https://i.imgur.com/naeR7cD.png
  15. -- Please use a chunk loader if you wish to run while you aren't at the site.
  16. -- Does not work in-between server restarts
  17.  
  18. -- Steps for Setup --
  19. -- 1. Place material chests like this: http://i.imgur.com/g9cER97.png
  20. -- 2. Place turtle in front of the fuel chest facing forward
  21.  
  22.  
  23. local CurrentPosX = 0
  24. local CurrentPosY = 0
  25. local CurrentPosZ = 0
  26. local CurrentRotation = 0
  27. local MoveReturnXFirst = false
  28. local CurrentSubWidth = 1
  29. local CurrentSubLength = 1
  30. local TotalWidth = 10
  31. local TotalLength = 10
  32.  
  33.  
  34. function PrintErrorMessage()
  35.     print("Something Bad Happened")
  36.     print("CurrentPosX:")
  37.     print(CurrentPosX)
  38.     print("CurrentPosY:")
  39.     print(CurrentPosY)
  40.     print("CurrentPosZ:")
  41.     print(CurrentPosZ)
  42.     print("CurrentRotation:")
  43.     print(CurrentRotation)
  44.     print("Fuel Level:")
  45.     print(turtle.getFuelLevel())
  46.     turtle.select(16)
  47.     turtle.refuel(64)
  48. end
  49.  
  50. function MoveForwardPlus()
  51.    
  52.     -- Move Turtle Forward
  53.     if turtle.forward() == false then
  54.         turtle.select(12)
  55.         if turtle.dig() == false then
  56.             MoveForwardPlus()
  57.             PrintErrorMessage()
  58.         else
  59.             turtle.forward()
  60.             -- Update Current Position
  61.             if (CurrentRotation % 360) == 0 then
  62.                 CurrentPosY = CurrentPosY + 1
  63.             elseif (CurrentRotation % 360) == 90 then
  64.                 CurrentPosX = CurrentPosX + 1
  65.             elseif (CurrentRotation % 360) == 180 then
  66.                 CurrentPosY = CurrentPosY - 1
  67.             elseif (CurrentRotation % 360) == 270 then
  68.                 CurrentPosX = CurrentPosX - 1
  69.             end
  70.         end
  71.     else
  72.         -- Update Current Position
  73.         if (CurrentRotation % 360) == 0 then
  74.             CurrentPosY = CurrentPosY + 1
  75.         elseif (CurrentRotation % 360) == 90 then
  76.             CurrentPosX = CurrentPosX + 1
  77.         elseif (CurrentRotation % 360) == 180 then
  78.             CurrentPosY = CurrentPosY - 1
  79.         elseif (CurrentRotation % 360) == 270 then
  80.             CurrentPosX = CurrentPosX - 1
  81.         end
  82.     end
  83.    
  84.    
  85.        
  86. end
  87.  
  88. function MoveUpPlus()
  89.    
  90.     -- Move Turtle Up
  91.     if turtle.up() == false then
  92.         turtle.select(12)
  93.         if turtle.digUp() == false then
  94.             MoveUpPlus()
  95.             PrintErrorMessage()
  96.         else
  97.             turtle.up()
  98.             -- Update Current Position
  99.             CurrentPosZ = CurrentPosZ + 1
  100.         end
  101.     else
  102.         -- Update Current Position
  103.         CurrentPosZ = CurrentPosZ + 1
  104.     end
  105.    
  106.    
  107.        
  108. end
  109.  
  110. function MoveDownPlus()
  111.    
  112.     -- Move Turtle Down
  113.     if turtle.down() == false then
  114.         turtle.select(12)
  115.         if turtle.digDown() == false then
  116.             MoveDownPlus()
  117.             PrintErrorMessage()
  118.         else
  119.             turtle.down()
  120.             -- Update Current Position
  121.             CurrentPosZ = CurrentPosZ - 1
  122.         end
  123.     else
  124.         -- Update Current Position
  125.         CurrentPosZ = CurrentPosZ - 1
  126.     end
  127.    
  128.    
  129.        
  130. end
  131.  
  132.  
  133. function TurnRightPlus()
  134.    
  135.     -- Turn Turtle Right
  136.     if turtle.turnRight() == false then
  137.         TurnRightPlus()
  138.         PrintErrorMessage()
  139.     end
  140.    
  141.     -- Update Current Rotation
  142.     CurrentRotation = CurrentRotation + 90
  143.    
  144. end
  145.  
  146. function TurnLeftPlus()
  147.    
  148.     -- Turn Turtle Left
  149.     if turtle.turnLeft() == false then
  150.         TurnLeftPlus()
  151.         PrintErrorMessage()
  152.     end
  153.    
  154.     -- Update Current Rotation
  155.     CurrentRotation = CurrentRotation - 90
  156.    
  157. end
  158.  
  159.  
  160. function DigBack()
  161.     -- Turn the turtle backwards
  162.     TurnRightPlus()
  163.     TurnRightPlus()
  164.     turtle.select(12)
  165.    
  166.     if turtle.dig() == false then
  167.         PrintErrorMessage()
  168.         TurnLeftPlus()
  169.         TurnLeftPlus()
  170.         MoveBackPlus()
  171.     else
  172.         TurnLeftPlus()
  173.         TurnLeftPlus()
  174.         turtle.back()
  175.     end
  176.    
  177.    
  178. end
  179.  
  180. function MoveBackPlus()
  181.    
  182.     -- Move Turtle Back
  183.     if turtle.back() == false then
  184.         DigBack()
  185.     end
  186.    
  187.     -- Update Current Position
  188.     if (CurrentRotation % 360) == 0 then
  189.         CurrentPosY = CurrentPosY - 1
  190.     elseif (CurrentRotation % 360) == 90 then
  191.         CurrentPosX = CurrentPosX - 1
  192.     elseif (CurrentRotation % 360) == 180 then
  193.         CurrentPosY = CurrentPosY + 1
  194.     elseif (CurrentRotation % 360) == 270 then
  195.         CurrentPosX = CurrentPosX + 1
  196.     end
  197.    
  198.        
  199. end
  200.  
  201. function SetCurrentRotation(Degrees)
  202.    
  203.     while (CurrentRotation % 360) ~= (Degrees % 360) do
  204.         TurnRightPlus()
  205.     end
  206.    
  207. end
  208.  
  209. function MoveToLocation(x, y, z)
  210.    
  211.     if (CurrentPosX - x ~= 0 or CurrentPosY - y ~= 0 or CurrentPosZ - z ~= 0) then
  212.        
  213.         local DistanceX = math.abs(CurrentPosX - x)
  214.         local DistanceY = math.abs(CurrentPosY - y)
  215.        
  216.        
  217.         -- Move up 8 extra blocks
  218.         for i = 1, 8 do
  219.             MoveUpPlus()
  220.         end
  221.        
  222.         if DistanceX < DistanceY then
  223.            
  224.             MoveReturnXFirst = true;
  225.            
  226.             if (CurrentPosX - x) > 0 then
  227.                 SetCurrentRotation(270)
  228.             elseif (CurrentPosX - x) < 0 then
  229.                 SetCurrentRotation(90)
  230.             end
  231.            
  232.             while CurrentPosX ~= x do
  233.                 MoveForwardPlus()
  234.             end
  235.            
  236.             if (CurrentPosY - y) > 0 then
  237.                 SetCurrentRotation(180)
  238.             elseif (CurrentPosY - y) < 0 then
  239.                 SetCurrentRotation(0)
  240.             end
  241.            
  242.             while CurrentPosY ~= y do
  243.                 MoveForwardPlus()
  244.             end
  245.            
  246.         else
  247.        
  248.             MoveReturnXFirst = false;
  249.            
  250.             if (CurrentPosY - y) > 0 then
  251.                 SetCurrentRotation(180)
  252.             elseif (CurrentPosY - y) < 0 then
  253.                 SetCurrentRotation(0)
  254.             end
  255.            
  256.             while CurrentPosY ~= y do
  257.                 MoveForwardPlus()
  258.             end
  259.            
  260.             if (CurrentPosX - x) > 0 then
  261.                 SetCurrentRotation(270)
  262.             elseif (CurrentPosX - x) < 0 then
  263.                 SetCurrentRotation(90)
  264.             end
  265.            
  266.             while CurrentPosX ~= x do
  267.                 MoveForwardPlus()
  268.             end
  269.            
  270.         end
  271.        
  272.         -- Move down the 8 extra blocks
  273.         for i = 1, 8 do
  274.             MoveDownPlus()
  275.         end
  276.        
  277.         if (CurrentPosZ - z) > 0 then
  278.             while CurrentPosZ ~= z do
  279.                 MoveDownPlus()
  280.             end
  281.         elseif (CurrentPosZ - z) < 0 then
  282.             while CurrentPosZ ~= z do
  283.                 MoveUpPlus()
  284.             end
  285.         end
  286.        
  287.        
  288.     end
  289. end
  290.  
  291. function MoveBackToLocation(x, y, z, Rotation)
  292.    
  293.     if (CurrentPosX - x ~= 0 or CurrentPosY - y ~= 0 or CurrentPosZ - z ~= 0) then
  294.        
  295.         if (CurrentPosZ - z) > 0 then
  296.             while CurrentPosZ ~= z do
  297.                 MoveDownPlus()
  298.             end
  299.         elseif (CurrentPosZ - z) < 0 then
  300.             while CurrentPosZ ~= z do
  301.                 MoveUpPlus()
  302.             end
  303.         end
  304.        
  305.         -- Move up 8 extra blocks
  306.         for i = 1, 8 do
  307.             MoveUpPlus()
  308.         end
  309.        
  310.         if MoveReturnXFirst then
  311.            
  312.             if (CurrentPosX - x) > 0 then
  313.                 SetCurrentRotation(270)
  314.             elseif (CurrentPosX - x) < 0 then
  315.                 SetCurrentRotation(90)
  316.             end
  317.            
  318.             while CurrentPosX ~= x do
  319.                 MoveForwardPlus()
  320.             end
  321.            
  322.             if (CurrentPosY - y) > 0 then
  323.                 SetCurrentRotation(180)
  324.             elseif (CurrentPosY - y) < 0 then
  325.                 SetCurrentRotation(0)
  326.             end
  327.            
  328.             while CurrentPosY ~= y do
  329.                 MoveForwardPlus()
  330.             end
  331.            
  332.         else
  333.        
  334.             if (CurrentPosY - y) > 0 then
  335.                 SetCurrentRotation(180)
  336.             elseif (CurrentPosY - y) < 0 then
  337.                 SetCurrentRotation(0)
  338.             end
  339.            
  340.             while CurrentPosY ~= y do
  341.                 MoveForwardPlus()
  342.             end
  343.            
  344.             if (CurrentPosX - x) > 0 then
  345.                 SetCurrentRotation(270)
  346.             elseif (CurrentPosX - x) < 0 then
  347.                 SetCurrentRotation(90)
  348.             end
  349.            
  350.             while CurrentPosX ~= x do
  351.                 MoveForwardPlus()
  352.             end
  353.            
  354.         end
  355.        
  356.         -- Move down the 8 extra blocks
  357.         for i = 1, 8 do
  358.             MoveDownPlus()
  359.         end
  360.        
  361.     end
  362.    
  363.     -- Set back to old rotation
  364.     SetCurrentRotation(Rotation)
  365.    
  366. end
  367.  
  368. function CheckForRefuel()
  369.  
  370.     if turtle.getFuelLevel() <= (math.abs(CurrentPosY) + math.abs(CurrentPosX) + math.abs(CurrentPosZ) + 32) then
  371.        
  372.         OldPosX = CurrentPosX
  373.         OldPosY = CurrentPosY
  374.         OldPosZ = CurrentPosZ
  375.         OldRotation = CurrentRotation
  376.        
  377.         -- Move back to fuel station
  378.         MoveToLocation(0,0,0)
  379.        
  380.         turtle.select(16)
  381.         SetCurrentRotation(180)
  382.        
  383.         -- wait for fuel
  384.         while (turtle.getFuelLevel() <= math.abs(OldPosX) + math.abs(OldPosY) + math.abs(OldPosZ) + 240) do
  385.            
  386.             -- Refuel
  387.             turtle.suck()
  388.             turtle.refuel(64)
  389.            
  390.         end
  391.        
  392.         -- Go back to previous position
  393.         MoveBackToLocation(OldPosX,OldPosY,OldPosZ,OldRotation)
  394.        
  395.     end
  396.  
  397. end
  398.  
  399. function CheckForEmptyFloorBlock()
  400.  
  401.     if turtle.getItemCount(1) == 0 then
  402.        
  403.         -- Move items in slot 2 to 1
  404.         turtle.select(2)
  405.         turtle.transferTo(1)
  406.        
  407.         if turtle.getItemCount(1) == 0 then
  408.        
  409.             OldPosX = CurrentPosX
  410.             OldPosY = CurrentPosY
  411.             OldPosZ = CurrentPosZ
  412.             OldRotation = CurrentRotation
  413.            
  414.             -- Move back to fuel station
  415.             MoveToLocation(1,0,0)
  416.            
  417.             SetCurrentRotation(180)
  418.            
  419.             turtle.select(1)
  420.             turtle.suck()
  421.             turtle.select(2)
  422.             turtle.suck()
  423.            
  424.             turtle.select(1)
  425.             -- wait for fuel
  426.             while (turtle.getItemCount(1) == 0) do
  427.                
  428.                 -- Refuel
  429.                 turtle.suck()
  430.                
  431.             end
  432.            
  433.             -- Go back to previous position
  434.             MoveBackToLocation(OldPosX,OldPosY,OldPosZ,OldRotation)
  435.            
  436.        
  437.         end
  438.        
  439.        
  440.  
  441.     end
  442.    
  443. end
  444.  
  445. function CheckForEmptyWallBlock()
  446.  
  447.     if turtle.getItemCount(3) == 0 then
  448.        
  449.         -- Move items in slot 4 to 3
  450.         turtle.select(4)
  451.         turtle.transferTo(3)
  452.        
  453.         if turtle.getItemCount(3) == 0 then
  454.        
  455.             OldPosX = CurrentPosX
  456.             OldPosY = CurrentPosY
  457.             OldPosZ = CurrentPosZ
  458.             OldRotation = CurrentRotation
  459.                
  460.             -- Move back to fuel station
  461.             MoveToLocation(2,0,0)
  462.            
  463.             SetCurrentRotation(180)
  464.                
  465.             turtle.select(3)
  466.             turtle.suck()
  467.             turtle.select(4)
  468.             turtle.suck()
  469.                
  470.             turtle.select(3)
  471.             -- wait for fuel
  472.             while (turtle.getItemCount(3) == 0) do
  473.                
  474.                 -- Refuel
  475.                 turtle.suck()
  476.                
  477.             end
  478.            
  479.             -- Go back to previous position
  480.             MoveBackToLocation(OldPosX,OldPosY,OldPosZ,OldRotation)
  481.            
  482.         end
  483.        
  484.        
  485.  
  486.     end
  487.    
  488. end
  489.  
  490.  
  491. function CheckForEmptyTopBlock()
  492.  
  493.     if turtle.getItemCount(5) == 0 then
  494.        
  495.         -- Move items in slot 8 to 7
  496.         turtle.select(6)
  497.         turtle.transferTo(5)
  498.        
  499.         if turtle.getItemCount(5) == 0 then
  500.        
  501.             OldPosX = CurrentPosX
  502.             OldPosY = CurrentPosY
  503.             OldPosZ = CurrentPosZ
  504.             OldRotation = CurrentRotation
  505.            
  506.             -- Move back to fuel station
  507.             MoveToLocation(3,0,0)
  508.            
  509.             SetCurrentRotation(180)
  510.            
  511.             turtle.select(5)
  512.             turtle.suck()
  513.             turtle.select(6)
  514.             turtle.suck()
  515.            
  516.             turtle.select(5)
  517.             -- wait for fuel
  518.             while (turtle.getItemCount(5) == 0) do
  519.                
  520.                 -- Refuel
  521.                 turtle.suck()
  522.                
  523.             end
  524.            
  525.             -- Go back to previous position
  526.             MoveBackToLocation(OldPosX,OldPosY,OldPosZ,OldRotation)
  527.            
  528.        
  529.         end
  530.        
  531.        
  532.  
  533.     end
  534.    
  535. end
  536.  
  537.  
  538. function CheckForEmptyTorches()
  539.  
  540.     if turtle.getItemCount(7) == 0 then
  541.        
  542.         -- Move items in slot 11 to 10
  543.         turtle.select(8)
  544.         turtle.transferTo(7)
  545.        
  546.         if turtle.getItemCount(7) == 0 then
  547.        
  548.             OldPosX = CurrentPosX
  549.             OldPosY = CurrentPosY
  550.             OldPosZ = CurrentPosZ
  551.             OldRotation = CurrentRotation
  552.                
  553.             -- Move back to fuel station
  554.             MoveToLocation(4,0,0)
  555.                
  556.             SetCurrentRotation(180)
  557.                
  558.             turtle.select(7)
  559.             turtle.suck()
  560.             turtle.select(8)
  561.             turtle.suck()
  562.            
  563.             turtle.select(7)
  564.             -- wait for fuel
  565.             while (turtle.getItemCount(7) == 0) do
  566.                
  567.                 -- Refuel
  568.                 turtle.suck()
  569.                
  570.             end
  571.            
  572.             -- Go back to previous position
  573.             MoveBackToLocation(OldPosX,OldPosY,OldPosZ,OldRotation)
  574.            
  575.        
  576.         end
  577.        
  578.        
  579.  
  580.     end
  581.    
  582. end
  583.  
  584. function CheckForEmptyGlassPanes()
  585.  
  586.     if turtle.getItemCount(9) == 0 then
  587.        
  588.         -- Move items in slot 14 to 13
  589.         turtle.select(10)
  590.         turtle.transferTo(9)
  591.        
  592.         if turtle.getItemCount(9) == 0 then
  593.        
  594.             OldPosX = CurrentPosX
  595.             OldPosY = CurrentPosY
  596.             OldPosZ = CurrentPosZ
  597.             OldRotation = CurrentRotation
  598.                
  599.             -- Move back to fuel station
  600.             MoveToLocation(5,0,0)
  601.                
  602.             SetCurrentRotation(180)
  603.        
  604.             turtle.select(9)
  605.             turtle.suck()
  606.             turtle.select(10)
  607.             turtle.suck()
  608.        
  609.             turtle.select(9)
  610.             -- wait for fuel
  611.             while (turtle.getItemCount(9) == 0) do
  612.                
  613.                 -- Refuel
  614.                 turtle.suck()
  615.                
  616.             end
  617.            
  618.             -- Go back to previous position
  619.             MoveBackToLocation(OldPosX,OldPosY,OldPosZ,OldRotation)
  620.            
  621.        
  622.         end
  623.        
  624.        
  625.  
  626.     end
  627.    
  628. end
  629.  
  630.  
  631. function CheckForEmptyJunkPickup()
  632.  
  633.     if turtle.getItemCount(11) == 64 then
  634.        
  635.         -- Move items in slot 11 to 12
  636.         turtle.select(12)
  637.         turtle.transferTo(11)
  638.        
  639.         if turtle.getItemCount(11) == 64 then
  640.        
  641.             OldPosX = CurrentPosX
  642.             OldPosY = CurrentPosY
  643.             OldPosZ = CurrentPosZ
  644.             OldRotation = CurrentRotation
  645.                
  646.             -- Move back to fuel station
  647.             MoveToLocation(6,0,0)
  648.                
  649.             SetCurrentRotation(180)
  650.        
  651.             turtle.select(11)
  652.             turtle.drop(64)
  653.             turtle.select(12)
  654.             turtle.drop(64)
  655.        
  656.             turtle.select(11)
  657.            
  658.             -- Go back to previous position
  659.             MoveBackToLocation(OldPosX,OldPosY,OldPosZ,OldRotation)
  660.            
  661.        
  662.         end
  663.        
  664.        
  665.  
  666.     end
  667.    
  668. end
  669.  
  670.  
  671. function CheckForEmptyPath()
  672.  
  673.     if turtle.getItemCount(13) == 0 then
  674.        
  675.         -- Move items in slot 14 to 13
  676.         turtle.select(14)
  677.         turtle.transferTo(13)
  678.        
  679.         if turtle.getItemCount(13) == 0 then
  680.        
  681.             OldPosX = CurrentPosX
  682.             OldPosY = CurrentPosY
  683.             OldPosZ = CurrentPosZ
  684.             OldRotation = CurrentRotation
  685.                
  686.             -- Move back to fuel station
  687.             MoveToLocation(7,0,0)
  688.                
  689.             SetCurrentRotation(180)
  690.        
  691.             turtle.select(13)
  692.             turtle.suck()
  693.             turtle.select(14)
  694.             turtle.suck()
  695.        
  696.             turtle.select(13)
  697.             -- wait for fuel
  698.             while (turtle.getItemCount(13) == 0) do
  699.                
  700.                 -- Refuel
  701.                 turtle.suck()
  702.                
  703.             end
  704.            
  705.             -- Go back to previous position
  706.             MoveBackToLocation(OldPosX,OldPosY,OldPosZ,OldRotation)
  707.            
  708.        
  709.         end
  710.        
  711.        
  712.  
  713.     end
  714.    
  715. end
  716.  
  717.  
  718.  
  719. function PlaceDownPlus(InventorySlot)
  720.    
  721.     turtle.select(InventorySlot)
  722.    
  723.     -- Place Block Down
  724.     if turtle.placeDown() == false then
  725.         turtle.select(11)
  726.         if turtle.digDown() == false then
  727.             PlaceDownPlus(InventorySlot)
  728.             PrintErrorMessage()
  729.         else
  730.             turtle.select(InventorySlot)
  731.             turtle.placeDown()
  732.         end
  733.     end
  734.    
  735. end
  736.  
  737. function PlaceUpPlus(InventorySlot)
  738.    
  739.     turtle.select(InventorySlot)
  740.    
  741.     -- Place Block Up
  742.     if turtle.placeUp() == false then
  743.         turtle.select(11)
  744.         if turtle.digUp() == false then
  745.             PlaceUpPlus(InventorySlot)
  746.             PrintErrorMessage()
  747.         else
  748.             turtle.select(InventorySlot)
  749.             turtle.placeUp()
  750.         end
  751.     end
  752.    
  753. end
  754.  
  755. function PlacePlus(InventorySlot)
  756.    
  757.     turtle.select(InventorySlot)
  758.    
  759.     -- Place Block Forward
  760.     if turtle.place() == false then
  761.         turtle.select(11)
  762.         if turtle.dig() == false then
  763.             PlacePlus(InventorySlot)
  764.             PrintErrorMessage()
  765.         else
  766.             turtle.select(InventorySlot)
  767.             turtle.place()
  768.         end
  769.     end
  770.    
  771. end
  772.  
  773. function CheckManualInputedFuel()
  774.     turtle.select(16)
  775.     turtle.refuel(64)
  776. end
  777.  
  778. function CheckForEverything()
  779.     CheckManualInputedFuel()
  780.     CheckForRefuel()
  781.     CheckForEmptyFloorBlock()
  782.     CheckForEmptyWallBlock()
  783.     CheckForEmptyTopBlock()
  784.     CheckForEmptyTorches()
  785.     CheckForEmptyGlassPanes()
  786.     CheckForEmptyJunkPickup()
  787.     CheckForEmptyPath()
  788. end
  789. function CreateCornerLayer1()
  790.  
  791.     for i = 1, 5 do
  792.         CheckForEverything()
  793.         PlaceDownPlus(1)
  794.         MoveForwardPlus()
  795.     end
  796.     CheckForEverything()
  797.     PlaceDownPlus(1)
  798.        
  799.     CheckForEverything()
  800.     TurnRightPlus()
  801.     MoveForwardPlus()
  802.     TurnRightPlus()
  803.        
  804.     for i = 1, 6 do
  805.         CheckForEverything()
  806.         PlaceDownPlus(1)
  807.         MoveForwardPlus()
  808.     end
  809.    
  810.     CheckForEverything()
  811.     TurnLeftPlus()
  812.     MoveForwardPlus()
  813.     TurnLeftPlus()
  814.     CheckForEverything()
  815.     MoveForwardPlus()
  816.    
  817.     for i = 1, 2 do
  818.         CheckForEverything()
  819.         PlaceDownPlus(1)
  820.         MoveForwardPlus()
  821.     end
  822.        
  823.     for i = 1, 4 do
  824.         CheckForEverything()
  825.         PlaceDownPlus(13)
  826.         MoveForwardPlus()
  827.     end
  828.    
  829.     CheckForEverything()
  830.     TurnRightPlus()
  831.     MoveForwardPlus()
  832.     TurnRightPlus()
  833.     CheckForEverything()
  834.     MoveForwardPlus()  
  835.        
  836.     for i = 1, 3 do
  837.         CheckForEverything()
  838.         PlaceDownPlus(1)
  839.         MoveForwardPlus()
  840.     end
  841.    
  842.     CheckForEverything()
  843.     PlaceDownPlus(13)
  844.     MoveForwardPlus()
  845.    
  846.     for i = 1, 2 do
  847.         CheckForEverything()
  848.         PlaceDownPlus(1)
  849.         MoveForwardPlus()
  850.     end
  851.    
  852.    
  853.     CheckForEverything()
  854.     TurnLeftPlus()
  855.     MoveForwardPlus()
  856.     TurnLeftPlus()
  857.     CheckForEverything()
  858.     MoveForwardPlus()
  859.    
  860.     for i = 1, 2 do
  861.         CheckForEverything()
  862.         PlaceDownPlus(1)
  863.         MoveForwardPlus()
  864.     end
  865.    
  866.     CheckForEverything()
  867.     PlaceDownPlus(13)
  868.     MoveForwardPlus()
  869.    
  870.     for i = 1, 2 do
  871.         CheckForEverything()
  872.         PlaceDownPlus(1)
  873.         MoveForwardPlus()
  874.     end
  875.     CheckForEverything()
  876.     PlaceDownPlus(1)
  877.    
  878.     CheckForEverything()
  879.     TurnRightPlus()
  880.     MoveForwardPlus()
  881.     TurnRightPlus()
  882.    
  883.     CheckForEverything()
  884.     MoveForwardPlus()
  885.        
  886.     for i = 1, 2 do
  887.         CheckForEverything()
  888.         PlaceDownPlus(1)
  889.         MoveForwardPlus()
  890.     end
  891.    
  892.     CheckForEverything()
  893.     PlaceDownPlus(13)
  894.     MoveForwardPlus()
  895.    
  896.     for i = 1, 2 do
  897.         CheckForEverything()
  898.         PlaceDownPlus(1)
  899.         MoveForwardPlus()
  900.     end
  901.    
  902. end
  903.  
  904. function CreateCornerLayer2()
  905.     CheckForEverything()
  906.     MoveUpPlus()
  907.     CheckForEverything()
  908.     MoveBackPlus()
  909.     TurnRightPlus()
  910.       -- Ready for building
  911.    
  912.     for i = 1, 5 do
  913.         CheckForEverything()
  914.         PlaceDownPlus(3)
  915.         MoveForwardPlus()
  916.     end
  917.    
  918.     TurnRightPlus()
  919.    
  920.     for i = 1, 5 do
  921.         CheckForEverything()
  922.         PlaceDownPlus(3)
  923.         MoveForwardPlus()
  924.     end
  925.     CheckForEverything()
  926.     PlaceDownPlus(3)
  927.    
  928.     TurnRightPlus()
  929.    
  930.     for i = 1, 4 do
  931.         CheckForEverything()
  932.         MoveForwardPlus()
  933.     end
  934.    
  935.     CheckForEverything()
  936.     PlaceDownPlus(3)
  937.     TurnRightPlus()
  938.    
  939.     CheckForEverything()
  940.     MoveForwardPlus()
  941.     PlaceDownPlus(3)
  942.     TurnLeftPlus()
  943.     MoveForwardPlus()
  944.     PlaceDownPlus(3)
  945.    
  946. end
  947.  
  948. function CreateCornerLayer3()
  949.  
  950.     CheckForEverything()
  951.     MoveUpPlus()
  952.     PlaceDownPlus(3)
  953.     TurnRightPlus()
  954.     TurnRightPlus()
  955.    
  956.     CheckForEverything()
  957.     MoveForwardPlus()
  958.     PlaceDownPlus(3)
  959.     TurnRightPlus()
  960.    
  961.     CheckForEverything()
  962.     MoveForwardPlus()
  963.     PlaceDownPlus(3)
  964.    
  965.     TurnLeftPlus()
  966.    
  967.     for i = 1, 4 do
  968.         CheckForEverything()
  969.         MoveForwardPlus()
  970.     end
  971.    
  972.     CheckForEverything()
  973.     TurnLeftPlus()
  974.     PlaceDownPlus(3)
  975.    
  976.     for i = 1, 4 do
  977.         CheckForEverything()
  978.         MoveForwardPlus()
  979.         PlaceDownPlus(3)
  980.     end
  981.    
  982.     CheckForEverything()
  983.     MoveForwardPlus()
  984.     TurnLeftPlus()
  985.     PlaceDownPlus(3)
  986.    
  987.     for i = 1, 5 do
  988.         CheckForEverything()
  989.         MoveForwardPlus()
  990.         PlaceDownPlus(3)
  991.     end
  992.    
  993.    
  994. end
  995.  
  996. function CreateCornerLayer4()
  997.  
  998.     CheckForEverything()
  999.     MoveUpPlus()
  1000.     PlaceDownPlus(3)
  1001.     TurnRightPlus()
  1002.     TurnRightPlus()
  1003.    
  1004.     for i = 1, 3 do
  1005.         CheckForEverything()
  1006.         MoveForwardPlus()
  1007.         PlaceDownPlus(3)
  1008.     end
  1009.    
  1010.    
  1011.     TurnRightPlus()
  1012.     CheckForEverything()
  1013.     MoveForwardPlus()
  1014.     PlaceDownPlus(7)
  1015.    
  1016.     CheckForEverything()
  1017.     MoveBackPlus()
  1018.     TurnLeftPlus()
  1019.    
  1020.     CheckForEverything()
  1021.     MoveForwardPlus()
  1022.     PlaceDownPlus(3)
  1023.    
  1024.     CheckForEverything()
  1025.     MoveForwardPlus()
  1026.     PlaceDownPlus(3)
  1027.    
  1028.     TurnLeftPlus()
  1029.     CheckForEverything()
  1030.     MoveForwardPlus()
  1031.     PlaceDownPlus(7)
  1032.    
  1033.     CheckForEverything()
  1034.     MoveBackPlus()
  1035.     TurnRightPlus()
  1036.    
  1037.     CheckForEverything()
  1038.     MoveForwardPlus()
  1039.     PlaceDownPlus(7)
  1040.    
  1041.     CheckForEverything()
  1042.     MoveBackPlus()
  1043.     TurnRightPlus()
  1044.    
  1045.     for i = 1, 2 do
  1046.         CheckForEverything()
  1047.         MoveForwardPlus()
  1048.         PlaceDownPlus(3)
  1049.     end
  1050.    
  1051.     TurnRightPlus()
  1052.     CheckForEverything()
  1053.     MoveForwardPlus()
  1054.     PlaceDownPlus(7)
  1055.    
  1056.     CheckForEverything()
  1057.     MoveBackPlus()
  1058.     TurnLeftPlus()
  1059.    
  1060.     for i = 1, 3 do
  1061.         CheckForEverything()
  1062.         MoveForwardPlus()
  1063.         PlaceDownPlus(3)
  1064.     end
  1065.    
  1066.    
  1067.     TurnRightPlus()
  1068.    
  1069.     for i = 1, 4 do
  1070.     CheckForEverything()
  1071.     MoveForwardPlus()
  1072.     end
  1073.    
  1074.     CheckForEverything()
  1075.     PlaceDownPlus(3)
  1076.    
  1077.     CheckForEverything()
  1078.     MoveBackPlus()
  1079.     PlaceDownPlus(7)
  1080.     CheckForEverything()
  1081.     MoveForwardPlus()
  1082.    
  1083.     TurnRightPlus()
  1084.     CheckForEverything()
  1085.     MoveForwardPlus()
  1086.     PlaceDownPlus(3)
  1087.    
  1088.     TurnLeftPlus()
  1089.     CheckForEverything()
  1090.     MoveForwardPlus()
  1091.     PlaceDownPlus(3)
  1092.    
  1093.     TurnRightPlus()
  1094.     CheckForEverything()
  1095.     MoveForwardPlus()
  1096.     PlaceDownPlus(7)
  1097.    
  1098. end
  1099.  
  1100. function CreateCornerLayer5()
  1101.    
  1102.     CheckForEverything()
  1103.     MoveUpPlus()
  1104.     CheckForEverything()
  1105.     MoveBackPlus()
  1106.     CheckForEverything()
  1107.     MoveBackPlus()
  1108.    
  1109.     PlaceDownPlus(3)
  1110.     CheckForEverything()
  1111.     MoveForwardPlus()
  1112.     PlaceDownPlus(3)
  1113.    
  1114.     for i = 1, 3 do
  1115.         CheckForEverything()
  1116.         MoveForwardPlus()
  1117.         PlaceDownPlus(5)
  1118.     end
  1119.    
  1120.     for i = 1, 2 do
  1121.         CheckForEverything()
  1122.         MoveForwardPlus()
  1123.         PlaceDownPlus(3)
  1124.     end
  1125.    
  1126.     TurnRightPlus()
  1127.     CheckForEverything()
  1128.     MoveForwardPlus()
  1129.     TurnRightPlus()
  1130.    
  1131.     for i = 1, 2 do
  1132.         CheckForEverything()
  1133.         PlaceDownPlus(3)
  1134.         MoveForwardPlus()
  1135.     end
  1136.    
  1137.     for i = 1, 3 do
  1138.         CheckForEverything()
  1139.         PlaceDownPlus(5)
  1140.         MoveForwardPlus()
  1141.     end
  1142.    
  1143.     CheckForEverything()
  1144.     PlaceDownPlus(3)
  1145.     MoveForwardPlus()
  1146.    
  1147.     CheckForEverything()
  1148.     PlaceDownPlus(3)
  1149.    
  1150.     TurnLeftPlus()
  1151.     CheckForEverything()
  1152.     MoveForwardPlus()
  1153.     TurnLeftPlus()
  1154.    
  1155.     for i = 1, 5 do
  1156.         CheckForEverything()
  1157.         PlaceDownPlus(5)
  1158.         MoveForwardPlus()
  1159.     end
  1160.    
  1161.     CheckForEverything()
  1162.     PlaceDownPlus(3)
  1163.     MoveForwardPlus()
  1164.    
  1165.     CheckForEverything()
  1166.     PlaceDownPlus(3)
  1167.    
  1168.    
  1169.     TurnRightPlus()
  1170.     CheckForEverything()
  1171.     MoveForwardPlus()
  1172.     TurnRightPlus()
  1173.    
  1174.     for i = 1, 2 do
  1175.         CheckForEverything()
  1176.         PlaceDownPlus(3)
  1177.         MoveForwardPlus()
  1178.     end
  1179.    
  1180.     for i = 1, 4 do
  1181.         CheckForEverything()
  1182.         PlaceDownPlus(5)
  1183.         MoveForwardPlus()
  1184.     end
  1185.    
  1186.     CheckForEverything()
  1187.     PlaceDownPlus(5)
  1188.    
  1189.     TurnLeftPlus()
  1190.     CheckForEverything()
  1191.     MoveForwardPlus()
  1192.     TurnLeftPlus()
  1193.    
  1194.     for i = 1, 5 do
  1195.         CheckForEverything()
  1196.         PlaceDownPlus(5)
  1197.         MoveForwardPlus()
  1198.     end
  1199.    
  1200.     CheckForEverything()
  1201.     PlaceDownPlus(3)
  1202.     MoveForwardPlus()
  1203.    
  1204.     CheckForEverything()
  1205.     PlaceDownPlus(3)
  1206.    
  1207.    
  1208.     TurnRightPlus()
  1209.     CheckForEverything()
  1210.     MoveForwardPlus()
  1211.     TurnRightPlus()
  1212.     CheckForEverything()
  1213.     MoveForwardPlus()
  1214.    
  1215.     for i = 1, 5 do
  1216.         CheckForEverything()
  1217.         PlaceDownPlus(3)
  1218.         MoveForwardPlus()
  1219.     end
  1220.    
  1221.     CheckForEverything()
  1222.     PlaceDownPlus(3)
  1223.    
  1224.     TurnLeftPlus()
  1225.     CheckForEverything()
  1226.     MoveForwardPlus()
  1227.     TurnLeftPlus()
  1228.    
  1229.     for i = 1, 4 do
  1230.         CheckForEverything()
  1231.         PlaceDownPlus(3)
  1232.         MoveForwardPlus()
  1233.     end
  1234.    
  1235.     CheckForEverything()
  1236.     PlaceDownPlus(3)
  1237.    
  1238.     CheckForEverything()
  1239.     MoveForwardPlus()
  1240.    
  1241.     CheckForEverything()
  1242.     MoveForwardPlus()
  1243.     PlaceDownPlus(3)
  1244. end
  1245.  
  1246. function CreateCornerLayer6()
  1247.    
  1248.     CheckForEverything()
  1249.     MoveUpPlus()
  1250.     TurnLeftPlus()
  1251.    
  1252.     for i = 1, 6 do
  1253.         CheckForEverything()
  1254.         PlaceDownPlus(3)
  1255.         MoveForwardPlus()
  1256.     end
  1257.    
  1258.     PlaceDownPlus(3)
  1259.    
  1260.     TurnLeftPlus()
  1261.    
  1262.     for i = 1, 6 do
  1263.         CheckForEverything()
  1264.         MoveForwardPlus()
  1265.     end
  1266.    
  1267.     PlaceDownPlus(3)
  1268.     TurnLeftPlus()
  1269.    
  1270.     for i = 1, 6 do
  1271.         CheckForEverything()
  1272.         MoveForwardPlus()
  1273.     end
  1274.    
  1275.     PlaceDownPlus(3)
  1276.     TurnLeftPlus()
  1277.    
  1278.     for i = 1, 5 do
  1279.         CheckForEverything()
  1280.         MoveForwardPlus()
  1281.         PlaceDownPlus(3)
  1282.     end
  1283.    
  1284.     CheckForEverything()
  1285.     MoveForwardPlus()
  1286. end
  1287.  
  1288. function CreateCornerLayer7()
  1289.  
  1290.     CheckForEverything()
  1291.     TurnLeftPlus()
  1292.     MoveUpPlus()
  1293.     PlaceDownPlus(3)
  1294.    
  1295.     CheckForEverything()
  1296.     MoveForwardPlus()
  1297.     PlaceDownPlus(9)
  1298.    
  1299.     for i = 1, 2 do
  1300.         CheckForEverything()
  1301.         MoveForwardPlus()
  1302.         PlaceDownPlus(3)
  1303.     end
  1304.    
  1305.     CheckForEverything()
  1306.     MoveForwardPlus()
  1307.     PlaceDownPlus(7)
  1308.    
  1309.     TurnRightPlus()
  1310.     TurnRightPlus()
  1311.    
  1312.     for i = 1, 4 do
  1313.         CheckForEverything()
  1314.         MoveForwardPlus()
  1315.     end
  1316.    
  1317.     TurnRightPlus()
  1318.    
  1319.     CheckForEverything()
  1320.     MoveForwardPlus()
  1321.     PlaceDownPlus(9)
  1322.    
  1323.     for i = 1, 2 do
  1324.         CheckForEverything()
  1325.         MoveForwardPlus()
  1326.         PlaceDownPlus(3)
  1327.     end
  1328.    
  1329.     CheckForEverything()
  1330.     MoveForwardPlus()
  1331.     PlaceDownPlus(7)
  1332.    
  1333. end
  1334.  
  1335. function CreateCornerLayer8()
  1336.  
  1337.     CheckForEverything()
  1338.     TurnLeftPlus()
  1339.     TurnLeftPlus()
  1340.     MoveUpPlus()
  1341.    
  1342.     CheckForEverything()
  1343.     MoveForwardPlus()
  1344.    
  1345.     for i = 1, 3 do
  1346.         CheckForEverything()
  1347.         MoveForwardPlus()
  1348.         PlaceDownPlus(3)
  1349.     end
  1350.    
  1351.     TurnLeftPlus()
  1352.    
  1353.     for i = 1, 2 do
  1354.         CheckForEverything()
  1355.         MoveForwardPlus()
  1356.         PlaceDownPlus(3)
  1357.     end
  1358.    
  1359. end
  1360.  
  1361.  
  1362. function CreateCornerLayer9()
  1363.  
  1364.     CheckForEverything()
  1365.     TurnLeftPlus()
  1366.     TurnLeftPlus()
  1367.     MoveUpPlus()
  1368.    
  1369.     for i = 1, 2 do
  1370.         CheckForEverything()
  1371.         MoveForwardPlus()
  1372.         PlaceDownPlus(3)
  1373.     end
  1374.    
  1375.     TurnRightPlus()
  1376.    
  1377.     CheckForEverything()
  1378.     MoveForwardPlus()
  1379.     PlaceDownPlus(3)
  1380.    
  1381. end
  1382.  
  1383. function CreateCornerLayer10()
  1384.  
  1385.     CheckForEverything()
  1386.     TurnLeftPlus()
  1387.     TurnLeftPlus()
  1388.     MoveUpPlus()
  1389.    
  1390.     CheckForEverything()
  1391.     MoveForwardPlus()
  1392.     PlaceDownPlus(3)
  1393.    
  1394. end
  1395.  
  1396. function CreateCornerLayer11()
  1397.  
  1398.     CheckForEverything()
  1399.     MoveUpPlus()
  1400.     PlaceDownPlus(7)
  1401.    
  1402.    
  1403.     CheckForEverything()
  1404.     MoveForwardPlus()
  1405.     CheckForEverything()
  1406.     MoveDownPlus()
  1407.     CheckForEverything()
  1408.     MoveDownPlus()
  1409.     CheckForEverything()
  1410.     MoveDownPlus()
  1411.     CheckForEverything()
  1412.     MoveDownPlus()
  1413.     CheckForEverything()
  1414.     MoveDownPlus()
  1415.     CheckForEverything()
  1416.     MoveDownPlus()
  1417.     CheckForEverything()
  1418.     MoveDownPlus()
  1419.     CheckForEverything()
  1420.     MoveDownPlus()
  1421.     CheckForEverything()
  1422.     MoveDownPlus()
  1423.     CheckForEverything()
  1424.     MoveDownPlus()
  1425.    
  1426.    
  1427.     TurnLeftPlus()
  1428.     CheckForEverything()
  1429.     MoveForwardPlus()
  1430.     CheckForEverything()
  1431.     MoveForwardPlus()
  1432.     CheckForEverything()
  1433.     MoveForwardPlus()
  1434.     CheckForEverything()
  1435.     MoveForwardPlus()
  1436.     CheckForEverything()
  1437.     MoveForwardPlus()
  1438.     CheckForEverything()
  1439.     MoveForwardPlus()
  1440.     CheckForEverything()
  1441.     MoveForwardPlus()
  1442.     TurnLeftPlus()
  1443.     CheckForEverything()
  1444.     MoveForwardPlus()
  1445.     CheckForEverything()
  1446.     MoveForwardPlus()
  1447.    
  1448. end
  1449.  
  1450.  
  1451.  
  1452. function CreateCorner()
  1453.     CreateCornerLayer1()
  1454.     CreateCornerLayer2()
  1455.     CreateCornerLayer3()
  1456.     CreateCornerLayer4()
  1457.     CreateCornerLayer5()
  1458.     CreateCornerLayer6()
  1459.     CreateCornerLayer7()
  1460.     CreateCornerLayer8()
  1461.     CreateCornerLayer9()
  1462.     CreateCornerLayer10()
  1463.     CreateCornerLayer11()
  1464. end
  1465.  
  1466.  
  1467. function CreateLongPieceLayer1()
  1468.  
  1469.     for i = 1, 2 do
  1470.         CheckForEverything()
  1471.         PlaceDownPlus(1)
  1472.         MoveForwardPlus()
  1473.     end
  1474.        
  1475.     CheckForEverything()
  1476.     PlaceDownPlus(13)
  1477.     MoveForwardPlus()
  1478.    
  1479.     for i = 1, 2 do
  1480.         CheckForEverything()
  1481.         PlaceDownPlus(1)
  1482.         MoveForwardPlus()
  1483.     end
  1484.        
  1485.        
  1486.     CheckForEverything()
  1487.     TurnRightPlus()
  1488.     MoveForwardPlus()
  1489.     TurnRightPlus()
  1490.     CheckForEverything()
  1491.     MoveForwardPlus()  
  1492.        
  1493.     for i = 1, 2 do
  1494.         CheckForEverything()
  1495.         PlaceDownPlus(1)
  1496.         MoveForwardPlus()
  1497.     end
  1498.        
  1499.     CheckForEverything()
  1500.     PlaceDownPlus(13)
  1501.     MoveForwardPlus()
  1502.    
  1503.     for i = 1, 2 do
  1504.         CheckForEverything()
  1505.         PlaceDownPlus(1)
  1506.         MoveForwardPlus()
  1507.     end
  1508.        
  1509.     CheckForEverything()
  1510.     TurnLeftPlus()
  1511.     MoveForwardPlus()
  1512.     TurnLeftPlus()
  1513.     CheckForEverything()
  1514.     MoveForwardPlus()
  1515.    
  1516.     for i = 1, 2 do
  1517.         CheckForEverything()
  1518.         PlaceDownPlus(1)
  1519.         MoveForwardPlus()
  1520.     end
  1521.        
  1522.     CheckForEverything()
  1523.     PlaceDownPlus(13)
  1524.     MoveForwardPlus()
  1525.    
  1526.     for i = 1, 2 do
  1527.         CheckForEverything()
  1528.         PlaceDownPlus(1)
  1529.         MoveForwardPlus()
  1530.     end
  1531.        
  1532.     CheckForEverything()
  1533.     TurnRightPlus()
  1534.     MoveForwardPlus()
  1535.     TurnRightPlus()
  1536.     CheckForEverything()
  1537.     MoveForwardPlus()  
  1538.        
  1539.     for i = 1, 2 do
  1540.         CheckForEverything()
  1541.         PlaceDownPlus(1)
  1542.         MoveForwardPlus()
  1543.     end
  1544.        
  1545.     CheckForEverything()
  1546.     PlaceDownPlus(13)
  1547.     MoveForwardPlus()
  1548.    
  1549.     for i = 1, 2 do
  1550.         CheckForEverything()
  1551.         PlaceDownPlus(1)
  1552.         MoveForwardPlus()
  1553.     end
  1554.        
  1555.    
  1556.     CheckForEverything()
  1557.     TurnLeftPlus()
  1558.     MoveForwardPlus()
  1559.     TurnLeftPlus()
  1560.     CheckForEverything()
  1561.     MoveForwardPlus()
  1562.    
  1563.     for i = 1, 2 do
  1564.         CheckForEverything()
  1565.         PlaceDownPlus(1)
  1566.         MoveForwardPlus()
  1567.     end
  1568.        
  1569.     CheckForEverything()
  1570.     PlaceDownPlus(13)
  1571.     MoveForwardPlus()
  1572.    
  1573.     for i = 1, 2 do
  1574.         CheckForEverything()
  1575.         PlaceDownPlus(1)
  1576.         MoveForwardPlus()
  1577.     end
  1578.        
  1579.     CheckForEverything()
  1580.     TurnRightPlus()
  1581.     MoveForwardPlus()
  1582.     TurnRightPlus()
  1583.     CheckForEverything()
  1584.     MoveForwardPlus()
  1585.    
  1586.     for i = 1, 2 do
  1587.         CheckForEverything()
  1588.         PlaceDownPlus(1)
  1589.         MoveForwardPlus()
  1590.     end
  1591.        
  1592.     CheckForEverything()
  1593.     PlaceDownPlus(13)
  1594.     MoveForwardPlus()
  1595.    
  1596.     for i = 1, 2 do
  1597.         CheckForEverything()
  1598.         PlaceDownPlus(1)
  1599.         MoveForwardPlus()
  1600.     end
  1601.        
  1602. end
  1603.  
  1604. function CreateLongPieceLayer2()
  1605.  
  1606.     CheckForEverything()
  1607.     MoveUpPlus()
  1608.     TurnRightPlus()
  1609.     TurnRightPlus()
  1610.     CheckForEverything()
  1611.     MoveForwardPlus()
  1612.    
  1613.     CheckForEverything()
  1614.     PlaceDownPlus(3)
  1615.    
  1616.     for i = 1, 4 do
  1617.         CheckForEverything()
  1618.         MoveForwardPlus()
  1619.     end
  1620.    
  1621.     CheckForEverything()
  1622.     PlaceDownPlus(3)
  1623.    
  1624.     TurnLeftPlus()
  1625.     MoveForwardPlus()
  1626.     CheckForEverything()
  1627.     TurnLeftPlus()
  1628.    
  1629.     CheckForEverything()
  1630.     PlaceDownPlus(3)
  1631.    
  1632.     for i = 1, 4 do
  1633.         CheckForEverything()
  1634.         MoveForwardPlus()
  1635.     end
  1636.    
  1637.     CheckForEverything()
  1638.     PlaceDownPlus(3)
  1639.    
  1640.     TurnRightPlus()
  1641.     MoveForwardPlus()
  1642.     CheckForEverything()
  1643.     TurnRightPlus()
  1644.    
  1645.     CheckForEverything()
  1646.     PlaceDownPlus(3)
  1647.    
  1648.     for i = 1, 4 do
  1649.         CheckForEverything()
  1650.         MoveForwardPlus()
  1651.     end
  1652.    
  1653.     CheckForEverything()
  1654.     PlaceDownPlus(3)
  1655.    
  1656.     TurnLeftPlus()
  1657.     MoveForwardPlus()
  1658.     CheckForEverything()
  1659.     TurnLeftPlus()
  1660.    
  1661.     CheckForEverything()
  1662.     PlaceDownPlus(3)
  1663.    
  1664.     for i = 1, 4 do
  1665.         CheckForEverything()
  1666.         MoveForwardPlus()
  1667.     end
  1668.    
  1669.     CheckForEverything()
  1670.     PlaceDownPlus(3)
  1671.    
  1672.     TurnRightPlus()
  1673.     MoveForwardPlus()
  1674.     CheckForEverything()
  1675.     TurnRightPlus()
  1676.    
  1677.     CheckForEverything()
  1678.     PlaceDownPlus(3)
  1679.    
  1680.     for i = 1, 4 do
  1681.         CheckForEverything()
  1682.         MoveForwardPlus()
  1683.     end
  1684.    
  1685.     CheckForEverything()
  1686.     PlaceDownPlus(3)
  1687.    
  1688.     TurnLeftPlus()
  1689.     MoveForwardPlus()
  1690.     CheckForEverything()
  1691.     TurnLeftPlus()
  1692.    
  1693.     CheckForEverything()
  1694.     PlaceDownPlus(3)
  1695.    
  1696.     for i = 1, 4 do
  1697.         CheckForEverything()
  1698.         MoveForwardPlus()
  1699.     end
  1700.    
  1701.     CheckForEverything()
  1702.     PlaceDownPlus(3)
  1703.     CheckForEverything()
  1704.     MoveForwardPlus()
  1705.    
  1706.    
  1707. end
  1708.  
  1709. function CreateLongPieceLayer3()
  1710.    
  1711.     CheckForEverything()
  1712.     MoveUpPlus()
  1713.     TurnRightPlus()
  1714.     TurnRightPlus()
  1715.     CheckForEverything()
  1716.     MoveForwardPlus()
  1717.    
  1718.     CheckForEverything()
  1719.     PlaceDownPlus(3)
  1720.    
  1721.     for i = 1, 4 do
  1722.         CheckForEverything()
  1723.         MoveForwardPlus()
  1724.     end
  1725.    
  1726.     CheckForEverything()
  1727.     PlaceDownPlus(3)
  1728.    
  1729.     TurnRightPlus()
  1730.     MoveForwardPlus()
  1731.     CheckForEverything()
  1732.     TurnRightPlus()
  1733.    
  1734.     CheckForEverything()
  1735.     PlaceDownPlus(3)
  1736.    
  1737.     for i = 1, 4 do
  1738.         CheckForEverything()
  1739.         MoveForwardPlus()
  1740.     end
  1741.    
  1742.     CheckForEverything()
  1743.     PlaceDownPlus(3)
  1744.    
  1745.     TurnLeftPlus()
  1746.     MoveForwardPlus()
  1747.     CheckForEverything()
  1748.     TurnLeftPlus()
  1749.    
  1750.     CheckForEverything()
  1751.     PlaceDownPlus(3)
  1752.    
  1753.     for i = 1, 4 do
  1754.         CheckForEverything()
  1755.         MoveForwardPlus()
  1756.     end
  1757.    
  1758.     CheckForEverything()
  1759.     PlaceDownPlus(3)
  1760.    
  1761.     TurnRightPlus()
  1762.     MoveForwardPlus()
  1763.     CheckForEverything()
  1764.     TurnRightPlus()
  1765.    
  1766.     CheckForEverything()
  1767.     PlaceDownPlus(3)
  1768.    
  1769.     for i = 1, 4 do
  1770.         CheckForEverything()
  1771.         MoveForwardPlus()
  1772.     end
  1773.    
  1774.     CheckForEverything()
  1775.     PlaceDownPlus(3)
  1776.    
  1777.     TurnLeftPlus()
  1778.     MoveForwardPlus()
  1779.     CheckForEverything()
  1780.     TurnLeftPlus()
  1781.    
  1782.     CheckForEverything()
  1783.     PlaceDownPlus(3)
  1784.    
  1785.     for i = 1, 4 do
  1786.         CheckForEverything()
  1787.         MoveForwardPlus()
  1788.     end
  1789.    
  1790.     CheckForEverything()
  1791.     PlaceDownPlus(3)
  1792.    
  1793.     TurnRightPlus()
  1794.     MoveForwardPlus()
  1795.     CheckForEverything()
  1796.     TurnRightPlus()
  1797.    
  1798.     CheckForEverything()
  1799.     PlaceDownPlus(3)
  1800.    
  1801.     for i = 1, 4 do
  1802.         CheckForEverything()
  1803.         MoveForwardPlus()
  1804.     end
  1805.    
  1806.     CheckForEverything()
  1807.     PlaceDownPlus(3)
  1808.    
  1809.     CheckForEverything()
  1810.     MoveForwardPlus()
  1811.    
  1812. end
  1813.  
  1814.  
  1815. function CreateLongPieceLayer4()
  1816.    
  1817.     CheckForEverything()
  1818.     MoveUpPlus()
  1819.     TurnRightPlus()
  1820.     TurnRightPlus()
  1821.     CheckForEverything()
  1822.     MoveForwardPlus()
  1823.     CheckForEverything()
  1824.     PlaceDownPlus(3)
  1825.     CheckForEverything()
  1826.     MoveBackPlus()
  1827.     CheckForEverything()
  1828.     PlaceDownPlus(7)
  1829.    
  1830.     CheckForEverything()
  1831.     MoveForwardPlus()
  1832.    
  1833.     CheckForEverything()
  1834.     MoveForwardPlus()
  1835.     CheckForEverything()
  1836.     PlaceDownPlus(7)
  1837.    
  1838.     CheckForEverything()
  1839.     MoveForwardPlus()
  1840.     CheckForEverything()
  1841.     MoveForwardPlus()
  1842.     CheckForEverything()
  1843.     MoveForwardPlus()
  1844.     CheckForEverything()
  1845.     PlaceDownPlus(3)
  1846.     CheckForEverything()
  1847.     MoveBackPlus()
  1848.     CheckForEverything()
  1849.     PlaceDownPlus(7)
  1850.     CheckForEverything()
  1851.     MoveForwardPlus()
  1852.     CheckForEverything()
  1853.     MoveForwardPlus()
  1854.     CheckForEverything()
  1855.     PlaceDownPlus(7)
  1856.    
  1857.     TurnLeftPlus()
  1858.     MoveForwardPlus()
  1859.     CheckForEverything()
  1860.     TurnLeftPlus()
  1861.    
  1862.     CheckForEverything()
  1863.     MoveForwardPlus()
  1864.     CheckForEverything()
  1865.     PlaceDownPlus(9)
  1866.    
  1867.     CheckForEverything()
  1868.     MoveForwardPlus()
  1869.     CheckForEverything()
  1870.     MoveForwardPlus()
  1871.     CheckForEverything()
  1872.     MoveForwardPlus()
  1873.     CheckForEverything()
  1874.     MoveForwardPlus()
  1875.     CheckForEverything()
  1876.     PlaceDownPlus(9)
  1877.    
  1878.     TurnRightPlus()
  1879.     MoveForwardPlus()
  1880.     CheckForEverything()
  1881.     TurnRightPlus()
  1882.    
  1883.     CheckForEverything()
  1884.     PlaceDownPlus(3)
  1885.     CheckForEverything()
  1886.     MoveForwardPlus()
  1887.     CheckForEverything()
  1888.     MoveForwardPlus()
  1889.     CheckForEverything()
  1890.     MoveForwardPlus()
  1891.     CheckForEverything()
  1892.     MoveForwardPlus()
  1893.     CheckForEverything()
  1894.     PlaceDownPlus(3)
  1895.    
  1896.     TurnLeftPlus()
  1897.     MoveForwardPlus()
  1898.     CheckForEverything()
  1899.     TurnLeftPlus()
  1900.    
  1901.     CheckForEverything()
  1902.     PlaceDownPlus(3)
  1903.     CheckForEverything()
  1904.     MoveForwardPlus()
  1905.     CheckForEverything()
  1906.     MoveForwardPlus()
  1907.     CheckForEverything()
  1908.     MoveForwardPlus()
  1909.     CheckForEverything()
  1910.     MoveForwardPlus()
  1911.     CheckForEverything()
  1912.     PlaceDownPlus(3)
  1913.    
  1914.     TurnRightPlus()
  1915.     MoveForwardPlus()
  1916.     CheckForEverything()
  1917.     TurnRightPlus()
  1918.    
  1919.     CheckForEverything()
  1920.     PlaceDownPlus(9)
  1921.     CheckForEverything()
  1922.     MoveForwardPlus()
  1923.     CheckForEverything()
  1924.     MoveForwardPlus()
  1925.     CheckForEverything()
  1926.     MoveForwardPlus()
  1927.     CheckForEverything()
  1928.     MoveForwardPlus()
  1929.     CheckForEverything()
  1930.     PlaceDownPlus(9)
  1931.    
  1932.     TurnLeftPlus()
  1933.     MoveForwardPlus()
  1934.     CheckForEverything()
  1935.     TurnLeftPlus()
  1936.    
  1937.     CheckForEverything()
  1938.     PlaceDownPlus(3)
  1939.    
  1940.     MoveBackPlus()
  1941.     CheckForEverything()
  1942.     PlaceDownPlus(7)
  1943.     MoveForwardPlus()
  1944.     CheckForEverything()
  1945.     MoveForwardPlus()
  1946.     CheckForEverything()
  1947.     PlaceDownPlus(7)
  1948.    
  1949.     CheckForEverything()
  1950.     MoveForwardPlus()
  1951.     CheckForEverything()
  1952.     MoveForwardPlus()
  1953.     CheckForEverything()
  1954.     MoveForwardPlus()
  1955.     CheckForEverything()
  1956.     PlaceDownPlus(3)
  1957.    
  1958.     MoveBackPlus()
  1959.     CheckForEverything()
  1960.     PlaceDownPlus(7)
  1961.     MoveForwardPlus()
  1962.     CheckForEverything()
  1963.     MoveForwardPlus()
  1964.     CheckForEverything()
  1965.     PlaceDownPlus(7)
  1966.    
  1967. end
  1968.  
  1969. function CreateLongPieceLayer5()
  1970.    
  1971.     CheckForEverything()
  1972.     MoveUpPlus()
  1973.     TurnRightPlus()
  1974.     TurnRightPlus()
  1975.     CheckForEverything()
  1976.     PlaceDownPlus(3)
  1977.     CheckForEverything()
  1978.     MoveForwardPlus()
  1979.     CheckForEverything()
  1980.     PlaceDownPlus(3)
  1981.    
  1982.     CheckForEverything()
  1983.     MoveForwardPlus()
  1984.     CheckForEverything()
  1985.     PlaceDownPlus(5)
  1986.     CheckForEverything()
  1987.     MoveForwardPlus()
  1988.     CheckForEverything()
  1989.     PlaceDownPlus(5)
  1990.     CheckForEverything()
  1991.     MoveForwardPlus()
  1992.     CheckForEverything()
  1993.     PlaceDownPlus(5)
  1994.     CheckForEverything()
  1995.     MoveForwardPlus()
  1996.     CheckForEverything()
  1997.     PlaceDownPlus(3)
  1998.     CheckForEverything()
  1999.     MoveForwardPlus()
  2000.     CheckForEverything()
  2001.     PlaceDownPlus(3)
  2002.    
  2003.     TurnRightPlus()
  2004.     MoveForwardPlus()
  2005.     CheckForEverything()
  2006.     TurnRightPlus()
  2007.    
  2008.     MoveForwardPlus()
  2009.     CheckForEverything()
  2010.     PlaceDownPlus(3)
  2011.    
  2012.     MoveForwardPlus()
  2013.     CheckForEverything()
  2014.     PlaceDownPlus(5)
  2015.     MoveForwardPlus()
  2016.     CheckForEverything()
  2017.     PlaceDownPlus(5)
  2018.     MoveForwardPlus()
  2019.     CheckForEverything()
  2020.     PlaceDownPlus(5)
  2021.     MoveForwardPlus()
  2022.     CheckForEverything()
  2023.     PlaceDownPlus(3)
  2024.     CheckForEverything()
  2025.     MoveForwardPlus()
  2026.    
  2027.     TurnLeftPlus()
  2028.     MoveForwardPlus()
  2029.     CheckForEverything()
  2030.     TurnLeftPlus()
  2031.    
  2032.     CheckForEverything()
  2033.     PlaceDownPlus(3)
  2034.     CheckForEverything()
  2035.     MoveForwardPlus()
  2036.     CheckForEverything()
  2037.     PlaceDownPlus(3)
  2038.     MoveForwardPlus()
  2039.     CheckForEverything()
  2040.     PlaceDownPlus(5)
  2041.     MoveForwardPlus()
  2042.     CheckForEverything()
  2043.     PlaceDownPlus(5)
  2044.     MoveForwardPlus()
  2045.     CheckForEverything()
  2046.     PlaceDownPlus(5)
  2047.     MoveForwardPlus()
  2048.     CheckForEverything()
  2049.     PlaceDownPlus(3)
  2050.     MoveForwardPlus()
  2051.     CheckForEverything()
  2052.     PlaceDownPlus(3)
  2053.    
  2054.     TurnRightPlus()
  2055.     MoveForwardPlus()
  2056.     CheckForEverything()
  2057.     TurnRightPlus()
  2058.    
  2059.     CheckForEverything()
  2060.     PlaceDownPlus(3)
  2061.     CheckForEverything()
  2062.     MoveForwardPlus()
  2063.     CheckForEverything()
  2064.     PlaceDownPlus(3)
  2065.     MoveForwardPlus()
  2066.     CheckForEverything()
  2067.     PlaceDownPlus(5)
  2068.     MoveForwardPlus()
  2069.     CheckForEverything()
  2070.     PlaceDownPlus(5)
  2071.     MoveForwardPlus()
  2072.     CheckForEverything()
  2073.     PlaceDownPlus(5)
  2074.     MoveForwardPlus()
  2075.     CheckForEverything()
  2076.     PlaceDownPlus(3)
  2077.     MoveForwardPlus()
  2078.     CheckForEverything()
  2079.     PlaceDownPlus(3)
  2080.    
  2081.     TurnLeftPlus()
  2082.     MoveForwardPlus()
  2083.     CheckForEverything()
  2084.     TurnLeftPlus()
  2085.    
  2086.     MoveForwardPlus()
  2087.     CheckForEverything()
  2088.     PlaceDownPlus(3)
  2089.     CheckForEverything()
  2090.     MoveForwardPlus()
  2091.     CheckForEverything()
  2092.     PlaceDownPlus(5)
  2093.     MoveForwardPlus()
  2094.     CheckForEverything()
  2095.     PlaceDownPlus(5)
  2096.     MoveForwardPlus()
  2097.     CheckForEverything()
  2098.     PlaceDownPlus(5)
  2099.     MoveForwardPlus()
  2100.     CheckForEverything()
  2101.     PlaceDownPlus(3)
  2102.     MoveForwardPlus()
  2103.     CheckForEverything()
  2104.    
  2105.     TurnRightPlus()
  2106.     MoveForwardPlus()
  2107.     CheckForEverything()
  2108.     TurnRightPlus()
  2109.    
  2110.     PlaceDownPlus(3)
  2111.     CheckForEverything()
  2112.     MoveForwardPlus()
  2113.     CheckForEverything()
  2114.     CheckForEverything()
  2115.     PlaceDownPlus(3)
  2116.     CheckForEverything()
  2117.     MoveForwardPlus()
  2118.     CheckForEverything()
  2119.     PlaceDownPlus(5)
  2120.     MoveForwardPlus()
  2121.     CheckForEverything()
  2122.     PlaceDownPlus(5)
  2123.     MoveForwardPlus()
  2124.     CheckForEverything()
  2125.     PlaceDownPlus(5)
  2126.     MoveForwardPlus()
  2127.     CheckForEverything()
  2128.     PlaceDownPlus(3)
  2129.     MoveForwardPlus()
  2130.     CheckForEverything()
  2131.     PlaceDownPlus(3)
  2132.    
  2133. end
  2134.  
  2135. function CreateLongPieceLayer6()
  2136.    
  2137.     CheckForEverything()
  2138.     MoveUpPlus()
  2139.     TurnRightPlus()
  2140.     TurnRightPlus()
  2141.     CheckForEverything()
  2142.     PlaceDownPlus(3)
  2143.    
  2144.     CheckForEverything()
  2145.     MoveForwardPlus()
  2146.     CheckForEverything()
  2147.     MoveForwardPlus()
  2148.     CheckForEverything()
  2149.     MoveForwardPlus()
  2150.     CheckForEverything()
  2151.     MoveForwardPlus()
  2152.     CheckForEverything()
  2153.     MoveForwardPlus()
  2154.     CheckForEverything()
  2155.     MoveForwardPlus()
  2156.     CheckForEverything()
  2157.     PlaceDownPlus(3)
  2158.    
  2159.     TurnLeftPlus()
  2160.     MoveForwardPlus()
  2161.     CheckForEverything()
  2162.     TurnLeftPlus()
  2163.    
  2164.     CheckForEverything()
  2165.     PlaceDownPlus(3)
  2166.     CheckForEverything()
  2167.     MoveForwardPlus()
  2168.     CheckForEverything()
  2169.     MoveForwardPlus()
  2170.     CheckForEverything()
  2171.     MoveForwardPlus()
  2172.     CheckForEverything()
  2173.     MoveForwardPlus()
  2174.     CheckForEverything()
  2175.     MoveForwardPlus()
  2176.     CheckForEverything()
  2177.     MoveForwardPlus()
  2178.     CheckForEverything()
  2179.     PlaceDownPlus(3)
  2180.    
  2181.    
  2182.     TurnRightPlus()
  2183.     MoveForwardPlus()
  2184.     CheckForEverything()
  2185.     TurnRightPlus()
  2186.    
  2187.     CheckForEverything()
  2188.     PlaceDownPlus(3)
  2189.     CheckForEverything()
  2190.     MoveForwardPlus()
  2191.     CheckForEverything()
  2192.     MoveForwardPlus()
  2193.     CheckForEverything()
  2194.     MoveForwardPlus()
  2195.     CheckForEverything()
  2196.     MoveForwardPlus()
  2197.     CheckForEverything()
  2198.     MoveForwardPlus()
  2199.     CheckForEverything()
  2200.     MoveForwardPlus()
  2201.     CheckForEverything()
  2202.     PlaceDownPlus(3)
  2203.    
  2204.     TurnLeftPlus()
  2205.     MoveForwardPlus()
  2206.     CheckForEverything()
  2207.     TurnLeftPlus()
  2208.    
  2209.     CheckForEverything()
  2210.     PlaceDownPlus(3)
  2211.     CheckForEverything()
  2212.     MoveForwardPlus()
  2213.     CheckForEverything()
  2214.     MoveForwardPlus()
  2215.     CheckForEverything()
  2216.     MoveForwardPlus()
  2217.     CheckForEverything()
  2218.     MoveForwardPlus()
  2219.     CheckForEverything()
  2220.     MoveForwardPlus()
  2221.     CheckForEverything()
  2222.     MoveForwardPlus()
  2223.     CheckForEverything()
  2224.     PlaceDownPlus(3)
  2225.    
  2226.     TurnRightPlus()
  2227.     MoveForwardPlus()
  2228.     CheckForEverything()
  2229.     TurnRightPlus()
  2230.    
  2231.     CheckForEverything()
  2232.     PlaceDownPlus(3)
  2233.     CheckForEverything()
  2234.     MoveForwardPlus()
  2235.     CheckForEverything()
  2236.     MoveForwardPlus()
  2237.     CheckForEverything()
  2238.     MoveForwardPlus()
  2239.     CheckForEverything()
  2240.     MoveForwardPlus()
  2241.     CheckForEverything()
  2242.     MoveForwardPlus()
  2243.     CheckForEverything()
  2244.     MoveForwardPlus()
  2245.     CheckForEverything()
  2246.     PlaceDownPlus(3)
  2247.    
  2248.    
  2249.     TurnLeftPlus()
  2250.     MoveForwardPlus()
  2251.     CheckForEverything()
  2252.     TurnLeftPlus()
  2253.    
  2254.     CheckForEverything()
  2255.     PlaceDownPlus(3)
  2256.     CheckForEverything()
  2257.     MoveForwardPlus()
  2258.     CheckForEverything()
  2259.     MoveForwardPlus()
  2260.     CheckForEverything()
  2261.     MoveForwardPlus()
  2262.     CheckForEverything()
  2263.     MoveForwardPlus()
  2264.     CheckForEverything()
  2265.     MoveForwardPlus()
  2266.     CheckForEverything()
  2267.     MoveForwardPlus()
  2268.     CheckForEverything()
  2269.     PlaceDownPlus(3)
  2270.    
  2271.    
  2272. end
  2273.  
  2274. function CreateLongPieceLayer7()
  2275.    
  2276.     CheckForEverything()
  2277.     MoveUpPlus()
  2278.     TurnRightPlus()
  2279.     TurnRightPlus()
  2280.    
  2281.     CheckForEverything()
  2282.     PlaceDownPlus(7)
  2283.     CheckForEverything()
  2284.     MoveForwardPlus()
  2285.     CheckForEverything()
  2286.     MoveForwardPlus()
  2287.     CheckForEverything()
  2288.     MoveForwardPlus()
  2289.     CheckForEverything()
  2290.     MoveForwardPlus()
  2291.     CheckForEverything()
  2292.     MoveForwardPlus()
  2293.     CheckForEverything()
  2294.     MoveForwardPlus()
  2295.     CheckForEverything()
  2296.     PlaceDownPlus(7)
  2297.    
  2298.     TurnRightPlus()
  2299.     MoveForwardPlus()
  2300.     CheckForEverything()
  2301.     TurnRightPlus()
  2302.    
  2303.     CheckForEverything()
  2304.     PlaceDownPlus(3)
  2305.     CheckForEverything()
  2306.     MoveForwardPlus()
  2307.     CheckForEverything()
  2308.     MoveForwardPlus()
  2309.     CheckForEverything()
  2310.     MoveForwardPlus()
  2311.     CheckForEverything()
  2312.     MoveForwardPlus()
  2313.     CheckForEverything()
  2314.     MoveForwardPlus()
  2315.     CheckForEverything()
  2316.     MoveForwardPlus()
  2317.     CheckForEverything()
  2318.     PlaceDownPlus(3)
  2319.    
  2320.     TurnLeftPlus()
  2321.     MoveForwardPlus()
  2322.     CheckForEverything()
  2323.     TurnLeftPlus()
  2324.    
  2325.     CheckForEverything()
  2326.     PlaceDownPlus(7)
  2327.     CheckForEverything()
  2328.     MoveForwardPlus()
  2329.     CheckForEverything()
  2330.     MoveForwardPlus()
  2331.     CheckForEverything()
  2332.     MoveForwardPlus()
  2333.     CheckForEverything()
  2334.     MoveForwardPlus()
  2335.     CheckForEverything()
  2336.     MoveForwardPlus()
  2337.     CheckForEverything()
  2338.     MoveForwardPlus()
  2339.     CheckForEverything()
  2340.     PlaceDownPlus(7)
  2341.    
  2342.     TurnRightPlus()
  2343.     MoveForwardPlus()
  2344.     CheckForEverything()
  2345.     TurnRightPlus()
  2346.    
  2347.     CheckForEverything()
  2348.     PlaceDownPlus(7)
  2349.     CheckForEverything()
  2350.     MoveForwardPlus()
  2351.     CheckForEverything()
  2352.     MoveForwardPlus()
  2353.     CheckForEverything()
  2354.     MoveForwardPlus()
  2355.     CheckForEverything()
  2356.     MoveForwardPlus()
  2357.     CheckForEverything()
  2358.     MoveForwardPlus()
  2359.     CheckForEverything()
  2360.     MoveForwardPlus()
  2361.     CheckForEverything()
  2362.     PlaceDownPlus(7)
  2363.    
  2364.     TurnLeftPlus()
  2365.     MoveForwardPlus()
  2366.     CheckForEverything()
  2367.     TurnLeftPlus()
  2368.    
  2369.     CheckForEverything()
  2370.     PlaceDownPlus(3)
  2371.     CheckForEverything()
  2372.     MoveForwardPlus()
  2373.     CheckForEverything()
  2374.     MoveForwardPlus()
  2375.     CheckForEverything()
  2376.     MoveForwardPlus()
  2377.     CheckForEverything()
  2378.     MoveForwardPlus()
  2379.     CheckForEverything()
  2380.     MoveForwardPlus()
  2381.     CheckForEverything()
  2382.     MoveForwardPlus()
  2383.     CheckForEverything()
  2384.     PlaceDownPlus(3)
  2385.    
  2386.     TurnRightPlus()
  2387.     MoveForwardPlus()
  2388.     CheckForEverything()
  2389.     TurnRightPlus()
  2390.    
  2391.     CheckForEverything()
  2392.     PlaceDownPlus(7)
  2393.     CheckForEverything()
  2394.     MoveForwardPlus()
  2395.     CheckForEverything()
  2396.     MoveForwardPlus()
  2397.     CheckForEverything()
  2398.     MoveForwardPlus()
  2399.     CheckForEverything()
  2400.     MoveForwardPlus()
  2401.     CheckForEverything()
  2402.     MoveForwardPlus()
  2403.     CheckForEverything()
  2404.     MoveForwardPlus()
  2405.     CheckForEverything()
  2406.     PlaceDownPlus(7)
  2407.    
  2408.     CheckForEverything()
  2409.     MoveForwardPlus()
  2410.     CheckForEverything()
  2411.     MoveDownPlus()
  2412.     CheckForEverything()
  2413.     MoveDownPlus()
  2414.     CheckForEverything()
  2415.     MoveDownPlus()
  2416.     CheckForEverything()
  2417.     MoveDownPlus()
  2418.     CheckForEverything()
  2419.     MoveDownPlus()
  2420.     CheckForEverything()
  2421.     MoveDownPlus()
  2422.    
  2423.     TurnLeftPlus()
  2424.     MoveForwardPlus()
  2425.     CheckForEverything()
  2426.     TurnLeftPlus()
  2427.    
  2428.     MoveForwardPlus()
  2429.     CheckForEverything()
  2430.     MoveForwardPlus()
  2431.     CheckForEverything()
  2432. end
  2433. function CreateLongPiece()
  2434.     CreateLongPieceLayer1()
  2435.     CreateLongPieceLayer2()
  2436.     CreateLongPieceLayer3()
  2437.     CreateLongPieceLayer4()
  2438.     CreateLongPieceLayer5()
  2439.     CreateLongPieceLayer6()
  2440.     CreateLongPieceLayer7()
  2441. end
  2442.  
  2443. function MoveIntoCornerPosition()
  2444.    
  2445.     TurnRightPlus()
  2446.     MoveForwardPlus()
  2447.     CheckForEverything()
  2448.     MoveForwardPlus()
  2449.     CheckForEverything()
  2450.     MoveForwardPlus()
  2451.     CheckForEverything()
  2452.     MoveForwardPlus()
  2453.     CheckForEverything()
  2454.     MoveForwardPlus()
  2455.     CheckForEverything()
  2456.     TurnLeftPlus()
  2457.     TurnLeftPlus()
  2458. end
  2459.  
  2460.  
  2461. print("\nMake sure this turtle is placed in the bottom-left corner of the wall!\n")
  2462. sleep(2)
  2463. print("Ready to create some Walls?!?\n")
  2464. sleep(1)
  2465. print("The turtle will start two blocks out from here.\n")
  2466. sleep(1)
  2467. print("How many Sub-Sections Right is this wall? (6 blocks per sub-section)")
  2468. Width = io.read()
  2469. print("How many Sub-Sections Forward is this wall? (6 blocks per sub-section)")
  2470. Length = io.read()
  2471.  
  2472. TotalWidth = tonumber(Width)
  2473. TotalLength = tonumber(Length)
  2474.  
  2475. if TotalWidth < 2 then
  2476.     print("Not enough sub-sections Right.")
  2477. elseif TotalLength < 2 then
  2478.     print("Not enough sub-sections Forward.")
  2479. else
  2480.     -- Run program
  2481.     CheckForEverything()
  2482.     MoveForwardPlus()
  2483.     CheckForEverything()
  2484.     MoveForwardPlus()
  2485.    
  2486.     CurrentSubWidth = 0;
  2487.     CreateCorner()
  2488.     CurrentSubWidth = CurrentSubWidth + 1
  2489.    
  2490.     while (CurrentSubWidth ~= TotalWidth - 1) do
  2491.         CreateLongPiece()
  2492.         CurrentSubWidth = CurrentSubWidth + 1
  2493.     end
  2494.    
  2495.     MoveIntoCornerPosition()
  2496.     CurrentSubLength = 0;
  2497.     CreateCorner()
  2498.     CurrentSubLength = CurrentSubLength + 1
  2499.    
  2500.     while (CurrentSubLength ~= TotalLength - 1) do
  2501.         CreateLongPiece()
  2502.         CurrentSubLength = CurrentSubLength + 1
  2503.     end
  2504.    
  2505.     MoveIntoCornerPosition()
  2506.     CurrentSubWidth = 0;
  2507.     CreateCorner()
  2508.     CurrentSubWidth = CurrentSubWidth + 1
  2509.    
  2510.     while (CurrentSubWidth ~= TotalWidth - 1) do
  2511.         CreateLongPiece()
  2512.         CurrentSubWidth = CurrentSubWidth + 1
  2513.     end
  2514.    
  2515.     MoveIntoCornerPosition()
  2516.     CurrentSubLength = 0;
  2517.     CreateCorner()
  2518.     CurrentSubLength = CurrentSubLength + 1
  2519.    
  2520.     while (CurrentSubLength ~= TotalLength - 1) do
  2521.         CreateLongPiece()
  2522.         CurrentSubLength = CurrentSubLength + 1
  2523.     end
  2524.    
  2525.     MoveBackPlus()
  2526.     CheckForEverything()
  2527.     PlacePlus(3)
  2528.    
  2529.     print("Program Finished: Enjoy your new wall!")
  2530. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement