Guest User

Wheat Autoharvester Turtle

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