Advertisement
Guest User

lumberjill

a guest
May 25th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.69 KB | None | 0 0
  1. --[[Lumberjill program based on
  2. Choptree program by Al Sweigert
  3. Chops down the tree in front of
  4. the turtle and plants a sapling--]]
  5.  
  6. os.loadAPI('pond')
  7.  
  8. if not turtle.detect() then
  9. error('Where is the tree??')
  10. end
  11.  
  12. print('Chopping tree...')
  13.  
  14. if not turtle.dig() then --Chop base of tree
  15. error('I need a tool equipped')
  16. end
  17.  
  18. turtle.forward() --Move under tree
  19.  
  20. pond.selectItem('minecraft:log')
  21.  
  22. while turtle.compareUp() do
  23.   --Keep chopping until no more wood
  24.   turtle.digUp()
  25.   turtle.up()
  26. end
  27.  
  28. --Return to the ground
  29. while not turtle.detectDown() do
  30.   turtle.down()
  31. end
  32.  
  33. turtle.back()
  34. pond.selectItem('minecraft:sapling')
  35. turtle.place()
  36. print('Tree harvested')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement