Advertisement
Padilk

Untitled

Aug 18th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. lvl = 0
  2.  
  3. function chop()
  4. if turtle.detectUp() then
  5. turtle.digUp()
  6.  
  7. while not turtle.up() do os.sleep(1) turtle.attackUp() end
  8. lvl = lvl+1
  9. chop()
  10. if not turtle.detectDown() then
  11. while not turtle.down() do os.sleep(1) turtle.attackDown() end
  12. else
  13. turtle.digDown()
  14. chop()
  15. end
  16. lvl = lvl-1
  17. end
  18.  
  19. if turtle.detectDown() and lvl==0 then
  20. turtle.digDown()
  21. end
  22.  
  23. for i=1,4 do
  24. if turtle.detect() then
  25. turtle.dig()
  26. while not turtle.forward() do os.sleep(1) end
  27. chop()
  28. while not turtle.back() do os.sleep(1) end --can be stoped
  29. end
  30. turtle.turnLeft()
  31. end
  32. end
  33.  
  34. chop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement