Add unloader support

This commit is contained in:
Mylloon 2023-04-03 01:18:14 +02:00
parent f81fc41598
commit 23edb27190
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
2 changed files with 14 additions and 2 deletions

View file

@ -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_")]

14
main.py
View file

@ -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()