Hoff

Tree cutter

Jul 26th, 2013
110
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 if not turtle.down() then
  19. turtle.back()
  20. break
  21. end
  22. end
  23. end
  24.  
  25. function movetodrop()
  26. for g=1,7 do
  27. turtle.back()
  28. end
  29. end
  30.  
  31. function refuel()
  32. if (turtle.getFuelLevel()=="Unlimited") then
  33. return true
  34. end
  35. turtle.select(16)
  36. turtle.turnRight()
  37. turtle.turnRight()
  38. turtle.suck()
  39. turtle.refuel(64)
  40. turtle.select(1)
  41. turtle.turnLeft()
  42. turtle.turnLeft()
  43. end
  44.  
  45. function plant()
  46. turtle.select(15)
  47. turtle.place()
  48. turtle.select(1)
  49. end
  50.  
  51. function saplings()
  52. turtle.select(15)
  53. turtle.turnRight()
  54. turtle.suck()
  55. turtle.select(1)
  56. turtle.turnLeft()
  57. end
  58.  
  59. while true do
  60. refuel()
  61. saplings()
  62. movetotree()
  63. for z=1,64 do
  64. plant()
  65. sleep(180)
  66. cut()
  67. end
  68. movetodrop()
  69. drop()
  70. end
Advertisement
Add Comment
Please, Sign In to add comment