use named list instead of IDs (#2)

This commit is contained in:
Mylloon 2023-04-04 11:16:49 +02:00
parent 56b1a5964b
commit a4f6e11d67
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
2 changed files with 7 additions and 3 deletions

View file

@ -19,10 +19,10 @@ python .\main.py --offline
- You also can bypass the interactive cheat selector by passing a list to the app. - You also can bypass the interactive cheat selector by passing a list to the app.
For instance, using cheats `#1`, `#2`, `#3` and `#4`: For instance, using `aimbot`, `bhop` and the `radar hack`
```powershell ```powershell
python .\main.py --list=1,2,3,4 python .\main.py --list=aimbot,bhop,radarhack
``` ```
Feel free to modify the [run.bat](./run.bat) as you wish. Feel free to modify the [run.bat](./run.bat) as you wish.

View file

@ -20,6 +20,7 @@ def do_on_exit():
if __name__ == "__main__": if __name__ == "__main__":
c_id = [] c_id = []
args = {} args = {}
wanted_list = []
if (len(argv) > 1): if (len(argv) > 1):
# User wanna use offline offsets # User wanna use offline offsets
@ -28,12 +29,15 @@ if __name__ == "__main__":
# User gave a list of cheats # User gave a list of cheats
# Will bypass the interactive selection # Will bypass the interactive selection
c_id = [int(j) - 1 for j in [i for i in argv if i.startswith( wanted_list = [j for j in [i for i in argv if i.startswith(
"--list=")][0][7:].split(",")] "--list=")][0][7:].split(",")]
# Load cheat class # Load cheat class
c = Cheat(**args) c = Cheat(**args)
# Load user list
c_id = [c.cheats_list.index(cheat) for cheat in wanted_list]
# Interactive selection # Interactive selection
if (c_id == []): if (c_id == []):
# Cheat list # Cheat list