Advertisement
Guest User

Untitled

a guest
Mar 31st, 2013
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.33 KB | None | 0 0
  1. local number=0
  2. function axeUp()
  3. turtle.dig()
  4. turtle.forward()
  5. while turtle.digUp() do
  6. turtle.digUp()
  7. turtle.dig()
  8. turtle.up()
  9. number=number+1
  10. end
  11.  
  12. end
  13. function switchSides()
  14. turtle.turnRight()
  15. turtle.dig()
  16. turtle.forward()
  17. turtle.turnLeft()
  18. end
  19.  
  20. function axeDown()
  21. while number > 0 do
  22. turtle.digDown()
  23. turtle.dig()
  24. turtle.down()
  25. number=number-1
  26. end
  27. turtle.dig()
  28. end
  29.  
  30. function returnToStart()
  31. turtle.turnLeft()
  32. turtle.forward()
  33. turtle.turnRight()
  34. turtle.back()
  35. end
  36.  
  37. function placeSapling()
  38. turtle.select(1)
  39. turtle.forward()
  40. turtle.place()
  41. turtle.turnRight()
  42. turtle.forward()
  43. turtle.turnLeft()
  44. turtle.place()
  45. turtle.back()
  46. turtle.place()
  47. turtle.turnLeft()
  48. turtle.forward()
  49. turtle.turnRight()
  50. turtle.place()
  51. end
  52.  
  53. function boneMeal()
  54. turtle.select(2)
  55. turtle.place()
  56. end
  57.  
  58. function returnToStart()
  59. turtle.turnLeft()
  60. turtle.forward()
  61. turtle.turnRight()
  62. turtle.back()
  63. turtle.back()
  64. end
  65.  
  66. function dropOffReset()
  67. turtle.turnLeft()
  68. turtle.turnLeft()
  69. turtle.select(3)
  70. turtle.drop()
  71. turtle.select(4)
  72. turtle.drop()
  73. turtle.select(5)
  74. turtle.drop()
  75. turtle.select(6)
  76. turtle.drop()
  77. turtle.select(7)
  78. turtle.drop()
  79. turtle.turnLeft()
  80. turtle.turnLeft()
  81. end
  82.  
  83. function dropOffUp()
  84.  
  85. turtle.select(3)
  86. turtle.dropUp()
  87. turtle.select(4)
  88. turtle.dropUp()
  89. turtle.select(5)
  90. turtle.dropUp()
  91. turtle.select(6)
  92. turtle.dropUp()
  93. turtle.select(7)
  94. turtle.dropUp()
  95. turtle.select(1)
  96. end
  97.  
  98. function dropOffDown()
  99.  
  100. turtle.select(3)
  101. turtle.dropDown()
  102. turtle.select(4)
  103. turtle.dropDown()
  104. turtle.select(5)
  105. turtle.dropDown()
  106. turtle.select(6)
  107. turtle.dropDown()
  108. turtle.select(7)
  109. turtle.dropDown()
  110. turtle.select(1)
  111. end
  112. function getBoneMeal()
  113. turtle.select(2)
  114. turtle.suckDown()
  115. dropOffDown()
  116. end
  117. function getSaplings()
  118. turtle.select(1)
  119. turtle.suckUp()
  120. dropOffUp()
  121. end
  122.  
  123. function Inventory()
  124. if turtle.getItemCount(2) < 5 then
  125. getBoneMeal()
  126. end
  127. if turtle.getItemCount(1) < 5 then
  128. getSaplings()
  129. end
  130. end
  131. --[[FUncTIOnsHERE]]--
  132. Inventory()
  133. os.sleep(5)
  134. while turtle.getItemCount(1) > 3 and turtle.getItemCount(2) > 1 do
  135. Inventory()
  136. getSaplings()
  137. getBoneMeal()
  138. placeSapling()
  139. boneMeal()
  140. axeUp()
  141. switchSides()
  142. axeDown()
  143. returnToStart()
  144. dropOffReset()
  145.  
  146. os.sleep(5)
  147. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement