Added tentative support for medals - need to check if gun/armour/talent are involved. Haven't tested it yet - at least non-medal use still works correctly.

This commit is contained in:
2023-05-14 15:12:17 +10:00
parent 532a6b24e7
commit 98d86c829e
3 changed files with 31 additions and 10 deletions

4
README
View File

@@ -3,6 +3,7 @@ Rank Code Personal Database.
How to use:
Currently there is no real UI, so start by running python in this dir and `import codegen`.
Config file is in ~/.config/swat.cfg. If you want it somewhere else, open codegen.py and edit line 6. Do this BEFORE `import codegen`. If you've already imported it, quit python and reopen it.
If you are using Windows, you HAVE to edit that line or setup will fail.
Setup:
Execute `codegen.add_user('{YOUR IGN}')`. This will create the config file if it doesn't exist. You can add as many users as you like if you want to have multiple profiles for whatever reason (I cannot think of a reason, I just added it for fun).
@@ -12,7 +13,8 @@ General use:
To load a code, use `codegen.read_code('0000-0000-0000-0000')`. You can put it in without the hyphens, also you can use anything in there, doesn't have to be hyphens. I recommend having something in between because it's helpful for checking the code is right.
To load a bunch of codes at once, do `codegen.mass_add()`, it just calls `read_code` in a loop. It stops if you give it a blank line.
To generate codes, use `codegen.generate('class/line')`, where you give it class/gun/armour/trait/spec/talent. Look in tables.py for the names you should be using; it is not case sensitive, at least. Also gun is optional unless it's mav/wm. (Note if you try to gen the wrong gun on a class, my gen will not stop you. The code will probably be invalid 🤷.)
To generate codes, use `codegen.generate('class/line')`, where you give it class/armour/trait/spec/talent. Look in tables.py for the names you should be using; it is not case sensitive, at least.
If generating mav/wm, you must specify the gun BEFORE the class, with no slash, like so: "glwm", "rmav". For WM use two letters, for mav use one. Actually WM *might* work with one. Not sure.
To check your progress, use `codegen.ranks()`. It's not very pretty yet, it's a work in progress.