From 23edb271905ab4f699e334f1108c9b4f5e51127c Mon Sep 17 00:00:00 2001 From: Mylloon Date: Mon, 3 Apr 2023 01:18:14 +0200 Subject: [PATCH] Add unloader support --- cheat.py | 2 ++ main.py | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/cheat.py b/cheat.py index e3baadc..8e4ef6e 100644 --- a/cheat.py +++ b/cheat.py @@ -25,5 +25,7 @@ class Cheat(Bhop, Radarhack, Glow, Trigger, if not func.startswith("_") # Hack loop if not func == "hack_loop" + # Unloaders + if not func.endswith("_unload") # Utils if not func.startswith("find_")] diff --git a/main.py b/main.py index 9b58249..2e9df22 100644 --- a/main.py +++ b/main.py @@ -50,5 +50,15 @@ if __name__ == "__main__": t.start() # Don't close the main thread as cheats are daemons - while True: - sleep(1000000) + try: + while True: + sleep(1000000) + except KeyboardInterrupt: + for fn in [c.cheats_list[i] for i in c_id]: + try: + unloader = getattr(c, f"{fn}_unload") + except: + pass + else: + print(f"Unload {fn}...") + unloader()