From 3bb52384d0128faea79e29ad4677f3658070b53a Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 13 Sep 2023 19:23:48 -0600 Subject: [PATCH] fix utility func --- scripts/constants.py | 2 +- scripts/utils.py | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/constants.py b/scripts/constants.py index c976215..c915da5 100644 --- a/scripts/constants.py +++ b/scripts/constants.py @@ -21,7 +21,7 @@ # PROCESS NAMES LEAGUE_PROCESS_NAMES = ["LeagueClient.exe", "League of Legends.exe"] -RIOT_CLIENT_PROCESS_NAMES = "RiotClientUx.exe" +RIOT_CLIENT_PROCESS_NAMES = ["RiotClientUx.exe"] # COMMANDS KILL_LEAGUE_CLIENT = 'TASKKILL /F /IM LeagueClient.exe' diff --git a/scripts/utils.py b/scripts/utils.py index e1db8c9..f4c611d 100644 --- a/scripts/utils.py +++ b/scripts/utils.py @@ -21,6 +21,14 @@ def is_league_running(): return True return False +def is_rc_running(): + res = subprocess.check_output(["TASKLIST"], creationflags=0x08000000) + output = str(res) + for name in RIOT_CLIENT_PROCESS_NAMES: + if name in output: + return True + return False + def close_processes(): log.info("Terminating league related processes.") os.system(KILL_LEAGUE)