Advertisement
Guest User

Code

a guest
Mar 4th, 2022
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. import time, os
  2. from playsound import playsound
  3.  
  4. def follow(thefile):
  5. thefile.seek(0,os.SEEK_END)
  6. while True:
  7. line = thefile.readline()
  8. if not line:
  9. time.sleep(0.1)
  10. continue
  11. yield line
  12.  
  13. if __name__ == "__main__":
  14. logfile = open(os.getenv("APPDATA")+"/.minecraft/logs/latest.log", "r")
  15. loglines = follow(logfile)
  16. for line in loglines:
  17. if "legendary" in line or "Legendary" in line or "Ultimate" in line:
  18. print('Legendary spawned!')
  19. playsound('C:\Drivers\Ding.wav')
  20. time.sleep(1)
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement