Achman741

Tree Felling Program Basic

Feb 13th, 2014
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. x = 0
  2. y = 0
  3. print("Starting tree felling")
  4. function down()
  5. while x > 0 do
  6. turtle.down()
  7. x = x - 1
  8. end
  9. end
  10.  
  11. function next()
  12. turtle.turnRight()
  13. turtle.dig()
  14. turtle.forward()
  15. turtle.turnLeft()
  16. turtle.dig()
  17. end
  18.  
  19. function treeup()
  20. while turtle.detect() or turtle.detectUp() do
  21. turtle.dig()
  22. turtle.digUp()
  23. turtle.up()
  24. x = x + 1
  25. end
  26. end
  27.  
  28. function treedown()
  29. y = 0 + x
  30. while y > 0 do
  31. turtle.dig()
  32. turtle.digDown()
  33. turtle.down()
  34. y = y - 1
  35. end
  36. turtle.dig()
  37. end
  38.  
  39. turtle.dig()
  40. turtle.forward()
  41. treeup()
  42. next()
  43. treedown()
  44. print("Tree felling completed")
  45. print("Tree was "..x.." blocks tall")
Advertisement
Add Comment
Please, Sign In to add comment