Advertisement
Guest User

Computercraft Wheat Harvest Turtle System

a guest
Sep 27th, 2013
387
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. -- Wheat farming turtle by Razputin
  2. -- Modified and bugfixed by Pugnacious
  3.  
  4. --[Code for the turtle to leave start position and go to farming level]--
  5. function start()
  6. turtle.forward()
  7. turtle.down()
  8. turtle.down()
  9. end
  10.  
  11. --added this function (it was missing) - Pugnacious
  12. function m()
  13. turtle.forward()
  14. end
  15.  
  16. --[Multiple move commands]--
  17. function m7()
  18. m()
  19. m()
  20. m()
  21. m()
  22. m()
  23. m()
  24. m()
  25. end
  26.  
  27. --[Down Command]--
  28. function d()
  29. turtle.down()
  30. end
  31.  
  32. --[Code for the turtle to return toward start position]--
  33. function re()
  34. m7()
  35. turtle.up()
  36. end
  37.  
  38. --[Planting code]--
  39. function p()
  40. turtle.digDown()
  41. turtle.placeDown()
  42. end
  43.  
  44. --[Code for returning turn depending on the 'tray' you end on. Odd/even]--
  45. function rlt()
  46. turtle.turnLeft()
  47. turtle.up()
  48. turtle.up()
  49. end
  50.  
  51. --[Ditto]--
  52. function rrt()
  53. turtle.turnRight()
  54. turtle.up()
  55. turtle.up()
  56. end
  57.  
  58. --[For turning at the end of each row of plots. Odd/even]--
  59. function lt()
  60. turtle.turnLeft()
  61. turtle.forward()
  62. turtle.turnLeft()
  63. end
  64.  
  65. --[Ditto]--
  66. function rt()
  67. turtle.turnRight()
  68. turtle.forward()
  69. turtle.turnRight()
  70. end
  71.  
  72. --[Function for each row of plots]--
  73. function row()
  74. p()
  75. m()
  76. p()
  77. m()
  78. p()
  79. m()
  80. p()
  81. m()
  82. p()
  83. m()
  84. p()
  85. end
  86.  
  87. --['Tray' odd.]--
  88. -- Added a refuel for those of us who require fuel
  89.  
  90. function to()
  91. turtle.refuel()
  92. row()
  93. rt()
  94. row()
  95. lt()
  96. row()
  97. rt()
  98. row()
  99. lt()
  100. row()
  101. rt()
  102. row()
  103. lt()
  104. row()
  105. rt()
  106. d()
  107. end
  108.  
  109. --['Tray' even]--
  110. -- Added a refuel for those of us who require fuel
  111.  
  112. function te()
  113. turtle.refuel()
  114. row()
  115. lt()
  116. row()
  117. rt()
  118. row()
  119. lt()
  120. row()
  121. rt()
  122. row()
  123. lt()
  124. row()
  125. rt()
  126. row()
  127. lt()
  128. d()
  129. end
  130.  
  131. --[Start of the executable part of program]--
  132. -- Added refuel and set the order of inventory selections.
  133. -- Inventory box 1 is for fuel and the rest is for seeds.
  134.  
  135. turtle.refuel()
  136. start()
  137. turtle.select (2)
  138. to()
  139. turtle.select(3)
  140. te()
  141. turtle.select(4)
  142. to()
  143. turtle.select(5)
  144. te()
  145. rlt()
  146. re()
  147. re()
  148. re()
  149. m7()
  150. turtle.turnRight()
  151. turtle.back()
  152. turtle.up()
  153. turtle.up()
  154. turtle.back()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement