Advertisement
Wyvern67

Redwood chopper by seriallos

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