Neopherus

Rubbertree

Apr 5th, 2013
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. -- RubbertreeLogger v.0.2 by Neopherus --
  2. -- Logs = 1
  3. -- Saplings = 2
  4. -- Bonemeal = 3
  5.  
  6. function plant()
  7. turtle.select(2)
  8. turtle.place()
  9. turtle.select(3)
  10. turtle.place()
  11. end
  12.  
  13. function compare()
  14. if turtle.compare(1) == true then
  15. cut() else
  16. plant()
  17. end
  18. end
  19.  
  20.  
  21.  
  22. function cut()
  23. turtle.dig()
  24. turtle.forward()
  25. while turtle.detectUp() do
  26. turtle.digUp()
  27. turtle.up()
  28. end
  29. end
  30.  
  31. function back()
  32. while not turtle.detectDown() do
  33. turtle.down()
  34. end
  35. turtle.back()
  36. end
  37.  
  38. tArgs = { ... }
  39. togo = tonumber(tArgs[1])
  40.  
  41. for i=1,togo do
  42. plant()
  43. compare()
  44. back()
  45. end
Advertisement
Add Comment
Please, Sign In to add comment