Hoff

Tree cutter

Jul 26th, 2013
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function movetotree()
  2. for i=1,7 do
  3. turtle.forward()
  4. end
  5. end
  6.  
  7. function drop()
  8. for d=1,15 do
  9. turtle.select(i)
  10. turtle.dropDown()
  11. end
  12. end
  13.  
  14. function cut()
  15. while true do
  16. if not turtle.digUp() then
  17. turtle.up()
  18. else turtle.back()
  19. break
  20. end
  21. end
  22. end
  23.  
  24. function movetodrop()
  25. for g=1,7 do
  26. turtle.back()
  27. end
  28. end
  29.  
  30. function refuel()
  31. if (turtle.getFuelLevel()=="Unlimited") then
  32. return true
  33. end
  34. else turtle.select(16)
  35. turtle.turnRight()
  36. turtle.turnRight()
  37. turtle.suck()
  38. turtle.refuel(64)
  39. turtle.select(1)
  40. turtle.turnLeft()
  41. turtle.turnLeft()
  42. end
  43.  
  44. function plant()
  45. turtle.select(15)
  46. turtle.place()
  47. turtle.select(1)
  48. end
  49.  
  50. function saplings()
  51. turtle.select(15)
  52. turtle.turnRight()
  53. turtle.suck()
  54. turtle.select(1)
  55. turtle.turnLeft()
  56. end
  57.  
  58. while true do
  59. refuel()
  60. saplings()
  61. movetotree()
  62. for z=1,64 do
  63. plant()
  64. sleep(180)
  65. cut()
  66. end
  67. movetodrop()
  68. drop()
  69. end
Advertisement
Add Comment
Please, Sign In to add comment