SuperGouge / HearthheadCollectionManager

Import and export your Hearthhead collection from and to Hearthstone Collection Tracker plugin for Hearthstone Deck Tracker
2 stars 0 forks source link

The "Hearthstone Collection Tracker" export button #4

Closed KayaTheRock closed 9 years ago

KayaTheRock commented 9 years ago

The "Hearthstone Collection Tracker" plugin does not have the export button anymore.

So I made a tiny python script to convert the xml file so we can copy paste the list of cardId.

You run it under "\AppData\Roaming\HearthstoneDeckTracker\CollectionTracker" and copy the string in "Collection_Default.txt"

Hope this helps someone

Python code:

import xml.etree.ElementTree as ET

tree = ET.parse('Collection_Default.xml') root = tree.getroot()

result = ""

for CardInCollection in root.iter('CardInCollection'): cardId = CardInCollection.find('CardId').text AmountNG = CardInCollection.find('AmountNonGolden').text AmountG = CardInCollection.find('AmountGolden').text

print ( cardId + ":" + AmountNG + ":" + AmountG )

result += ( cardId + ":" + AmountNG + ":" + AmountG + ";")

f = open(r"Collection_Default.txt", mode = "wt" ) f.write(result)

SuperGouge commented 9 years ago

If you do not update the plugin and keep my fork you will still have the button. However, I'll convert what I did into something usable without any userscript and make a pull request onto his branch when I get the time.

KayaTheRock commented 9 years ago

thanks for the tool BTW, helps a lot.

Yeah, it would be nice to have the export in the main branch so we can update normally.