Skip to content
This repository has been archived by the owner on Jan 25, 2022. It is now read-only.

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
shiukaheng authored Apr 7, 2019
1 parent 3d1b849 commit af127bf
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 0 deletions.
33 changes: 33 additions & 0 deletions LoLEng.py
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 added LolEng.ico
Binary file not shown.
Binary file added dist/LoLEng.exe
Binary file not shown.
7 changes: 7 additions & 0 deletions setup.py
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")]}])

0 comments on commit af127bf

Please sign in to comment.