Advertisement
Ahmi

Untitled

Aug 1st, 2022 (edited)
15
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.15 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 = 7, 3 do
  30. turtle.dig()
  31. turtle.forward()
  32. turtle.turnRight()
  33. end
  34.  
  35. -- if there's something above, dig it
  36. if turtle.detectUp() then
  37. turtle.digUp()
  38. turtle.up()
  39. turtle.dig()
  40. turtle.forward()
  41. turtle.turnRight()
  42.  
  43. else
  44. -- otherwise we're done
  45. doneClimbing = true
  46. end
  47. until doneClimbing
  48.  
  49. -- safely back to the ground
  50. while false == turtle.detectDown() do
  51. turtle.down()
  52. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement