ThatGravyBoat

Untitled

May 5th, 2021 (edited)
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.87 KB | None | 0 0
  1. local running = true
  2. local function cutTree()
  3. turtle.dig()
  4. turtle.forward()
  5.  
  6. successUp, dataUp = turtle.inspectUp();
  7. while successUp and dataUp.name == "minecraft:spruce_log" do
  8. turtle.dig()
  9. turtle.turnRight()
  10. turtle.dig()
  11. turtle.turnLeft()
  12. turtle.digUp()
  13. turtle.up()
  14. successUp, dataUp = turtle.inspectUp();
  15. end
  16. turtle.turnRight()
  17. turtle.dig()
  18. turtle.turnLeft()
  19. turtle.dig()
  20. turtle.forward()
  21. turtle.turnRight()
  22. turtle.dig()
  23. turtle.forward()
  24.  
  25. successDown, dataDown = turtle.inspectDown();
  26. while successDown and dataDown.name == "minecraft:spruce_log" do
  27. turtle.digDown()
  28. turtle.down()
  29. successDown, dataDown = turtle.inspectDown();
  30. end
  31.  
  32. turtle.turnRight()
  33. turtle.turnRight()
  34. turtle.select(1)
  35. turtle.place()
  36. turtle.turnLeft()
  37. turtle.forward()
  38. turtle.turnRight()
  39. turtle.turnRight()
  40. turtle.place()
  41. turtle.turnLeft()
  42. turtle.turnLeft()
  43. turtle.forward()
  44. turtle.turnRight()
  45. turtle.turnRight()
  46. turtle.place()
  47. turtle.turnLeft()
  48. turtle.forward()
  49. end
  50.  
  51.  
  52. local function dropOffStuff()
  53. for i=2, 16 do
  54. if running then
  55. turtle.select(i)
  56. if turtle.getItemCount(i) > 0 and turtle.drop(64) == false then
  57. running = false
  58. end
  59. end
  60. end
  61. turtle.turnRight()
  62. end
  63.  
  64. local function checkForSaplings()
  65. if turtle.getItemCount(1) < 4 then
  66. running = false
  67. end
  68. end
  69.  
  70.  
  71.  
  72.  
  73. while running do
  74. local success, data = turtle.inspect();
  75. if (success) and (data.name == "minecraft:spruce_log") then
  76. checkForSaplings()
  77. if running then
  78. cutTree()
  79. dropOffStuff()
  80. turtle.select(1)
  81. turtle.place()
  82. end
  83. end
  84. end
Advertisement
Add Comment
Please, Sign In to add comment