Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[Lumberjill program based on
- Choptree program by Al Sweigert
- Chops down the tree in front of
- the turtle and plants a sapling--]]
- os.loadAPI('pond')
- if not turtle.detect() then
- error('Where is the tree??')
- end
- print('Chopping tree...')
- if not turtle.dig() then --Chop base of tree
- error('I need a tool equipped')
- end
- turtle.forward() --Move under tree
- pond.selectItem('minecraft:log')
- while turtle.compareUp() do
- --Keep chopping until no more wood
- turtle.digUp()
- turtle.up()
- end
- --Return to the ground
- while not turtle.detectDown() do
- turtle.down()
- end
- turtle.back()
- pond.selectItem('minecraft:sapling')
- turtle.place()
- print('Tree harvested')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement