Hoff

Tree cutter

Jul 27th, 2013
77
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. turtle.dig()
  16. turtle.forward()
  17. while true do
  18. if turtle.digUp() then
  19. turtle.up()
  20. else if not turtle.down() then
  21. turtle.back()
  22. break
  23. end
  24. end
  25. end
  26. end
  27.  
  28. function movetodrop()
  29. for g=1,7 do
  30. turtle.back()
  31. end
  32. end
  33.  
  34. function refuel()
  35. if (turtle.getFuelLevel()=="Unlimited") then
  36. return true
  37. else if turtle.getFuelLevel()<600 then
  38. refuel2()
  39. end
  40. end
  41. end
  42.  
  43. function refuel2()
  44. turtle.select(16)
  45. turtle.turnRight()
  46. turtle.turnRight()
  47. turtle.suck()
  48. turtle.refuel(64)
  49. turtle.select(1)
  50. turtle.turnLeft()
  51. turtle.turnLeft()
  52. end
  53.  
  54. function plant()
  55. turtle.select(14)
  56. turtle.place()
  57. turtle.select(1)
  58. end
  59.  
  60. function saplings()
  61. turtle.select(14)
  62. turtle.turnRight()
  63. turtle.suck()
  64. turtle.select(1)
  65. turtle.turnLeft()
  66. end
  67.  
  68. function getbonemeal()
  69. turtle.select(15)
  70. turtle.up()
  71. turtle.turnRight()
  72. turtle.suck()
  73. turtle.select(1)
  74. turtle.turnLeft()
  75. turtle.down()
  76. end
  77.  
  78. function bonemeal()
  79. turtle.select(15)
  80. turtle.place()
  81. turtle.place()
  82. turtle.place()
  83. turtle.place()
  84. turtle.select(1)
  85. end
  86. while true do
  87. refuel()
  88. saplings()
  89. getbonemeal()
  90. movetotree()
  91. for z=1,16 do
  92. plant()
  93. bonemeal()
  94. cut()
  95. end
  96. movetodrop()
  97. drop()
  98. end
Advertisement
Add Comment
Please, Sign In to add comment