Advertisement
Guest User

starfort

a guest
Apr 6th, 2020
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 32.31 KB | None | 0 0
  1. --Setup
  2.  
  3. turtle.select(2)
  4.  
  5. --Vars
  6.  
  7. x = 0 --Position in the x cord, read north south
  8. y = 0 --Position in the y cord, read up down
  9. z = 0 --Position in the z cord, read east west
  10. faceing = "east" --starting faceing
  11. reload = "up" -- use for refuel call in as invPos var
  12. cB = "cobble" -- starting block type, updated in the restock function
  13.  
  14. --used Vars
  15.  
  16. --slot - used to donate the active
  17. --       placement slot in refule()
  18. --dist - used to donate how far the
  19. --       the turtle moves in movment
  20. --       functions.
  21. --block- type of block you want to use
  22. --len  - length of a line used in line
  23. --       function
  24. --hight- used in walls and towers
  25. --       functions to get the hight of
  26. --       the structure
  27. --Width- used in the floor function
  28.  
  29. --Functions
  30.  
  31. function refuel()
  32. --refules the turtle.
  33.  
  34.   if turtle.getFuelLevel() == 0 then
  35.     slot = turtle.getSelectedSlot()
  36.     turtle.select(1)
  37.     turtle.refuel()
  38.     turtle.select(slot)
  39.     restock("fuel","reload",1)
  40.   end
  41. end
  42.  
  43. function forward(dist)
  44. --Moves the turtle forward by b while
  45. --keeping track of position relative
  46. --to start
  47.   if dist == nill then
  48.     dist = 1
  49.   end
  50.   if turtle.detect() == false then
  51.     if faceing == "north" then
  52.       for i=1,dist do
  53.         refuel()
  54.         x = x+1
  55.         turtle.forward()
  56.       end
  57.     elseif faceing == "south" then
  58.       for i=1,dist do
  59.         refuel()
  60.         x = x-1
  61.         turtle.forward()
  62.       end
  63.     elseif faceing == "east" then
  64.       for i=1,dist do
  65.         refuel()
  66.         z = z+1
  67.         turtle.forward()
  68.       end
  69.     elseif faceing == "west" then
  70.       for i=1,dist do
  71.         refuel()
  72.         z = z-1
  73.         turtle.forward()
  74.       end
  75.     end
  76.   else
  77.   print("Obsturcted")
  78.   end
  79. end
  80.  
  81. function back(dist)
  82. --Moves the turtle back by b, keeping
  83. --track of its position relative to
  84. --start
  85.   if dist == nill then
  86.     dist = 1
  87.   end
  88.  
  89.   if faceing == "north" then
  90.     for i=1,dist do
  91.       refuel()
  92.       x = x-1
  93.       turtle.back()
  94.     end
  95.   elseif faceing == "south" then
  96.     for i=1,dist do
  97.       refuel()
  98.       x = x+1
  99.       turtle.back()
  100.     end
  101.   elseif faceing == "east" then
  102.     for i=1,dist do
  103.       refuel()
  104.       z = z-1
  105.       turtle.back()
  106.     end
  107.   elseif faceing == "south" then
  108.     for i=1,dist do
  109.       refuel()
  110.       z = z+1
  111.       turtle.back()
  112.     end
  113.   end
  114. end
  115.  
  116.  
  117. function up(dist)
  118. --moves the turtle up while keeping
  119. --track of y value
  120.   if dist == nill then
  121.     dist = 1
  122.   end
  123.   for i=1,dist do
  124.     refuel()
  125.     y = y+1
  126.     turtle.up()
  127.   end
  128. end
  129.  
  130. function down(dist)
  131. --moves turtle down while keeping track
  132. --of y vaule
  133.   if dist == nill then
  134.     dist = 1
  135.   end
  136.   for i=1,dist do
  137.     refuel()
  138.     y = y-1
  139.     turtle.down()
  140.   end
  141. end
  142.  
  143.  
  144. function left(dist)
  145. --turns turtle left keeping track of
  146. --faceing turning dist times
  147.   if dist == nill then
  148.     dist = 1
  149.   end
  150.   for i=1,dist do
  151.     if faceing == "north" then
  152.       turtle.turnLeft()
  153.       faceing = "west"
  154.     elseif faceing == "west" then
  155.       turtle.turnLeft()
  156.       faceing = "south"
  157.     elseif faceing == "south" then
  158.       turtle.turnLeft()
  159.       faceing = "east"
  160.     elseif faceing == "east" then
  161.       turtle.turnLeft()
  162.       faceing = "north"
  163.     end
  164.   end
  165. end
  166.  
  167. function right(dist)
  168. -- Turns the turtle right while keeping
  169. -- track of the faceing, turns dist
  170. -- times
  171.   if dist == nill then
  172.     dist = 1
  173.   end
  174.   for i=1,dist do
  175.     if faceing == "north" then
  176.       turtle.turnRight()
  177.       faceing = "east"
  178.     elseif faceing == "east" then
  179.       turtle.turnRight()
  180.       faceing = "south"
  181.     elseif faceing == "south" then
  182.       turtle.turnRight()
  183.       faceing = "west"
  184.     elseif faceing == "west" then
  185.       turtle.turnRight()
  186.       faceing = "north"
  187.     end
  188.   end
  189. end
  190.  
  191. function north()
  192. -- rotates turtle left till faceing is
  193. -- north
  194.   while faceing ~= "north" do
  195.     left()
  196.   end
  197. end
  198.  
  199. function east()
  200. --rotates turtle left untill faceing is
  201. -- east
  202.   while faceing ~= "east" do
  203.     left()
  204.   end
  205. end
  206.  
  207. function south()
  208. -- rotates turtle left untill faceing
  209. -- is south
  210.   while faceing ~= "south" do
  211.     left()
  212.   end
  213. end
  214.  
  215. function west()
  216. -- rotates turtle left untill faceing
  217. -- is west
  218.   while faceing ~= "west" do
  219.     left()
  220.   end
  221. end
  222.  
  223. function suckUp(noStack)
  224. --fills turtle inventory with item from
  225. --inventry above
  226.   turtle.select(2)
  227.   for i=1,noStack do
  228.     turtle.suckUp()
  229.   end
  230. end
  231.  
  232. function suck(noStack)
  233. --fills turtle inventory with item from
  234. --inventory forward
  235.   turtle.select(2)
  236.   for i=1,noStack do
  237.     turtle.suck()
  238.   end
  239. end
  240.  
  241. function suckDown(noStack)
  242. --fills turtle inventory with item from
  243. --inventory below
  244.   turtle.select(2)
  245.   for i=1,noStack do
  246.     turtle.suckDown()
  247.   end
  248. end
  249.  
  250.  
  251. function restock(block,invPos,stackNo)
  252. -- Move the turtle back to the starting
  253. -- position, then empties the turtles
  254. -- currant inventory and restocks on
  255. -- block. invPos indicates the direction
  256. -- of target inventory.stackNo is the
  257. -- number of stacks to restock.
  258.   if block == nill then
  259.     block = "cobble"
  260.   end
  261.   if invPos == nill then
  262.     invPos = "forward"
  263.   end
  264.   if stackNo == nill then
  265.     stackNo = 1
  266.   end
  267.  
  268. -- Vars of currant position
  269.   x1 = x
  270.   y1 = y
  271.   z1 = z
  272.   faceing1 = faceing
  273.  
  274.   print(x.." - "..x1)
  275.   print(y.." - "..y1)
  276.   print(z.." - "..z1)
  277.  
  278.  
  279. -- Moveing to starting position
  280.   while x~=0 or y~=0 or z~=0 do
  281. --  print("Moveing to Start")
  282.     if y > 0 then
  283. --      print("Moveing down")
  284.       for i=1,math.abs(y) do
  285.         down(1)
  286.       end
  287.     elseif y < 0 then
  288. --      print("Moveing up")
  289.       for i=1,math.abs(y) do
  290.         up(1)
  291.       end
  292.     end
  293.     if z > 0 then
  294. --      print("Moveing West")
  295.       west()
  296.       for i=1,math.abs(z) do
  297.         forward(1)
  298.       end
  299.     elseif z < 0 then
  300. --      print("Moveing East")
  301.       east()
  302.       for i=1,math.abs(z) do
  303.         forward(1)
  304.       end
  305.     end  
  306.     if x > 0 then
  307. --      print("Moveing South")
  308.       south()
  309.       for i=1,math.abs(x) do
  310.         forward(1)
  311.       end
  312.     elseif x < 0 then
  313. --      print("Moveing North")
  314.       north()
  315.       for i=1,math.abs(x) do
  316.         print(x)
  317.         forward(1)
  318.       end
  319.     end
  320.   end
  321.    
  322. -- emptying inventory if needed block
  323. -- is not fuel
  324.   if block ~= "fuel" then
  325.     turtle.select(2)
  326.     slot = turtle.getSelectedSlot()
  327.     if invPos == "up" then
  328.       for i=1,15 do
  329.         turtle.dropUp()
  330.         if slot < 16 then
  331.           turtle.select(slot+1)
  332.           slot = turtle.getSelectedSlot()
  333.         else
  334.           turtle.select(2)
  335.         end
  336.       end
  337.     elseif invPos == "down" then
  338.       for i=1,15 do
  339.         turtle.dropDown()
  340.         if slot < 16 then
  341.           turtle.select(slot+1)
  342.           slot = turtle.getSelectedSlot()
  343.         else
  344.           turtle.select(2)
  345.         end
  346.       end
  347.     elseif invPos == "forward" then
  348.       for i=1,15 do
  349.         turtle.drop()
  350.         if slot < 16 then
  351.           turtle.select(slot+1)
  352.           slot = turtle.getSelectedSlot()
  353.         else
  354.           turtle.select(2)
  355.         end
  356.       end
  357.     end
  358.   end
  359.  
  360. -- restocking requited item
  361.   if block == "fuel" then
  362.     if invPos == "up" then
  363.       turtle.suckUp()
  364.     elseif invPos == "down" then
  365.       turtle.suckDown()
  366.     elseif invPos == "forward" then
  367.       turtle.suck()
  368.     end
  369.   elseif block == "quartz" then
  370.     north()
  371.     forward(1)
  372.     if invPos == "up" then
  373.       suckUp(stackNo)
  374.     elseif invPos == "down" then
  375.       suckDown(stackNo)
  376.     elseif invPos == "forward" then
  377.       suck(stackNo)
  378.     end
  379.     cB = "quartz"
  380.     back(1)
  381.   elseif block == "cobble" then
  382.     north()
  383.     forward(2)
  384.     if invPos == "up" then
  385.       suckUp(stackNo)
  386.     elseif invPos == "forward" then
  387.       suck(stackNo)
  388.     elseif invPos == "down" then
  389.       suckDown(stackNo)
  390.     end
  391.     cB = "cobble"
  392.     back(2)
  393.   elseif block == "fQuartz" then
  394.     north()
  395.     forward(3)
  396.     if invPos == "up" then
  397.       suckUp(stackNo)
  398.     elseif invPos == "down" then
  399.       suckDown(stackNo)
  400.     elseif invPos == "forward" then
  401.       suck(stackNo)
  402.     end
  403.     cB = "fQuartz"
  404.     back (3)
  405.   elseif block == "cQuartz" then
  406.     north()
  407.     forward(4)
  408.     if invPos == "up" then
  409.       suckUp(stackNo)
  410.     elseif invPos == "down" then
  411.       suckDown(StackNo)
  412.     elseif invPos == "forward" then
  413.       suck(StackNo)
  414.     end
  415.     cB = "cQuartz"
  416.     back(4)
  417.   end
  418. -- Move the turtle back to its working
  419. -- position.
  420.  
  421.   while x~=x1 or y~=y1 or z~=z1 do
  422.     if x1 < 0 then
  423.       south()
  424.       for i=1,math.abs(x1) do
  425.         forward(1)
  426.       end
  427.     elseif x1>0 then
  428.       north()
  429.       for i=1,math.abs(x1) do
  430.         forward(1)
  431.       end
  432.     end
  433.     if z1 > 0 then
  434.       east()
  435.       for i=1,math.abs(z1) do
  436.         forward(1)
  437.       end
  438.     elseif z1 < 0 then
  439.       west()
  440.       for i=1,math.abs(z1) do
  441.         forward(1)
  442.       end
  443.     end
  444.     if y1 < 0 then
  445.       for i=1,math.abs(y1) do
  446.         down(1)
  447.       end
  448.     elseif y1 > 0 then
  449.       for i=1,math.abs(y1) do
  450.         up(1)
  451.       end
  452.     end
  453.     while faceing ~= faceing1 do
  454.         left()
  455.     end
  456.   end
  457. end
  458.  
  459. function goHome()
  460. -- Moveing to starting position
  461.   while x~=0 or y~=0 or z~=0 do
  462. --  print("Moveing to Start")
  463.     if y > 0 then
  464. --      print("Moveing down")
  465.       for i=1,math.abs(y) do
  466.         down(1)
  467.       end
  468.     elseif y < 0 then
  469. --      print("Moveing up")
  470.       for i=1,math.abs(y) do
  471.         up(1)
  472.       end
  473.     end
  474.     if z > 0 then
  475. --      print("Moveing West")
  476.       west()
  477.       for i=1,math.abs(z) do
  478.         forward(1)
  479.       end
  480.     elseif z < 0 then
  481. --      print("Moveing East")
  482.       east()
  483.       for i=1,math.abs(z) do
  484.         forward(1)
  485.       end
  486.     end  
  487.     if x > 0 then
  488. --      print("Moveing South")
  489.       south()
  490.       for i=1,math.abs(x) do
  491.         forward(1)
  492.       end
  493.     elseif x < 0 then
  494. --      print("Moveing North")
  495.       north()
  496.       for i=1,math.abs(x) do
  497.         print(x)
  498.         forward(1)
  499.       end
  500.     end
  501.   end
  502.   north()
  503. end
  504.  
  505. function placeDown(block)
  506. --places spcifyed block below turtle.
  507.   if block == cB then
  508.     while turtle.getItemCount() == 0 do
  509.       slot = turtle.getSelectedSlot()
  510.       if slot ~= 16 then
  511.         turtle.select(slot+1)
  512.       else
  513.         turtle.select(2)
  514.         restock(block,reload,15)
  515.       end
  516.     end
  517.     turtle.placeDown()
  518.     else
  519.     restock(block,reload,15)
  520.     turtle.placeDown()
  521.   end
  522. end
  523.  
  524. function placeUp(block)
  525. --places block above turtle.
  526.   if block == cB then
  527.     slot = turtle.getSelectedSlot()
  528.     while turtle.getItemCount() == 0 do
  529.       if slot == 16 then
  530.         turtle.select(2)
  531.         restock(block,reload,15)
  532.       else
  533.         turtle.select(slot+1)
  534.       end
  535.     end  
  536.     turtle.placeUp()
  537.   else
  538.     restock(block,reload,15)
  539.     turtle.placeUp()
  540.   end
  541. end
  542.  
  543. function place(block)
  544. -- places block infrount of turtle.
  545.   print(block)
  546.   if block == cB then
  547.     slot = turtle.getSelectedSlot()
  548.     while turtle.getItemCount() == 0 do
  549.       if slot == 16 then
  550.         turtle.select(2)
  551.         restock(block,reload,15)
  552.       else
  553.         turtle.select(slot+1)
  554.       end
  555.     end
  556.     turtle.place()
  557.   else
  558.     restock(block,reload,15)
  559.   end
  560. end
  561.  
  562. function lineUp(block,len)
  563. --places a line of blocks with a length
  564. --of len above the turtle.
  565.   for i=1,len do
  566.     forward()
  567.     placeUp(block)
  568.   end
  569. end
  570.  
  571. function lineDown(block,len)
  572. --places a line of blocks with a length
  573. --of len below the turtle.
  574.   for i=1,len do
  575.     forward()
  576.     placeDown(block)
  577.   end
  578. end
  579.  
  580. function line(block,len,direction)
  581. --places a line of blocks with a length
  582. --of len infront of the turtle,
  583. --In direction of direction.
  584.   if direction == "north" then
  585.     for i=1,len do
  586.       west()
  587.       place(block)
  588.       north()
  589.       forward()
  590.     end
  591.   elseif direction == "west" then
  592.     for i=1,len do
  593.       south()
  594.       place(block)
  595.       west()
  596.       forward()
  597.     end
  598.   elseif direction == "south" then
  599.     for i=1,len do
  600.       east()
  601.       place(block)
  602.       south()
  603.       forward()
  604.     end
  605.   elseif direction == "east" then
  606.     for i=1,len do
  607.       north()
  608.       place(block)
  609.       east()
  610.       forward()
  611.     end
  612.   end
  613. end
  614.  
  615. function wallDown(block,len,hight)
  616. -- Builds a wall with blocks placed
  617. -- below the turtle.
  618.   for i=1,hight do
  619.     up()
  620.     placeDown(block)
  621.     lineDown(block,len)
  622.   end
  623. end
  624.  
  625. function wallUp(block,len,hight)
  626. -- Builds a wall with blocks placed
  627. -- above the turtle.
  628.   for i=1,hight do
  629.     down()
  630.     placeUp(block)
  631.     lineUp(block,len)
  632.   end
  633. end
  634.  
  635. function wall(block,len,direction,hight)
  636. -- Builds a wall in stated direction
  637. -- in frount of the turtle.
  638.   for i=1,hight do
  639.     up()
  640.     place(block)
  641.     line(block,len,direction)
  642.   end
  643. end
  644.  
  645. function diagDLL(block,len)
  646. -- Places a diaginal line of blocks
  647. -- going to the left form the point
  648. -- of view of the turtle.
  649. -- Blocks go below the turtle.
  650.   for i=1,len do
  651.     placeDown(block)
  652.     forward()
  653.     left()
  654.     forward()
  655.     right()
  656.   end
  657. end
  658.  
  659. function diagDLR(block,len)
  660. -- Places a diaginal line of blocks
  661. -- going right form the point of view
  662. -- of the turtle.
  663. -- Blocks placed below the turtle.
  664.   for i=1,len do
  665.     placeDown(block)
  666.     forward()
  667.     right()
  668.     forward()
  669.     left()
  670.   end
  671. end
  672.  
  673. function diagULL(block,len)
  674. -- Places a diaginal line of blocks
  675. -- left from the point of view of the
  676. -- turtle. Blocks go above the turtle.
  677.   for i=1,len do
  678.     placeUp(block)
  679.     forward()
  680.     left()
  681.     forward()
  682.     right()
  683.   end
  684. end
  685.  
  686. function diagULR(block,len)
  687. -- Places a diaginal line of blocks
  688. -- right from the point of view of the
  689. -- turtle. Blocks go above the turtle.
  690.   for i=1,len do
  691.     placeUp(block)
  692.     forward()
  693.     right()
  694.     forward()
  695.     left()
  696.   end
  697. end
  698.  
  699. function diagWallUpLeft(block,len,hight)
  700. --builds a diaginal wall going left
  701. --from the point of view of the turtle,
  702. --blocks go above the turtle.
  703.   for i =1,hight do
  704.     diagULL(block,len)
  705.     down()
  706.   end
  707. end
  708.  
  709. function diagWallUpRight(block,len,hight)
  710. -- builds a diaginal wall going right
  711. --from the point of view of the turtle,
  712. --blocks go above the turtle.
  713.   for i =1,hight do
  714.     diagULR(block,len)
  715.     down()
  716.   end
  717. end
  718.  
  719. function diagWallDownLeft(block,len,hight)
  720. -- builds a diaginal wall going left
  721. -- from the point of view of the turtle,
  722. -- blocks go below the turtle.
  723.   for i=1,hight do
  724.     diagDLL(block,len)
  725.     up()
  726.   end
  727. end
  728.  
  729. function diagWallDownRight(block,len,hight)
  730. -- builds a diaginal wall going right
  731. -- from the poitn of view of the turtle
  732. -- blocks go below the turtle.
  733.   for i=1, hight do
  734.     diagDLR(block,len)
  735.     up()
  736.   end
  737. end
  738.  
  739. function diagFLL(block,len)
  740. -- places a diagingal line infront of
  741. -- the turtle going left.
  742.   for i = 1, len do
  743.     place(block)
  744.     left()
  745.     forward()
  746.     right()
  747.     forward()
  748.   end
  749. end
  750.  
  751. function diagFLR(block,len)
  752. -- see above but going right.
  753.   for i=1,len do
  754.     place(block)
  755.     right()
  756.     forward()
  757.     left()
  758.     forward()
  759.   end
  760. end
  761.  
  762. function diagWallLeft(block,len,hight)
  763. --builds a diagnial wall left infront
  764. --of the turtle
  765.   for i=1,hight do
  766.     diagFLL(block,len)
  767.     up()
  768.   end
  769. end
  770.  
  771. function diagWallRight(block,len,hight)
  772. --builds a diagnial wall right infront
  773. --of the turtle.
  774.   for i=1,hight do
  775.     diagFLR(block,len)
  776.     up()
  777.   end
  778. end
  779.  
  780. function towerUp(block,len,hight)
  781. -- Builds a tower, with sides equal
  782. -- to len and hight tall.
  783. -- Blocks placed above the turtle.
  784.   for i=1, hight do
  785.     for i =1,4 do
  786.       lineUp(block,len-1)
  787.       left()
  788.     end
  789.     down()
  790.   end
  791. end
  792.  
  793. function towerDown(block,len,hight)
  794. -- Builds a tower with sides len and
  795. -- hight hight, blocks go below the
  796. -- turtle
  797.   for i = 1, hight do
  798.     for i=1,4 do
  799.       lineDown(block,len-1)
  800.       left()
  801.     end
  802.     up()
  803.   end
  804. end
  805.  
  806. function floorD(block,len,width)
  807. -- makes a floor with length of len
  808. -- and a width of width in a west
  809. -- drirection. Blocks go below the
  810. --turtle
  811.   up()
  812.   i=0
  813.   for i=0,width-1 do
  814.     placeDown(block)
  815.     lineDown(block,len-1)
  816.     if faceing == "north" then
  817.       west()
  818.       forward()
  819.       south()
  820.     elseif faceing == "south" then
  821.       west()
  822.       forward()
  823.       north()
  824.     end
  825.   end
  826. end
  827.  
  828. function sideTurnL()
  829.     left()
  830.     forward()
  831.     left()
  832. end
  833.  
  834. function sideTurnR()
  835.     right()
  836.     forward()
  837.     right()
  838. end
  839.  
  840. function quartzTower()
  841.     placeDown("quartz")
  842.     forward(2)
  843.     placeDown("quartz")
  844.     forward(8)
  845.     placeDown("quartz")
  846.     forward(2)
  847.     placeDown("quartz")
  848. end
  849.  
  850. -- Main Program
  851.  
  852. --loads quartz
  853.  
  854. --restock("quartz","up",15)
  855.  
  856.  
  857. --first level
  858. --builds bace of north towers
  859.  
  860. --forward(152)
  861. --down(116)
  862. --left()
  863. --forward(19)
  864. --left()
  865. --forward(7)
  866. --north()
  867. --down(1)
  868. --floorD("quartz",13,13)
  869. --forward(12)
  870. --left()
  871. --forward(63)
  872. --north()
  873. --down(1)
  874. --floorD("quartz",13,13)
  875.  
  876. --builds bace of west towers
  877.  
  878. --forward(157)
  879. --right()
  880. --forward(170)
  881. --left()
  882. --forward(19)
  883. --left()
  884. --forward(7)
  885. --south()
  886. --down(1)
  887. --floorD("quartz",13,13)
  888. --forward(62)
  889. --right()
  890. --forward(13)
  891. --south()
  892. --down()
  893. --floorD("quartz",13,13)
  894.  
  895. --builds bace of south towers
  896.  
  897. --east()
  898. --forward(158)
  899. --south()
  900. --forward(171)
  901. --left()
  902. --forward(19)
  903. --left()
  904. --forward(7)
  905. --right()
  906. --forward(12)
  907. --south()
  908. --down()
  909. --floorD("quartz",13,13)
  910. --forward(12)
  911. --left()
  912. --forward(37)
  913. --south()
  914. --down()
  915. --floorD("quartz",13,13)
  916.  
  917. --Builds the east tower bace
  918.  
  919. --forward(157)
  920. --right()
  921. --forward(196)
  922. --left()
  923. --forward(19)
  924. --left()
  925. --forward(7)
  926. --right()
  927. --forward(12)
  928. --south()
  929. --down()
  930. --floorD("quartz",13,13)
  931. --south()
  932. --forward(38)
  933. --east()
  934. --forward(13)
  935. --south()
  936. --down()
  937. --floorD("quartz",13,13)
  938.  
  939. --second level
  940.  
  941. --right()
  942. --forward()
  943. --up()
  944.  
  945. --for i=1,4 do
  946. --    towerDown("quartz",13,1)
  947. --    down()
  948. --    left()
  949. --    forward(50)
  950. --    right()
  951. --    towerDown("quartz",13,1)
  952. --    down()
  953. --    left(2)
  954. --    forward(114)
  955. --    right()
  956. --    forward(126)
  957. --end
  958.  
  959. --forward()
  960. --left()
  961. --forward()
  962. --right()
  963. --down()
  964. --floorD("cobble",11,11)
  965. --forward(10)
  966. --right()
  967. --forward(39)
  968. --right()
  969. --down()
  970. --floorD("cobble",11,11)
  971. --forward(126)
  972. --right()
  973. --forward(115)
  974. --down()
  975. --floorD("cobble",11,11)
  976. --forward(10)
  977. --right()
  978. --forward(39)
  979. --right()
  980. --down()
  981. --floorD("cobble",11,11)
  982. --forward(136)
  983. --right()
  984. --forward(115)
  985. --right()
  986. --down()
  987. --floorD("cobble",11,11)
  988. --forward(60)
  989. --left()
  990. --forward(11)
  991. --left()
  992. --down()
  993. --floorD("cobble",11,11)
  994. --left()
  995. --forward(137)
  996. --right()
  997. --forward(126)
  998. --down()
  999. --floorD("cobble",11,11)
  1000. --forward(10)
  1001. --right()
  1002. --forward(61)
  1003. --right()
  1004. --down()
  1005. --floorD("cobble",11,11)
  1006.  
  1007. --layer 3
  1008.  
  1009. --forward(11)
  1010. --left()
  1011. --forward(50)
  1012. --left()
  1013. --up()
  1014.  
  1015. --for i=1,4 do
  1016. --    towerDown("quartz",13,1)
  1017. --    down()
  1018. --    left()
  1019. --    forward(50)
  1020. --    right()
  1021. --    towerDown("quartz",13,1)
  1022. --    down()
  1023. --    left(2)
  1024. --    forward(114)
  1025. --    right()
  1026. --    forward(126)
  1027. --end
  1028.  
  1029. --forward()
  1030. --left()
  1031. --forward()
  1032. --right()
  1033. --for i=1,4 do
  1034. --    towerDown("cobble",11,1)
  1035. --    down()
  1036. --    left()
  1037. --    forward(50)
  1038. --    right()
  1039. --    towerDown("cobble",11,1)
  1040. --    down()
  1041. --    left(2)
  1042. --    forward(116)
  1043. --    right()
  1044. --    forward(126)
  1045. --end
  1046. --forward()
  1047. --left()
  1048. --forward()
  1049. --right()
  1050.  
  1051. --for i=1,4 do
  1052. --    towerDown("cobble",9,1)
  1053. --    down()
  1054. --    left()
  1055. --    forward(50)
  1056. --    right()
  1057. --    towerDown("cobble",9,1)
  1058. --    down()
  1059. --    left(2)
  1060. --    forward(118)
  1061. --    right()
  1062. --    forward(126)
  1063. --end
  1064. --left()
  1065. --forward(7)
  1066. --south()
  1067. --forward()
  1068. --down()
  1069. --floorD("cQuartz",7,7)
  1070. --forward(6)
  1071. --right()
  1072. --forward(57)
  1073. --south()
  1074. --down()
  1075. --floorD("cQuartz",7,7)
  1076. --forward(126)
  1077. --right()
  1078. --forward(133)
  1079. --left()
  1080. --down()
  1081. --floorD("cQuartz",7,7)
  1082. --left()
  1083. --forward(7)
  1084. --left()
  1085. --forward(44)
  1086. --down()
  1087. --floorD("cQuartz",7,7)
  1088. --right()
  1089. --forward(119)
  1090. --right()
  1091. --forward(120)
  1092. --down()
  1093. --floorD("cQuartz",7,7)
  1094. --forward(6)
  1095. --right()
  1096. --forward(43)
  1097. --right()
  1098. --down()
  1099. --floorD("cQuartz",7,7)
  1100. --forward(126)
  1101. --right()
  1102. --forward(119)
  1103. --south()
  1104. --down()
  1105. --floorD("cQuartz",7,7)
  1106. --right()
  1107. --forward(7)
  1108. --right()
  1109. --forward(44)
  1110. --down()
  1111. --floorD("cQuartz",7,7)
  1112. --goHome()
  1113.  
  1114. --layer 4 and 5
  1115.  
  1116. --restock("quartz","up",15)
  1117. --forward(145)
  1118. --right()
  1119. --forward(31)
  1120. --down(113)
  1121. --north()
  1122.  
  1123. --for j=1,2 do
  1124. --    for i=1,4 do
  1125. --        towerDown("quartz",13,1)
  1126. --        down()
  1127. --        left()
  1128. --        forward(50)
  1129. --        right()
  1130. --        towerDown("quartz",13,1)
  1131. --        down()
  1132. --        left(2)
  1133. --        forward(114)
  1134. --        right()
  1135. --        forward(126)
  1136. --    end
  1137. --    forward(2)
  1138. --    left()
  1139. --    forward(2)
  1140. --    right()
  1141. --    for i=1,4 do
  1142. --        towerDown("quartz",9,1)
  1143. --        down()
  1144. --        left()
  1145. --        forward(50)
  1146. --        right()
  1147. --        towerDown("quartz",9,1)
  1148. --        down()
  1149. --        left(2)
  1150. --        forward(118)
  1151. --        right()
  1152. --        forward(126)
  1153. --    end
  1154. --    right()
  1155. --    forward()
  1156. --    right()
  1157. --    forward()
  1158. --    north()
  1159. --    for i=1,4 do
  1160. --        towerDown("cobble",11,1)
  1161. --        down()
  1162. --        left()
  1163. --        forward(50)
  1164. --        right()
  1165. --        towerDown("cobble",11,1)
  1166. --        down()
  1167. --        left(2)
  1168. --        forward(116)
  1169. --        right()
  1170. --        forward(126)
  1171. --    end
  1172. --    back()
  1173. --    right()
  1174. --    forward()
  1175. --    left()
  1176. --    up()
  1177. --end
  1178.            
  1179. --goHome()
  1180.  
  1181. --layer 6
  1182.  
  1183. --restock("quartz","up",15)
  1184. --forward(157)
  1185. --right()
  1186. --forward(31)
  1187. --down(111)
  1188. --east()
  1189. --forward()
  1190. --west()
  1191. --lineDown("quartz",13)
  1192. --forward(37)
  1193. --lineDown("quartz",13)
  1194. --left()
  1195. --lineDown("quartz",2)
  1196. --left()
  1197. --forward()
  1198. --lineDown("quartz",9)
  1199. --forward(2)
  1200. --right()
  1201. --forward()
  1202. --left(2)
  1203. --lineDown("quartz",2)
  1204. --right()
  1205. --forward(38)
  1206. --left()
  1207. --forward()
  1208. --left(2)
  1209. --lineDown("quartz",2)
  1210. --left()
  1211. --forward()
  1212. --lineDown("quartz",9)
  1213. --forward(2)
  1214. --right()
  1215. --forward()
  1216. --left(2)
  1217. --lineDown("quartz",2)
  1218. --left(2)
  1219. --forward(2)
  1220. --right()
  1221. --for i =1, 3 do
  1222. --    placeDown("quartz")
  1223. --    forward(2)
  1224. --    placeDown("quartz")
  1225. --    forward(8)
  1226. --    placeDown("quartz")
  1227. --    forward(2)
  1228. --    placeDown("quartz")
  1229. --    forward(38)
  1230. --    placeDown("quartz")
  1231. --    forward(2)
  1232. --    placeDown("quartz")
  1233. --    forward(8)
  1234. --    placeDown("quartz")
  1235. --    forward(2)
  1236. --    placeDown("quartz")
  1237. --    if faceing == "west" then
  1238. --        south()
  1239. --        forward()
  1240. --        east()
  1241. --    elseif faceing == "east" then
  1242. --        south()
  1243. --        forward()
  1244. --        west()
  1245. --    end
  1246. --end
  1247. --for i=1,4 do
  1248. --    placeDown("quartz")
  1249. --    forward(2)
  1250. --    placeDown("quartz")
  1251. --    forward(8)
  1252. --    placeDown("quartz")
  1253. --    forward()
  1254. --    lineDown("quartz",39)
  1255. --    forward(2)
  1256. --    placeDown("quartz")
  1257. --    forward(8)
  1258. --    placeDown("quartz")
  1259. --    forward(2)
  1260. --    placeDown("quartz")
  1261. --    if faceing == "west" then
  1262. --        south()
  1263. --        forward()
  1264. --        east()
  1265. --    elseif faceing == "east" then
  1266. --        south()
  1267. --        forward()
  1268. --        west()
  1269. --    end
  1270. --end
  1271. --placeDown("quartz")
  1272. --forward()
  1273. --lineDown("quartz",9)
  1274. --forward()
  1275. --lineDown("quartz",39)
  1276. --forward()
  1277. --lineDown("quartz",9)
  1278. --forward(2)
  1279. --placeDown("quartz")
  1280. --sideTurnR()
  1281. --placeDown("quartz")
  1282. --forward(11)
  1283. --lineDown("quartz",39)
  1284. --forward(12)
  1285. --placeDown("quartz")
  1286. --forward()
  1287. --sideTurnL()
  1288. --lineDown("quartz",63)
  1289. --sideTurnR()
  1290. --forward(10)
  1291. --for i=1,109 do
  1292. --    lineDown("quartz",41)
  1293. --    forward()
  1294. --    if faceing == "east" then
  1295. --        south()
  1296. --        forward()
  1297. --        west()
  1298. --    elseif faceing == "west" then
  1299. --        south()
  1300. --        forward()
  1301. --        east()
  1302. --    end
  1303. --end
  1304. --placeDown("quartz")
  1305. --lineDown("quartz",42)
  1306. --forward(2)
  1307. --sideTurnR()
  1308. --lineDown("quartz",45)
  1309. --forward(2)
  1310. --sideTurnL()
  1311. --lineDown("quartz",47)
  1312. --forward(2)
  1313. --sideTurnR()
  1314. --lineDown("quartz",49)
  1315. --forward(134)
  1316. --sideTurnL()
  1317. --lineDown("quartz",13)
  1318. --forward(119)
  1319. --lineDown("quartz",51)
  1320. --forward(119)
  1321. --lineDown("quartz",13)
  1322. --sideTurnR()
  1323. --placeDown("quartz")
  1324. --forward(12)
  1325. --placeDown("quartz")
  1326. --forward(117)
  1327. --lineDown("quartz",55)
  1328. --forward(118)
  1329. --placeDown("quartz")
  1330. --forward(12)
  1331. --placeDown("quartz")
  1332. --sideTurnL()
  1333. --placeDown("quartz")
  1334. --forward()
  1335. --lineDown("quartz",9)
  1336. --forward(2)
  1337. --placeDown("quartz")
  1338. --forward(116)
  1339. --lineDown("quartz",57)
  1340. --forward(117)
  1341. --placeDown("quartz")
  1342. --forward()
  1343. --lineDown("quartz",9)
  1344. --forward(2)
  1345. --placeDown("quartz")
  1346. --sideTurnR()
  1347. --quartzTower()
  1348. --forward(115)
  1349. --lineDown("quartz",59)
  1350. --forward(116)
  1351. --quartzTower()
  1352. --sideTurnL()
  1353. --for i=1,2 do
  1354. --    quartzTower()
  1355. --    forward(114)
  1356. --    lineDown("quartz",61)
  1357. --    forward(115)
  1358. --    quartzTower()
  1359. --    if faceing == "east" then
  1360. --        sideTurnR()
  1361. --    elseif faceing == "west" then
  1362. --        sideTurnL()
  1363. --    end
  1364. --end
  1365. --for i=1,4 do
  1366. --    quartzTower()
  1367. --    forward(114-i)
  1368. --    lineDown("quartz",(((2*i)+61)))
  1369. --    forward(115-i)
  1370. --    quartzTower()
  1371. --    if faceing == "east" then
  1372. --        sideTurnR()
  1373. --    elseif faceing == "west" then
  1374. --        sideTurnL()
  1375. --    end
  1376. --end
  1377. --placeDown("quartz")
  1378. --forward()
  1379. --lineDown("quartz",9)
  1380. --forward(2)
  1381. --placeDown("quartz")
  1382. --forward(109)
  1383. --lineDown("quartz",71)
  1384. --forward(110)
  1385. --placeDown("quartz")
  1386. --forward()
  1387. --lineDown("quartz",9)
  1388. --forward(2)
  1389. --placeDown("quartz")
  1390. --sideTurnR()
  1391. --placeDown("quartz")
  1392. --forward(11)
  1393. --lineDown("quartz",291)
  1394. --forward(12)
  1395. --placeDown("quartz")
  1396. --forward()
  1397. --sideTurnL()
  1398. --lineDown("quartz",315)
  1399. --sideTurnR()
  1400. --forward(5)
  1401. --for i=1,37 do
  1402. --    lineDown("quartz",303)
  1403. --    forward()
  1404. --    if faceing == "east" then
  1405. --        sideTurnR()
  1406. --    elseif faceing == "west" then
  1407. --        sideTurnL()
  1408. --    end
  1409. --end
  1410. --left(2)
  1411. --forward(6)
  1412. --left(2)
  1413. --lineDown("quartz",315)
  1414. --sideTurnR()
  1415. --placeDown("quartz")
  1416. --forward(11)
  1417. --lineDown("quartz",291)
  1418. --forward(12)
  1419. --placeDown("quartz")
  1420. --sideTurnL()
  1421. --placeDown("quartz")
  1422. --forward()
  1423. --lineDown("quartz",9)
  1424. --forward(2)
  1425. --placeDown("quartz")
  1426. --forward(109)
  1427. --lineDown("quartz",71)
  1428. --forward(110)
  1429. --placeDown("quartz")
  1430. --forward()
  1431. --lineDown("quartz",9)
  1432. --forward(2)
  1433. --placeDown("quartz")
  1434. --sideTurnR()
  1435. --for i=1,4 do
  1436. --    quartzTower()
  1437. --    forward(109+i)
  1438. --    lineDown("quartz",(71-(i*2)))
  1439. --    forward(110+i)
  1440. --    quartzTower()
  1441. --    if faceing == "east" then
  1442. --        sideTurnR()
  1443. --    elseif faceing == "west" then
  1444. --        sideTurnL()
  1445. --    end
  1446. --end
  1447.  
  1448. --for i=1,2 do
  1449. --    quartzTower()
  1450. --    forward(114)
  1451. --    lineDown("quartz",61)
  1452. --    forward(115)
  1453. --    quartzTower()
  1454. --    if faceing == "east" then
  1455. --        sideTurnR()
  1456. --    elseif faceing == "west" then
  1457. --        sideTurnL()
  1458. --    end
  1459. --end
  1460. --quartzTower()
  1461. --forward(115)
  1462. --lineDown("quartz",59)
  1463. --forward(116)
  1464. --quartzTower()
  1465. --sideTurnL()
  1466. --placeDown("quartz")
  1467. --forward()
  1468. --lineDown("quartz",9)
  1469. --forward(2)
  1470. --placeDown("quartz")
  1471. --forward(116)
  1472. --lineDown("quartz",57)
  1473. --forward(117)
  1474. --quartzTower()
  1475. --sideTurnR()
  1476.  
  1477. --placeDown("quartz")
  1478. --forward(12)
  1479. --placeDown("quartz")
  1480. --forward(117)
  1481. --lineDown("quartz",55)
  1482. --forward(118)
  1483. --placeDown("quartz")
  1484. --forward(12)
  1485. --placeDown("quartz")
  1486. --forward()
  1487. --sideTurnL()
  1488. --lineDown("quartz",13)
  1489. --forward(119)
  1490. --lineDown("quartz",51)
  1491. --forward(119)
  1492. --lineDown("quartz",13)
  1493. --sideTurnR()
  1494. --forward(132)
  1495. --for i=1,4 do
  1496. --    lineDown("quartz",(51-(i*2)))
  1497. --    if faceing == "east" then
  1498. --        sideTurnR()
  1499. --    elseif faceing == "west" then
  1500. --        sideTurnL()
  1501. --    end
  1502. --end
  1503. --for i=1,109 do
  1504. --    lineDown("quartz",41)
  1505. --    forward()
  1506. --    if faceing == "east" then
  1507. --        sideTurnR()
  1508. --    elseif faceing == "west" then
  1509. --        sideTurnL()
  1510. --    end
  1511. --end
  1512. --left(2)
  1513. --forward(11)
  1514. --left(2)
  1515. --lineDown("quartz",63)
  1516. --sideTurnR()
  1517. --placeDown("quartz")
  1518. --forward(11)
  1519. --lineDown("quartz",39)
  1520. --forward(12)
  1521. --placeDown("quartz")
  1522. --sideTurnL()
  1523. --placeDown("quartz")
  1524. --forward()
  1525. --lineDown("quartz",9)
  1526. --forward()
  1527. --lineDown("quartz",39)
  1528. --forward()
  1529. --lineDown("quartz",9)
  1530. --forward(2)
  1531. --placeDown("quartz")
  1532. --sideTurnR()
  1533. --for i=1, 4 do
  1534. --    placeDown("quartz")
  1535. --    forward(2)
  1536. --    placeDown("quartz")
  1537. --    forward(8)
  1538. --    placeDown("quartz")
  1539. --    forward()
  1540. --    lineDown("quartz",39)
  1541. --    forward(2)
  1542. --    placeDown("quartz")
  1543. --    forward(8)
  1544. --    placeDown("quartz")
  1545. --    forward(2)
  1546. --    placeDown("quartz")
  1547. --    if faceing == "east" then
  1548. --        sideTurnR()
  1549. --    elseif faceing == "west" then
  1550. --        sideTurnL()
  1551. --    end
  1552. --end
  1553. --for i=1,3 do
  1554. --    quartzTower()
  1555. --    forward(38)
  1556. --    quartzTower()
  1557. --    if faceing == "east" then
  1558. --        sideTurnR()
  1559. --    elseif faceing == "west" then
  1560. --        sideTurnL()
  1561. --    end
  1562. --end
  1563. --placeDown("quartz")
  1564. --forward()
  1565. --lineDown("quartz",9)
  1566. --forward(2)
  1567. --placeDown("quartz")
  1568. --forward(38)
  1569. --placeDown("quartz")
  1570. --forward()
  1571. --lineDown("quartz",9)
  1572. --forward(2)
  1573. --placeDown("quartz")
  1574. --sideTurnR()
  1575. --placeDown("quartz")
  1576. --forward(12)
  1577. --placeDown("quartz")
  1578. --forward(38)
  1579. --placeDown("quartz")
  1580. --forward(12)
  1581. --placeDown("quartz")
  1582. --forward()
  1583. --sideTurnL()
  1584. --lineDown("quartz",13)
  1585. --forward(37)
  1586. --lineDown("quartz",13)
  1587. --left(2)
  1588. --forward(61)
  1589. --right()
  1590. --forward(11)
  1591. --left(2)
  1592. --for i=1,4 do
  1593. --    towerDown("cobble",11,1)
  1594. --    down()
  1595. --    left()
  1596. --    forward(50)
  1597. --    right()
  1598. --    towerDown("cobble",11,1)
  1599. --    down()
  1600. --    left(2)
  1601. --    forward(116)
  1602. --    right()
  1603. --    forward(126)
  1604. --end
  1605.  
  1606. --layer 7    
  1607. --up()
  1608. --right()
  1609. --forward()
  1610. --right()
  1611. --forward()
  1612. --left(2)
  1613. --for i=1,4 do
  1614. --    towerDown("quartz",13,1)
  1615. --    down()
  1616. --    left()
  1617. --    forward(50)
  1618. --    right()
  1619. --    towerDown("quartz",13,1)
  1620. --    down()
  1621. --    left(2)
  1622. --    forward(114)
  1623. --    right()
  1624. --    forward(126)
  1625. --end
  1626. --forward(2)
  1627. --left()
  1628. --forward(2)
  1629. --right()
  1630. --for i=1,4 do
  1631. --    towerDown("quartz",9,1)
  1632. --    down()
  1633. --    left()
  1634. --    forward(50)
  1635. --    right()
  1636. --    towerDown("quartz",9,1)
  1637. --    down()
  1638. --    left(2)
  1639. --    forward(118)
  1640. --    right()
  1641. --    forward(126)
  1642. --end
  1643. --forward(4)
  1644. --left()
  1645. --forward(10)
  1646. --for i=1,4 do
  1647. --    lineDown("quartz",37)
  1648. --    forward(3)
  1649. --    left()
  1650. --    forward(6)
  1651. --    lineDown("quartz",109)
  1652. --    for i=1,5 do
  1653. --        right()
  1654. --        forward()
  1655. --        left()
  1656. --        forward()
  1657. --        placeDown("quartz")
  1658. --    end
  1659. --    right()
  1660. --    forward()
  1661. --    placeDown("quartz")
  1662. --    forward()
  1663. --    left()
  1664. --    forward()
  1665. --    placeDown("quartz")
  1666. --    for i=1,3 do
  1667. --        right()
  1668. --        forward()
  1669. --        left()
  1670. --        forward()
  1671. --        placeDown("quartz")
  1672. --    end
  1673. --    forward()
  1674. --    placeDown("quartz")
  1675. --    for i=1,5 do
  1676. --        right()
  1677. --        forward()
  1678. --        left()
  1679. --        forward()
  1680. --        placeDown("quartz")
  1681. --    end
  1682. --    right()
  1683. --    lineDown("quartz",108)
  1684. --    forward(7)
  1685. --    left()
  1686. --    forward(2)
  1687. --end
  1688. --left(2)
  1689. --forward(11)
  1690. --right()
  1691. --forward(5)
  1692. --left(2)
  1693. --for i=1,4 do
  1694. --    towerDown("cobble",11,1)
  1695. --    down()
  1696. --    left()
  1697. --    forward(50)
  1698. --    right()
  1699. --    towerDown("cobble",11,1)
  1700. --    down()
  1701. --    left(2)
  1702. --    forward(116)
  1703. --    right()
  1704. --    forward(126)
  1705. --end
  1706. --forward(4)
  1707. --left()
  1708. --forward(11)
  1709. --for i=1,6 do
  1710. --    lineDown("cobble",37)
  1711. --    forward()
  1712. --    if faceing == "east" then
  1713. --        sideTurnL()
  1714. --    elseif faceing == "west" then
  1715. --        sideTurnR()
  1716. --    end
  1717. --end
  1718. --left(2)
  1719. --forward(2)
  1720. --left(2)
  1721. --for i=1,109 do
  1722. --    lineDown("cobble",41)
  1723. --    forward()
  1724. --    if faceing == "east" then
  1725. --        sideTurnL()
  1726. --    elseif faceing == "west" then
  1727. --        sideTurnR()
  1728. --    end
  1729. --end
  1730. --left(2)
  1731. --forward()
  1732. --left()
  1733. --for i=1,5 do
  1734. --    lineDown("cobble",(41+(2*i)))
  1735. --    forward(2)
  1736. --    if faceing == "east" then
  1737. --        sideTurnL()
  1738. --    elseif faceing == "west" then
  1739. --        sideTurnR()
  1740. --    end
  1741. --end
  1742. --left(2)
  1743. --forward()
  1744. --left(2)
  1745. --for i=1,4 do
  1746. --    lineDown("cobble",(53+(2*i)))
  1747. --    forward(2)
  1748. --    if faceing == "east" then
  1749. --        sideTurnL()
  1750. --    elseif faceing == "west" then
  1751. --        sideTurnR()
  1752. --    end
  1753. --end
  1754. --for i=1,6 do
  1755. --    lineDown("cobble",(59+(i*2)))
  1756. --    forward(2)
  1757. --    if faceing == "east" then
  1758. --        sideTurnL()
  1759. --    elseif faceing == "west" then
  1760. --        sideTurnR()
  1761. --    end
  1762. --end
  1763. forward(182)
  1764.  
  1765.  
  1766.  
  1767.  
  1768. --goHome()
  1769.  
  1770. --end
  1771. --goHome()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement