Difference between revisions of "Monster stats/Script"

From Wildermyth Wiki
m
m
 
Line 1: Line 1:
This is a [https://www.python.org/downloads/ Python] script to generate the [[monster stat]] tables. Copy the code in the box below into a text file named '''<nowiki>monsterStats.py</nowiki>''' (or whatever you want) inside the '''<nowiki>Wildermyth</nowiki>''' directory. Then run it by calling '''<nowiki>python monsterStats.py</nowiki>''' from the command line. It will create a text file for each difficulty named '''<nowiki>monsterStats_<difficulty>.txt</nowiki>''', full of wiki-formatted tables that can be pasted into the appropriate wiki pages.
This is a [https://www.python.org/downloads/ Python] script to generate the [[monster stat]] tables. Copy the code in the box below into a text file named '''<nowiki>wikiMonsterStats.py</nowiki>''' (or whatever you want) inside the '''<nowiki>Wildermyth</nowiki>''' directory. Then run it by calling '''<nowiki>python wikiMonsterStats.py</nowiki>''' from the command line. It will create a text file for each difficulty named '''<nowiki>wikiMonsterStats_<difficulty>.txt</nowiki>''', full of wiki-formatted tables that can be pasted into the appropriate wiki pages.


{| role="presentation" class="wikitable mw-collapsible mw-collapsed"
{| role="presentation" class="wikitable mw-collapsible mw-collapsed"
| '''<nowiki>monsterStats.py</nowiki>'''
| '''<nowiki>wikiMonsterStats.py</nowiki>'''
|-
|-
|
|
Line 102: Line 102:
   string += '==Notes==\nLast updated [[%s]] using [[Monster stats/Script|this script]].\n'%version[:-1]
   string += '==Notes==\nLast updated [[%s]] using [[Monster stats/Script|this script]].\n'%version[:-1]
    
    
   with open('monsterStats_%s.txt'%diff, 'w') as f:
   with open('wikiMonsterStats_%s.txt'%diff, 'w') as f:
     f.write(string)</nowiki>
     f.write(string)</nowiki>
|}
|}

Latest revision as of 13:38, 5 March 2022

This is a Python script to generate the monster stat tables. Copy the code in the box below into a text file named wikiMonsterStats.py (or whatever you want) inside the Wildermyth directory. Then run it by calling python wikiMonsterStats.py from the command line. It will create a text file for each difficulty named wikiMonsterStats_<difficulty>.txt, full of wiki-formatted tables that can be pasted into the appropriate wiki pages.