From fe14f5f09480208b3f8ab42c7ad41d7c0b8b3b58 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Thu, 30 Mar 2023 21:00:20 +0200 Subject: [PATCH] TEMP: Run all cheats --- main.py | 55 +++++++++++++++++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 22 deletions(-) diff --git a/main.py b/main.py index b5b452a..becd926 100644 --- a/main.py +++ b/main.py @@ -1,4 +1,5 @@ from json import loads +from threading import Thread from time import sleep from pymem import Pymem @@ -335,6 +336,7 @@ class Cheat(Hack): else: # Not spraying + # TODO: Reset to middle? self.nr__old_punch_x = 0. self.nr__old_punch_y = 0. @@ -359,28 +361,37 @@ if __name__ == "__main__": # Cheat c = Cheat() - # Cheat list - print("Enter 0 to exit.") - print("Available cheats:") - for idx, cheat in enumerate(c.cheats_list): - print(f"#{idx + 1} - {cheat}") + # # Cheat list + # print("Enter 0 to exit.") + # print("Available cheats:") + # for idx, cheat in enumerate(c.cheats_list): + # print(f"#{idx + 1} - {cheat}") - # Select cheat - c_id = None - while c_id == None: - try: - match int(input("Enter ID: #")): - case 0: - exit(0) - case i if i > len(c.cheats_list): - raise IndexError - case _ as i: - c_id = i - 1 - except KeyboardInterrupt: - print("??\nBye.") - exit(1) - except: - print("Invalid ID.") + # # Select cheat + # c_id = None + # while c_id == None: + # try: + # match int(input("Enter ID: #")): + # case 0: + # exit(0) + # case i if i > len(c.cheats_list): + # raise IndexError + # case _ as i: + # c_id = i - 1 + # except KeyboardInterrupt: + # print("??\nBye.") + # exit(1) + # except: + # print("Invalid ID.") # Run cheat - getattr(c, c.cheats_list[c_id])() + # getattr(c, c.cheats_list[c_id])() + + # Instanciate and run threads + for fn in c.cheats_list: + t = Thread(target=getattr(c, fn)) + t.daemon = True + t.start() + + while True: + sleep(1000000)