From f00c8171348bdabb6d8008673ead806897eb29d8 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Sat, 1 Apr 2023 17:22:23 +0200 Subject: [PATCH] More verbose and hide some exceptions when ^C app during csgo.exe research --- hack.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/hack.py b/hack.py index a04dea3..47a8cdc 100644 --- a/hack.py +++ b/hack.py @@ -65,16 +65,20 @@ class Hack(): def _find_process(self, verbose: bool = False) -> Pymem: """Find game process""" process_found = False - print("Looking for process...") if verbose else None + print("Looking for process... ", end="", flush=True) if verbose else None pm = None while not process_found: try: pm = Pymem("csgo.exe") except: - sleep(self.timeout) + try: + sleep(self.timeout) + except KeyboardInterrupt: + print("Canceled!") + exit(1) else: - print("Process found!") if verbose else None + print("Process found!") if verbose else print("") process_found = True if pm: