Advertisement
Guest User

mc turtle farm portion-5

a guest
Mar 24th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.33 KB | None | 0 0
  1. function bankRight()
  2. turtle.turnRight()
  3. turtle.forward()
  4. turtle.turnRight()
  5. end
  6.  
  7. function bankLeft()
  8. turtle.turnLeft()
  9. turtle.forward()
  10. turtle.turnLeft()
  11. end
  12.  
  13. function plant()
  14. turtle.digDown()
  15. turtle.select(1)
  16. turtle.placeDown(1)
  17. end
  18.  
  19. local numberInSlot
  20. function allButOne(slotNum)
  21. turtle.select(slotNum)
  22. numberInSlot = turtle.getItemCount(slotNum)
  23. turtle.dropDown(numberInSlot - 1)
  24. end
  25.  
  26. local slotsDone
  27. function pootis()
  28. print("Putting wheat away")
  29. for slotsDone = 9, 16 do
  30. allButOne(slotsDone)
  31. sleep(1)
  32. end
  33. turtle.turnRight()
  34. turtle.up()
  35. turtle.up()
  36. turtle.forward()
  37. turtle.forward()
  38. print("Putting seeds away... lol")
  39. for slotsDone = 1, 8 do
  40. allButOne(slotsDone)
  41. sleep(1)
  42. end
  43. turtle.back()
  44. turtle.back()
  45. turtle.down()
  46. turtle.down()
  47. turtle.turnLeft()
  48. end
  49.  
  50. function stackSeeds()
  51. for seedSlot = 1, 8 do
  52. turtle.select(seedSlot)
  53. turtle.transferTo(8)
  54. sleep(1)
  55. end
  56. end
  57.  
  58. function stackWheat()
  59. for wheatSlot = 9, 16 do
  60. turtle.select(wheatSlot)
  61. turtle.transferTo(16)
  62. sleep(1)
  63. end
  64. end
  65.  
  66. function unStackSeeds()
  67. for seedSlot = 1, 8 do
  68. turtle.select(8)
  69. turtle.transferTo(seedSlot, 1)
  70. sleep(1)
  71. end
  72. end
  73.  
  74. function unStackWheat()
  75. for wheatSlot = 9, 16 do
  76. turtle.select(16)
  77. turtle.transferTo(wheatSlot, 1)
  78. sleep(1)
  79. end
  80. end
  81.  
  82. function jobDone()
  83. turtle.forward()
  84. turtle.turnLeft()
  85. turtle.back()
  86. turtle.back()
  87. turtle.back()
  88. turtle.back()
  89. turtle.back()
  90. turtle.back()
  91. pootis()
  92. turtle.back()
  93. turtle.turnRight()
  94. turtle.back()
  95. turtle.turnLeft()
  96.  
  97. print("Cleaning up inventory")
  98. stackSeeds()
  99. stackWheat()
  100.  
  101. turtle.select(1)
  102.  
  103. end
  104.  
  105.  
  106. print("Farmin'")
  107.  
  108. unStackSeeds()
  109. unStackWheat()
  110.  
  111. turtle.turnRight()
  112. turtle.forward()
  113. turtle.turnLeft()
  114. turtle.forward()
  115. turtle.forward()
  116. turtle.turnLeft()
  117.  
  118.  
  119. for row = 1, 8 do
  120. plant()
  121. turtle.forward()
  122. end
  123. plant()
  124.  
  125. bankRight()
  126. for row = 1, 8 do
  127. plant()
  128. turtle.forward()
  129. end
  130. plant()
  131.  
  132. bankLeft()
  133. for row = 1, 8 do
  134. plant()
  135. turtle.forward()
  136. end
  137. plant()
  138.  
  139. bankRight()
  140. for row = 1, 8 do
  141. plant()
  142. turtle.forward()
  143. end
  144. plant()
  145.  
  146. bankLeft()
  147. for row = 1, 8 do
  148. plant()
  149. turtle.forward()
  150. end
  151. plant()
  152.  
  153. bankRight()
  154. for row = 1, 8 do
  155. plant()
  156. turtle.forward()
  157. end
  158. plant()
  159.  
  160. jobDone()
  161.  
  162. print("Done farming.")
  163. sleep(4)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement