Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import time, os
- from playsound import playsound
- def follow(thefile):
- thefile.seek(0,os.SEEK_END)
- while True:
- line = thefile.readline()
- if not line:
- time.sleep(0.1)
- continue
- yield line
- if __name__ == "__main__":
- logfile = open(os.getenv("APPDATA")+"/.minecraft/logs/latest.log", "r")
- loglines = follow(logfile)
- for line in loglines:
- if "legendary" in line or "Legendary" in line or "Ultimate" in line:
- print('Legendary spawned!')
- playsound('C:\Drivers\Ding.wav')
- time.sleep(1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement