Lorc520

loop 0.1s attack + sort

Apr 29th, 2025 (edited)
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. local checkInterval = 60 -- seconds
  2. local lastCheck = os.clock()
  3.  
  4. while true do
  5. turtle.attack()
  6. sleep(0.1)
  7.  
  8. if os.clock() - lastCheck >= checkInterval then
  9. for slot = 1, 16 do
  10. turtle.select(slot)
  11. local item = turtle.getItemDetail()
  12. if item then
  13. if item.name == "minecraft:bone" then
  14. -- Turn around to drop behind
  15. turtle.turnLeft()
  16. turtle.turnLeft()
  17. turtle.drop()
  18. turtle.turnLeft()
  19. turtle.turnLeft()
  20. else
  21. turtle.dropDown()
  22. end
  23. end
  24. end
  25. turtle.select(1)
  26. lastCheck = os.clock()
  27. end
  28. end
  29.  
Advertisement
Add Comment
Please, Sign In to add comment