Advertisement
Guest User

Untitled

a guest
Mar 25th, 2019
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.44 KB | None | 0 0
  1. if not turtle.detect() then
  2.   error('Could not find tree!')
  3. end
  4.  
  5. print('Chopping tree...')
  6.  
  7. if not turtle.dig() then -- chop base of tree
  8.   error('Turtle needs a digging tool!')
  9. end
  10.  
  11. turtle.forward() -- move under tree
  12. while turtle.compareUp() do
  13.   -- keep chopping until no more wood
  14.   turtle.digUp()
  15.   turtle.up()
  16. end
  17.  
  18. -- move back down to ground
  19. while not turtle.detectDown() do
  20.   turtle.down()
  21. end
  22.  
  23. print('Done chopping tree.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement