Save and Load shoddybattle(1) Teams - Jython

rory

T^T
is a Site Content Manager Alumnusis a Battle Simulator Moderator Alumnus
This is a small Jython script with save_team and load_team functions for shoddybattle 1 teams. Included in the .zip is:


  • shoddy.py - The jython script. Just import the functions from this
  • shoddybattle.jar - From shoddybattle source, compiled jar. This must be in your import path. (you can add it to sys.path)
  • mechanics.jar - Same as above

load_team takes a filename (or java.io.File) as an argument and returns a list of pokemon as dicts in the following format:

Code:
            {'species': p.getSpeciesName(),
             'nature': p.getNature().getName(),
             'ability': p.getOriginalAbilityName(),
             'item': p.getOriginalItemName(),
             'gender': p.getGender(),
             'level': p.getLevel(),
             'ivs': tuple(p.getIv(i) for i in xrange(6)),
             'evs': tuple(p.getEv(i) for i in xrange(6)),
             'moves': tuple(p.getMove(i).getName() for i in xrange(4)),
             'ppup': tuple(p.getPpUpCount(i) for i in xrange(4))}
save_team takes a filename (or java.io.File) and a team (as a list of dicts in the format described) .

Here's the source in case you just feel like building those .jars yourself.

With this I'll definitely write a batch convert program for sb1 teams -> sb2 teams.
 

Super

This space for rent
is a Battle Simulator Admin Alumnusis a Programmer Alumnusis a Forum Moderator Alumnus
With this I'll definitely write a batch convert program for sb1 teams -> sb2 teams.
Actually, ShoddyBattle 2 already supports SB1 teams.

Cool beans though. If I recall, some ShoddyBattle 1 teams crapped on my Shoddy2 build, older ones, and the Shoddy2 format is infinitely nicer than the Shoddy1 format. A batch convert could still have a use (sure beats load->save load->save load->save).

EDIT: Also I want to learn Python so I'll definitely take a look at your code.
 

Users Who Are Viewing This Thread (Users: 1, Guests: 0)

Top