diff options
author | B. Stack <bgstack15@gmail.com> | 2024-03-09 22:12:16 -0500 |
---|---|---|
committer | B. Stack <bgstack15@gmail.com> | 2024-03-09 22:12:16 -0500 |
commit | 7a26a5f51722ec9a8af334df385dbe5fd4847e32 (patch) | |
tree | 430757d6d234a8bcc3f39faf79dbd7c8a53b10d0 /srb.py | |
parent | initial commit (diff) | |
download | srb_lib-7a26a5f51722ec9a8af334df385dbe5fd4847e32.tar.gz srb_lib-7a26a5f51722ec9a8af334df385dbe5fd4847e32.tar.bz2 srb_lib-7a26a5f51722ec9a8af334df385dbe5fd4847e32.zip |
progress for day
Diffstat (limited to 'srb.py')
-rwxr-xr-x | srb.py | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -23,7 +23,11 @@ import srb_lib, argparse, sys from srb_lib import ferror, debuglev -parser = argparse.ArgumentParser(description="Cli tool for manipulating savegame files for srb.exe") +parser = argparse.ArgumentParser(description="Cli tool for manipulating savegame files for srb.exe", + formatter_class=argparse.RawDescriptionHelpFormatter, + epilog=f"""LEVELS include {[i['name'] for i in srb_lib.LEVELS]+list(range(0,len(srb_lib.LEVELS)))} +WEAPONS include {[i for i in srb_lib.WEAPONS if i != "undefined"]+list(range(0,16))} +""") parser.add_argument("-V","--version",action="version",version="%(prog)s " + srb_lib.srb_lib_version) parser.add_argument("-d","--debug",nargs='?',default=0,type=int,choices=range(0,11),help="Set debug level") parser.add_argument("--profile",type=int,choices=range(1,4),help="Profile in user menu.") @@ -34,6 +38,7 @@ parser.add_argument("--get-weapon",action="store_true",help="Print currently equ #choices=[i for i in srb_lib.WEAPONS if i != "undefined"]+list(range(0,16)) #parser.add_argument("--set-weapon",choices=[i for i in srb_lib.WEAPONS if i != "undefined"],help="Print currently equipped weapon for profile.") parser.add_argument("--set-weapon",help="Print currently equipped weapon for profile.") +parser.add_argument("--get-level",help="Print status for this level for profile.") parser.add_argument("--checksum",action=argparse.BooleanOptionalAction,default=True,help="Correct checksum. Default is to do this. It happens at the end of everything else.") parser.add_argument("file",default="Profile 1.sav") args = parser.parse_args() @@ -49,9 +54,10 @@ if debuglev(8,debuglevel): # common parameters profile_id = args.profile -print(f"profile_id={profile_id}") +#print(f"profile_id={profile_id}") -if not profile_id and (args.get_money or args.set_money or args.get_weapon or args.set_weapon): +# WORKHERE: new actions that need --profile must be added here. +if not profile_id and (args.get_money or args.set_money or args.get_weapon or args.set_weapon or args.get_level): ferror("Warning: Cannot perform most actions without --profile. Not all tasks may run.") else: if args.get_money: @@ -76,6 +82,8 @@ else: pass else: srb_lib.write_file(args.file,0,data) + if args.get_level: + print(f"Profile {profile_id} has level {args.get_level} status {srb_lib.get_level_status(args.file,profile_id,args.get_level)}") if args.checksum: f = args.file |