From 3f11ccb9fac18db24871990457957b87854ade91 Mon Sep 17 00:00:00 2001 From: Mylloon Date: Wed, 5 Apr 2023 13:07:39 +0200 Subject: [PATCH] add unload infos --- GUIDE.md | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/GUIDE.md b/GUIDE.md index de11ed4..43bbdf3 100644 --- a/GUIDE.md +++ b/GUIDE.md @@ -6,26 +6,38 @@ ```python from hack import Hack -class Yourcheat(Hack): +class Mycheat(Hack): def __init__(self, **kwargs) -> None: super().__init__(**kwargs) + # Here you can initialize global variables for your cheat ``` 3. Add the method who will contains the cheat logic, note that: - Your method must contains a sub-method and must be added to - the `hackloop` at the end of the method (see example below). + the `hackloop` at the end of the method (see example below) ```python def mycheat(self) -> None: - # Cheat initialization, will run only one time + # Cheat initialization, will only run once def cheat(): # Your cheat logic, will be looped - # Setup the loop + # Setting up the loop self.hack_loop(cheat) ``` +4. If you need to unload something before closing the app (e.g. restore the + initial state of something), you can add a second method called + `MYCHEAT_unload` with `MYCHEAT` the same name as the previous method + +```python + def mycheat_unload(self) -> None: + # Called when the app is closed +``` + +5. For more examples, see [the cheats already done](./cheats/) + ## Extra infos - `self.pm` is used to read/write memory