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("_")
|
if not func.startswith("_")
|
||||||
# Hack loop
|
# Hack loop
|
||||||
if not func == "hack_loop"
|
if not func == "hack_loop"
|
||||||
|
# Unloaders
|
||||||
|
if not func.endswith("_unload")
|
||||||
# Utils
|
# Utils
|
||||||
if not func.startswith("find_")]
|
if not func.startswith("find_")]
|
||||||
|
|
14
main.py
14
main.py
|
@ -50,5 +50,15 @@ if __name__ == "__main__":
|
||||||
t.start()
|
t.start()
|
||||||
|
|
||||||
# Don't close the main thread as cheats are daemons
|
# Don't close the main thread as cheats are daemons
|
||||||
while True:
|
try:
|
||||||
sleep(1000000)
|
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