Difference between revisions of "Drop rates/Script"

From Wildermyth Wiki
m
m
 
Line 166: Line 166:
! Name !! Type !! Effective drop rate
! Name !! Type !! Effective drop rate
'''
'''
for cat in itemList:
for cat in weaponWeights:
   if cat in categoryNames:
   for weapon in itemList[cat]:
    for weapon in itemList[cat]:
    line = '|-\n| [[%s]] || %s || %.3f \n'%(itemList[cat][weapon],categoryNames[cat],weaponWeights[cat]/categoryDividend[cat])
      line = '|-\n| [[%s]] || %s || %.3f \n'%(itemList[cat][weapon],categoryNames[cat],weaponWeights[cat]/categoryDividend[cat])
     weaponTable += line
      weaponTable += line
'''
for cat in itemList:
  if cat not in categoryNames:
     for weapon in itemList[cat]:
      line = '|-\n| %s || [[%s]] || %.3f \n'%(rootNames[cat],itemList[cat][weapon],(itemWeights[cat]/categoryDividend[cat]))
      weaponTable += line
'''
weaponTable += '|-\n|}\n'
weaponTable += '|-\n|}\n'



Latest revision as of 08:50, 27 May 2022

This is a Python script to generate the Drop rates tables. Copy the code in the box below into a text file named wikiDropRates.py (or whatever you want) inside the Wildermyth directory. Then run it by calling python wikiDropRates.py from the command line.[1] It will create a text file named wikiDropRates.txt with the appropriate wiki-formatted content.

  1. More precisely, you can put the script anywhere, but you need to call it from the Wildermyth directory.