xFlyDr

4x3 Rubber Farm

May 23rd, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.28 KB | None | 0 0
  1. t=turtle
  2. local function vor()
  3. if turtle.detect() then
  4. turtle.dig()
  5. end
  6. turtle.forward()
  7. end
  8.  
  9. local function hoch()
  10. if turtle.detectUp() then
  11. turtle.digUp()
  12. end
  13. repeat until turtle.up()
  14. end
  15.  
  16. local function runter()
  17. if turtle.detectDown() then
  18. turtle.digDown()
  19. end
  20. turtle.down()
  21. end
  22.  
  23. local function zuruck()
  24. turtle.turnRight()
  25. turtle.turnRight()
  26. if turtle.detect() then
  27. turtle.dig()
  28. end
  29. turtle.forward()
  30. turtle.turnRight()
  31. turtle.turnRight()
  32. end
  33.  
  34.  
  35.  
  36. function chests()
  37.  
  38. for i=1, 14 do
  39. turtle.select(i)
  40. turtle.drop(64)
  41. end
  42.  
  43.  
  44. turtle.turnLeft()
  45.  
  46.  
  47. hoch()
  48.  
  49. turtle.select(15)
  50.  
  51. turtle.suck(1)
  52. if turtle.getFuelLevel() < (turtle.getFuelLimit()-1000) then
  53. turtle.refuel(30)
  54. end
  55.  
  56. print(turtle.getFuelLevel())
  57.  
  58. --neue setzlinge
  59.  
  60. runter()
  61.  
  62. turtle.select(16)
  63.  
  64. turtle.suck(9)
  65.  
  66. turtle.turnRight()
  67.  
  68. end
  69.  
  70. function fellen()
  71.  
  72. local success, data = turtle.inspect()
  73. if data.name=="ic2:rubber_wood" then
  74.  
  75.  
  76. --runter()
  77. vor()
  78.  
  79. h=0
  80. while turtle.detectUp() do
  81. h=h+1
  82. hoch()
  83. end
  84. for i=1, h do
  85. runter()
  86. end
  87. turtle.turnRight()
  88. turtle.turnRight()
  89. vor()
  90. turtle.turnRight()
  91. turtle.turnRight()
  92.  
  93. turtle.select(16)
  94.  
  95. turtle.place()
  96. end
  97. end
  98.  
  99. function check()
  100. --hoch()
  101. vor()
  102. vor()
  103. t.turnLeft()
  104. fellen()
  105. t.turnRight()
  106. t.turnRight()
  107. fellen()
  108. t.turnLeft()
  109.  
  110.  
  111. vor()
  112. vor()
  113. t.turnLeft()
  114. fellen()
  115. t.turnRight()
  116. t.turnRight()
  117. fellen()
  118. t.turnLeft()
  119.  
  120.  
  121. vor()
  122. vor()
  123. t.turnLeft()
  124. fellen()
  125. t.turnRight()
  126. t.turnRight()
  127. fellen()
  128. --
  129. t.turnRight()
  130. -- t.turnRight()
  131. vor()
  132. t.turnLeft()
  133. vor()
  134. vor()
  135. vor()
  136. vor()
  137. t.turnLeft()
  138. vor()
  139. t.turnLeft()
  140. t.turnLeft()
  141.  
  142. t.turnLeft()
  143. fellen()
  144. t.turnRight()
  145. t.turnRight()
  146. fellen()
  147. t.turnLeft()
  148.  
  149. vor()
  150. vor()
  151. t.turnLeft()
  152. fellen()
  153. t.turnRight()
  154. t.turnRight()
  155. fellen()
  156. t.turnLeft()
  157.  
  158. vor()
  159. vor()
  160. t.turnLeft()
  161. fellen()
  162. t.turnRight()
  163. t.turnRight()
  164. fellen()
  165. t.turnLeft()
  166.  
  167.  
  168. vor()
  169. t.turnRight()
  170. vor()
  171. vor()
  172. vor()
  173. vor()
  174.  
  175. t.turnLeft()
  176. vor()
  177. t.turnLeft()
  178. t.turnLeft()
  179.  
  180. --runter()
  181.  
  182.  
  183.  
  184.  
  185. end
  186.  
  187. while 1==1 do
  188.  
  189. chests()
  190.  
  191. turtle.select(16)
  192. if turtle.getItemCount()>5 then
  193. check()
  194. os.sleep(100)
  195. else
  196. os.sleep(30)
  197. end
  198. end
Advertisement
Add Comment
Please, Sign In to add comment