Hoff

Tree cutter

Jul 27th, 2013
91
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. if (turtle.getFuelLevel()>=600) then
  37. refuel2()
  38. end
  39. end
  40. end
  41.  
  42. function refuel2()
  43. else if (turtle.getFuelLevel()<600) then
  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. end
  54. end
  55.  
  56. function plant()
  57. turtle.select(14)
  58. turtle.place()
  59. turtle.select(1)
  60. end
  61.  
  62. function saplings()
  63. turtle.select(14)
  64. turtle.turnRight()
  65. turtle.suck()
  66. turtle.select(1)
  67. turtle.turnLeft()
  68. end
  69.  
  70. function getbonemeal()
  71. turtle.select(15)
  72. turtle.up()
  73. turtle.turnRight()
  74. turtle.suck()
  75. turtle.select(1)
  76. turtle.turnLeft()
  77. turtle.down()
  78. end
  79.  
  80. function bonemeal()
  81. turtle.select(15)
  82. turtle.place()
  83. turtle.place()
  84. turtle.place()
  85. turtle.place()
  86. turtle.select(1)
  87. end
  88. while true do
  89. refuel()
  90. saplings()
  91. getbonemeal()
  92. movetotree()
  93. for z=1,16 do
  94. plant()
  95. bonemeal()
  96. cut()
  97. end
  98. movetodrop()
  99. drop()
  100. end
Advertisement
Add Comment
Please, Sign In to add comment