This repository has been archived by the owner on Jan 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3d1b849
commit af127bf
Showing
4 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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")]}]) |