Advertisement
bjohnston562

oak tree farm

Jan 10th, 2021 (edited)
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.06 KB | None | 0 0
  1. function pickup() --this moves from tree position and pick up stuff
  2. local i = 1
  3. turtle.turnLeft()
  4. sleep(0.1)
  5. turtle.turnLeft()
  6. sleep(0.1)
  7. turtle.forward()
  8. sleep(0.1)
  9. turtle.forward()
  10. sleep(0.1)
  11. turtle.turnLeft()
  12. sleep(0.1)
  13. turtle.forward()
  14. sleep(0.1)
  15. turtle.forward()
  16. sleep(0.1)
  17. turtle.turnLeft()
  18. sleep(0.1)
  19. while i<6
  20. do
  21. turtle.suck()
  22. sleep(0.1)
  23. turtle.turnLeft()
  24. sleep(0.1)
  25. turtle.forward()
  26. sleep(0.1)
  27. turtle.turnRight()
  28. sleep(0.1)
  29. i = i + 1
  30. end
  31. turtle.forward()
  32. sleep(0.1)
  33. i = 1
  34. while i<6
  35. do
  36. turtle.suck()
  37. sleep(0.1)
  38. turtle.turnRight()
  39. sleep(0.1)
  40. turtle.forward()
  41. sleep(0.1)
  42. turtle.turnLeft()
  43. sleep(0.1)
  44. i = i + 1
  45. end
  46. turtle.forward()
  47. sleep(0.1)
  48. i = 1
  49. while i<6
  50. do
  51. turtle.suck()
  52. sleep(0.1)
  53. turtle.turnLeft()
  54. sleep(0.1)
  55. turtle.forward()
  56. sleep(0.1)
  57. turtle.turnRight()
  58. sleep(0.1)
  59. i = i + 1
  60. end
  61. turtle.forward()
  62. sleep(0.1)
  63. i = 1
  64. while i<6
  65. do
  66. turtle.suck()
  67. sleep(0.1)
  68. turtle.turnRight()
  69. sleep(0.1)
  70. turtle.forward()
  71. sleep(0.1)
  72. turtle.turnLeft()
  73. sleep(0.1)
  74. i = i + 1
  75. end
  76. turtle.forward()
  77. sleep(0.1)
  78. i = 1
  79. while i<6
  80. do
  81. turtle.suck()
  82. sleep(0.1)
  83. turtle.turnLeft()
  84. sleep(0.1)
  85. turtle.forward()
  86. sleep(0.1)
  87. turtle.turnRight()
  88. sleep(0.1)
  89. i = i + 1
  90. end
  91. turtle.turnRight()
  92. sleep(0.1)
  93. turtle.forward()
  94. sleep(0.1)
  95. turtle.forward()
  96. sleep(0.1)
  97. turtle.forward()
  98. sleep(0.1)
  99. turtle.turnRight()
  100. sleep(0.1)
  101. turtle.forward()
  102. sleep(0.1)
  103. turtle.forward()
  104. sleep(0.1)
  105. turtle.turnRight()
  106. sleep(0.1)
  107. turtle.turnRight()
  108. sleep(0.1)
  109. end
  110.  
  111. function drop() -- drops all stuff into inventory
  112. turtle.select(1)
  113. turtle.dropDown()
  114. turtle.select(2)
  115. turtle.dropDown()
  116. turtle.select(3)
  117. turtle.dropDown()
  118. turtle.select(4)
  119. turtle.dropDown()
  120. turtle.select(5)
  121. turtle.dropDown()
  122. turtle.select(6)
  123. turtle.dropDown()
  124. turtle.select(7)
  125. turtle.dropDown()
  126. turtle.select(8)
  127. turtle.dropDown()
  128. turtle.select(9)
  129. turtle.dropDown()
  130. turtle.select(10)
  131. turtle.dropDown()
  132. turtle.select(11)
  133. turtle.dropDown()
  134. turtle.select(12)
  135. turtle.dropDown()
  136. turtle.select(13)
  137. turtle.dropDown()
  138. turtle.select(14)
  139. turtle.dropDown()
  140. turtle.select(15)
  141. turtle.dropDown()
  142. turtle.select(16)
  143. turtle.dropDown()
  144. end
  145.  
  146. function plant()
  147. turtle.select(1)
  148. sleep(0.1)
  149. turtle.suckDown(1)
  150. sleep(0.1)
  151. turtle.place()
  152. end
  153.  
  154. function chop() --chops down tree and returns to starting position
  155. local success, tree = turtle.inspect()
  156. if tree.name == "minecraft:oak_log" then
  157. turtle.dig()
  158. sleep(0.1)
  159. turtle.forward()
  160. sleep(0.1)
  161. turtle.digUp()
  162. sleep(0.1)
  163. turtle.up()
  164. sleep(0.1)
  165. turtle.digUp()
  166. sleep(0.1)
  167. turtle.up()
  168. sleep(0.1)
  169. turtle.digUp()
  170. sleep(0.1)
  171. turtle.up()
  172. sleep(0.1)
  173. turtle.digUp()
  174. sleep(0.1)
  175. turtle.up()
  176. sleep(0.1)
  177. turtle.digUp()
  178. sleep(0.1)
  179. turtle.up()
  180. sleep(0.1)
  181. turtle.digUp()
  182. sleep(0.1)
  183. turtle.down()
  184. sleep(0.1)
  185. turtle.down()
  186. sleep(0.1)
  187. turtle.down()
  188. sleep(0.1)
  189. turtle.down()
  190. sleep(0.1)
  191. turtle.down()
  192. sleep(0.1)
  193. turtle.back()
  194. sleep(0.1)
  195. pickup()
  196. drop()
  197. plant()
  198. end
  199. end
  200.  
  201.  
  202.  
  203. --main part of program
  204. local i = 1
  205. while i == 1 do
  206. chop()
  207. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement