Advertisement
Ahmi

Untitled

Aug 1st, 2022 (edited)
19
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.06 KB | None | 0 0
  1. --[[
  2.  
  3. Redwood chopper
  4.  
  5. Place at the base of a redwood tree and let 'er rip
  6.  
  7. --]]
  8.  
  9.  
  10. turtle.refuel(1)
  11.  
  12. -- dig into the tree one space
  13. turtle.dig()
  14. turtle.forward()
  15.  
  16. -- figure out if we're on the left or right side of the tree
  17. -- check left first
  18. turtle.turnLeft()
  19.  
  20. if false == turtle.detect() then
  21. turtle.turnRight()
  22. end
  23.  
  24. -- chop the current level then move up
  25. doneClimbing = false
  26.  
  27. repeat
  28. -- first spot is already dug
  29. for i = 1, 2 do
  30. turtle.dig()
  31. turtle.forward()
  32. turtle.dig()
  33. turtle.forward()
  34. turtle.turnRight()
  35. end
  36.  
  37. -- if there's something above, dig it
  38. if turtle.detectUp() then
  39. turtle.digUp()
  40. turtle.up()
  41. else
  42. -- otherwise we're done
  43. doneClimbing = true
  44. end
  45. until doneClimbing
  46.  
  47. -- safely back to the ground
  48. while false == turtle.detectDown() do
  49. turtle.down()
  50. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement