Sherco

Untitled

May 25th, 2013
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. height = 0
  2. length = 1
  3. width = 0
  4. fwd = true
  5. rht = true
  6. lft = false
  7. inair = 0
  8. retrn1 = false
  9. retrn2 = false
  10. on = true
  11. drction = 3
  12. turnn = false
  13.  
  14. function chopUp()
  15.   turtle.digUp()
  16.   turtle.up()
  17.   height = height + 1
  18.     if turtle.detectUp == false then
  19.       inair = 1
  20.     end  
  21. end    
  22.  
  23. function dcline()
  24.   turtle.down()
  25.   height = height - 1
  26. end
  27.  
  28. function moveForward()
  29.   turtle.dig()
  30.   turtle.forward()
  31.   turtle.dig()
  32.   turtle.forward()
  33.   turtle.dig()
  34.   turtle.forward()
  35.     if turtle.detectDown()== false then
  36.         turtle.placeDown()
  37.     end
  38.   length= length + drction
  39. end
  40.  
  41. function nextRowLeft()
  42.   turtle.turnLeft()
  43.   turtle.dig()
  44.   turtle.forward()
  45.   turtle.dig()
  46.   turtle.forward()
  47.   turtle.dig()
  48.   turtle.forward()
  49.   turtle.turnLeft()
  50.   turtle.dig()
  51.   turtle.forward()
  52.   length = length + 1
  53.   width = width + 3
  54.   drction = 3
  55.   turnn = false
  56. end
  57.  
  58. function nextRowRight()
  59.   turtle.turnRight()
  60.   turtle.dig()
  61.   turtle.forward()
  62.   turtle.dig()
  63.   turtle.forward()
  64.   turtle.dig()
  65.   turtle.forward()
  66.   turtle.turnRight()
  67.   turtle.forward()
  68.   length = length - 1
  69.   width = width + 3
  70.   drction = -3
  71. end
  72.  
  73. turtle.select(1)
  74.  
  75. while on == true do
  76. if height == 0 then
  77.   moveForward()
  78. elseif
  79. height ~=0 then
  80. turtle.down()
  81. height = height - 1
  82. end
  83.  
  84. while turtle.detectUp()== true do
  85.   turtle.digDown()
  86.   turtle.placeDown()
  87.   chopUp()
  88. end
  89.  
  90. if height == 0 then
  91.   inair = 0
  92. end
  93.  
  94. while inair == 1 do
  95.   dcline()
  96. end
  97.  
  98. while length == 22 do
  99.   nextRowRight()
  100. end
  101.  
  102. while turnn == true do
  103.     nextRowLeft()
  104. end
  105.  
  106. if width == 15 then
  107.     retrn1 = true
  108.     if length == 0 then
  109.         retrn2 = true
  110.     end
  111. end
  112. if retrn1 == false then
  113.   if length == 0 then
  114.     turnn = true
  115.   end
  116. end
  117.  
  118. if retrn2 == true then
  119.     while height ~=0 do
  120.     turtle.down()
  121.     height = height - 1
  122.     end
  123.     if height == 0 then
  124.     turtle.dig()
  125.     turtle.forward()
  126.     length = length - 1
  127.     turtle.turnRight()
  128.         while turtle.getFuelLevel() < 500 do
  129.             turtle.select(15)
  130.             turtle.suckDown()
  131.             sleep(10)
  132.             turtle.refuel()
  133.         end
  134.     turtle.dig()
  135.     turtle.forward()
  136.     width = width - 1
  137.     turtle.dig()
  138.     turtle.forward()
  139.     width = width - 1
  140.     turtle.dig()
  141.     turtle.forward()
  142.     width = width - 1
  143.     turtle.dig()
  144.     turtle.forward()
  145.     width = width - 1
  146.     turtle.dig()
  147.     turtle.forward()
  148.     width = width - 1
  149.     turtle.dig()
  150.     turtle.forward()
  151.     width = width - 1
  152.     turtle.dig()
  153.     turtle.forward()
  154.     width = width - 1
  155.     turtle.dig()
  156.     turtle.forward()
  157.     width = width - 1
  158.     turtle.dig()
  159.     turtle.forward()
  160.     width = width - 1
  161.     turtle.select(2)
  162.     turtle.dropDown(turtle.getItemCount(2))
  163.     turtle.select(3)
  164.     turtle.dropDown(turtle.getItemCount(3))
  165.     turtle.select(4)
  166.     turtle.dropDown(turtle.getItemCount(4))
  167.     turtle.select(5)
  168.     turtle.dropDown(turtle.getItemCount(5))
  169.     turtle.select(6)
  170.     turtle.dropDown(turtle.getItemCount(6))
  171.     turtle.select(7)
  172.     turtle.dropDown(turtle.getItemCount(7))
  173.     turtle.select(8)
  174.     turtle.dropDown(turtle.getItemCount(8))
  175.     turtle.select(9)
  176.     turtle.dropDown(turtle.getItemCount(9))
  177.     turtle.select(10)
  178.     turtle.dropDown(turtle.getItemCount(10))
  179.     turtle.select(11)
  180.     turtle.dropDown(turtle.getItemCount(11))
  181.     turtle.select(12)
  182.     turtle.dropDown(turtle.getItemCount(12))
  183.     turtle.select(13)
  184.     turtle.dropDown(turtle.getItemCount(13))
  185.     turtle.select(14)
  186.     turtle.dropDown(turtle.getItemCount(14))
  187.     turtle.dig()
  188.     turtle.forward()
  189.     width = width - 1
  190.     turtle.dig()
  191.     turtle.forward()
  192.     width = width - 1
  193.     turtle.select(1)
  194.     turtle.suckDown(turtle.getItemSpace(1))
  195.     turtle.dig()
  196.     turtle.forward()
  197.     width = width - 1
  198.     turtle.dig()
  199.     turtle.forward()
  200.     width = width - 1
  201.     turtle.dig()
  202.     turtle.forward()
  203.     width = width - 1
  204.     turtle.dig()
  205.     turtle.forward()
  206.     width = width - 1
  207.     turtle.turnRight()
  208.     turtle.dig()
  209.     turtle.forward()
  210.     length = length + 1
  211.     turtle.dig()
  212.     turtle.forward()
  213.     length = length + 1
  214.     drction = 1
  215.     retrn1 = false
  216.     retrn2 = false
  217.     end
  218. end
  219.  
  220. end
Advertisement
Add Comment
Please, Sign In to add comment