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

25 lines
928 B
Python

from glob import glob
# Import all cheats
backslash = "\\"
for file in glob("cheats/*.py"):
exec(f"from {file.replace(backslash, '.')[:-3]} import *")
class Cheat(*[child for child in Hack.__subclasses__()]): # type: ignore
"""All cheats are loaded in this class"""
def __init__(self, **kwargs) -> None:
super().__init__(**kwargs)
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"
# Unloaders
if not func.endswith("_unload")
# Utils
if not func.startswith("find_")]