diff --git a/LoLEng.py b/LoLEng.py new file mode 100644 index 0000000..9752a81 --- /dev/null +++ b/LoLEng.py @@ -0,0 +1,33 @@ +import subprocess +import shlex +import time +import csv +import os +##THANK HENG FOR THIS SHIT## +print("Please note this script requires adminstrator privileges.") +print("Waiting of League of Legends instance.") +def check_TW_league(): + output = subprocess.check_output(('TASKLIST', '/FI', 'IMAGENAME EQ LeagueClient.exe')) + if output == b'INFO: No tasks are running which match the specified criteria.\r\n': + return False + else: + args = subprocess.check_output(('wmic.exe', 'path', 'Win32_Process', 'where', 'name=\'LeagueClient.exe\'', 'get', 'commandline', '/format:csv')) + parsed_args = shlex.split([x.replace('\r','') for x in args.decode().split('\n')][-2].split(',')[1]) + #print(parsed_args) + if parsed_args[1]!="--locale=en_US": + output = subprocess.check_output(('TASKKILL', '/F', '/FI', 'IMAGENAME EQ LeagueClient.exe')) + new_args = parsed_args + new_args[0] = "\"%s\"" % (new_args[0],) + new_args[1] = "--locale=en_US" + command = " ".join(new_args) + print("Non-english League of Legends instance detected, restarting in English.") + print(command) + os.system(command) + return True + else: + print("Englesh League of Legends instance detected and ignored.") + return False + +while True: + time.sleep(0.5) + check_TW_league() diff --git a/LolEng.ico b/LolEng.ico new file mode 100644 index 0000000..8dd70b0 Binary files /dev/null and b/LolEng.ico differ diff --git a/dist/LoLEng.exe b/dist/LoLEng.exe new file mode 100644 index 0000000..5c6a7df Binary files /dev/null and b/dist/LoLEng.exe differ diff --git a/setup.py b/setup.py new file mode 100644 index 0000000..619bbaf --- /dev/null +++ b/setup.py @@ -0,0 +1,7 @@ +from distutils.core import setup +import py2exe + +setup(options={'py2exe':{'bundle_files':1,'compressed':True}}, + zipfile = None, + console = [{'script': 'LoLEng.py', + 'icon_resources': [(0, "LolEng.ico")]}])