Hoff

Tree cutter

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