Add unloader support
This commit is contained in:
parent
f81fc41598
commit
23edb27190
2 changed files with 14 additions and 2 deletions
2
cheat.py
2
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_")]
|
||||
|
|
10
main.py
10
main.py
|
@ -50,5 +50,15 @@ if __name__ == "__main__":
|
|||
t.start()
|
||||
|
||||
# Don't close the main thread as cheats are daemons
|
||||
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()
|
||||
|
|
Reference in a new issue