Advertisement
347Online

TreeFarm

Aug 26th, 2013 (edited)
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function harvest()
  2.  turtle.dig()
  3.  turtle.forward()
  4.  while turtle.detectUp() do
  5.   turtle.digUp()
  6.   turtle.up()
  7.  end
  8. while not turtle.detectDown() do
  9.  turtle.down()
  10. end
  11. turtle.back()
  12. turtle.place()
  13. turtle.select(2)
  14. turtle.place()
  15. turtle.place()
  16. turtle.place()
  17. turtle.place()
  18. turtle.place()
  19. turtle.place()
  20. turtle.place()
  21. turtle.place()
  22. turtle.place()
  23. turtle.place()
  24. turtle.select(1)
  25. end
  26.  
  27. local args = {...}
  28. if args[1] ~= 0 then
  29.  for i = 1, args[1] do
  30.   harvest()
  31.  end
  32. else
  33.  while turtle.getItemCount(1) > 0 and turtle.getFuelLevel() >= 2 do
  34.   harvest()
  35.  end
  36. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement