Advertisement
ninja_axiom

TreeHarvest large

Oct 20th, 2013
35
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.40 KB | None | 0 0
  1. function cutTree()
  2.     turtle.select(16)
  3.     height=0
  4.     turtle.dig()
  5.     turtle.forward()
  6.     while turtle.compareUp() do
  7.         turtle.digUp()
  8.         turtle.up()
  9.         height = height+1
  10.     end
  11.     for i=1, height do
  12.         turtle.down()
  13.     end
  14. end
  15.  
  16. function shiftLeft()
  17.     turtle.forward()
  18.     turtle.turnLeft()
  19.     for i=1, 6 do
  20.         turtle.forward()
  21.     end
  22.     turtle.turnLeft()
  23. end
  24.  
  25. function shiftRight()
  26.     turtle.forward()
  27.     turtle.turnRight()
  28.     for i=1, 6 do
  29.         turtle.forward()
  30.     end
  31.     turtle.turnRight()
  32. end
  33.  
  34. function returnHome()
  35.     for i=1, 5 do
  36.         turtle.forward()
  37.     end
  38.     turtle.turnLeft()
  39.     for i=1, 42 do
  40.         turtle.forward()
  41.     end
  42.     turtle.turnLeft()
  43. end
  44.  
  45. function dropGoods()
  46.     turtle.turnRight()
  47.     turtle.turnRight()
  48.     for i=1, 14 do
  49.         turtle.select(i)
  50.         turtle.drop()
  51.     end
  52.     turtle.turnRight()
  53.     turtle.turnRight()
  54. end
  55.  
  56.  
  57. --Main
  58.  
  59.  
  60. for i=1, 4 do   --Staring position
  61.     turtle.forward()
  62. end
  63.  
  64. for r=1, 3 do
  65.     for i=1, 7 do  
  66.         cutTree()
  67.         for j=1, 5 do
  68.             turtle.forward()
  69.         end
  70.     end
  71.     cutTree()
  72.     shiftLeft()
  73.  
  74.     for i=1, 7 do  
  75.         cutTree()
  76.         for j=1, 5 do
  77.             turtle.forward()
  78.         end
  79.     end
  80.     cutTree()
  81.     shiftRight()
  82. end
  83.  
  84. for i=1, 7 do   --Seventh Row
  85.     cutTree()
  86.     for j=0, 5 do
  87.         turtle.forward()
  88.     end
  89. end
  90. cutTree()
  91. shiftLeft()
  92.  
  93. for i=1, 7 do   --eighth Row
  94.     cutTree()
  95.     for j=0, 5 do
  96.         turtle.forward()
  97.     end
  98. end
  99. cutTree()
  100.  
  101.  
  102.  
  103.  
  104. returnHome()    --Return to Starting Position
  105. dropGoods()     --Place items in Chest
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement