Difference between revisions of "User:Sten/Legacy to spreadsheet"

From Wildermyth Wiki
Line 1: Line 1:
This is a [https://www.python.org/downloads/ Python] script to export a player's legacy into a spreadsheet. Copy the code in the box below into a text file named '''<nowiki>legacy_table.py</nowiki>''' (or whatever you want) inside the '''<nowiki>Wildermyth/Players/<player ID></nowiki>''' directory. Then run it by calling '''<nowiki>python legacy_table.py</nowiki>''' from the command line. It will create a text file called '''<nowiki>legacy_table.txt</nowiki>''', which is tab-delimited and can be loaded by any spreadsheet software or viewed in a text editor.
This is a [https://www.python.org/downloads/ Python] script to export a player's legacy into a spreadsheet.
 
==Usage==
 
Copy the code in the box below into a text file named '''<nowiki>legacy_table.py</nowiki>''' (or whatever you want) inside the '''<nowiki>Wildermyth/Players/<player ID></nowiki>''' directory. Then run it by calling '''<nowiki>python legacy_table.py</nowiki>''' from the command line. It will create a text file called '''<nowiki>legacy_table.txt</nowiki>''', which is tab-delimited and can be loaded by any spreadsheet software or viewed in a text editor.


{| role="presentation" class="wikitable mw-collapsible mw-collapsed"
{| role="presentation" class="wikitable mw-collapsible mw-collapsed"
Line 124: Line 128:
     f.write('%s\t%s\t%d\t%d\t'%(name,playables[i],tiers[i],hooks[i]) + ', '.join(themes[i]) + '\t' + ', '.join(weapons[i]) + '\t' + offhands[i] + '\t' + ', '.join(abilities[i]) + '\n')</nowiki>
     f.write('%s\t%s\t%d\t%d\t'%(name,playables[i],tiers[i],hooks[i]) + ', '.join(themes[i]) + '\t' + ', '.join(weapons[i]) + '\t' + offhands[i] + '\t' + ', '.join(abilities[i]) + '\n')</nowiki>
|}
|}
==Output==


'''This script does ''not'' make any changes to the legacy.'''
'''This script does ''not'' make any changes to the legacy.'''


The following fields appear in the output table:
The following fields appear in the output table ('''<nowiki>legacy_table.txt</nowiki>'''):
* Name
* Name
* Playable (Y/N)
* Playable (Y/N)

Revision as of 08:39, 15 February 2022

This is a Python script to export a player's legacy into a spreadsheet.

Usage

Copy the code in the box below into a text file named legacy_table.py (or whatever you want) inside the Wildermyth/Players/<player ID> directory. Then run it by calling python legacy_table.py from the command line. It will create a text file called legacy_table.txt, which is tab-delimited and can be loaded by any spreadsheet software or viewed in a text editor.

Output

This script does not make any changes to the legacy.

The following fields appear in the output table (legacy_table.txt):

  • Name
  • Playable (Y/N)
  • Legacy tier
  • Number of hooks resolved
  • Themes
  • Weapons
  • Offhand items
  • Abilities

Example

Example image
Example legacy export, viewed in Microsoft Excel