This repository has been archived on 2023-09-02. You can view files and clone it, but cannot push or open issues or pull requests.
csh/cheat.py

26 lines
928 B
Python
Raw Normal View History

from glob import glob
2023-03-30 23:19:17 +02:00
# Import all cheats
backslash = "\\"
for file in glob("cheats/*.py"):
exec(f"from {file.replace(backslash, '.')[:-3]} import *")
2023-03-30 23:19:17 +02:00
class Cheat(*[child for child in Hack.__subclasses__()]): # type: ignore
2023-04-01 16:11:56 +02:00
"""All cheats are loaded in this class"""
def __init__(self, **kwargs) -> None:
super().__init__(**kwargs)
2023-03-30 23:19:17 +02:00
self.cheats_list = [func for func in dir(self)
# Function
if callable(getattr(self, func))
# User defined
if not func.startswith("_")
# Hack loop
if not func == "hack_loop"
2023-04-03 01:18:14 +02:00
# Unloaders
if not func.endswith("_unload")
2023-03-30 23:19:17 +02:00
# Utils
if not func.startswith("find_")]