damoster / royale_clan_card_level_ranker_bot

Discord bot which ranks members in a specific clan according to how many cards of a certain level they have. Comparison starts from number of level 13 cards they have. If it's a tie, card count of the next card level lower is used (e.g. level 12 card count) and so on. This is useful for deciding order of players for boat defenses in clan wars 2.0
MIT License
2 stars 0 forks source link

Make ranking based on troops only #5

Closed damoster closed 3 years ago

damoster commented 3 years ago

Add an enum argument to specify what to rank on. E.g.

!membercardsranked 9GULPJ9L troops

Would rank based on troop cards only. I.e. exclude spells/buildings.

Might need to hardcode a lookup dict for what card is what card type. Doesn't look like royale API actually distinguishes what type each card is. But double check if that's actually the case https://developer.clashroyale.com/#/documentation

Some format ideas

# card_level_counts = { 13: { 'totalCount': 'spellCount': x, 'buildingCount': y, 'troopCount': z }, etc. }
# OR
# card_level_counts = { "totalCount": {13: 22, 12: 14, etc.}, "troopCount": {13: 12, 12: 10, etc.}, etc.}
josephwccheng commented 3 years ago

card_level_counts = { "totalCount": {13: 22, 12: 14, etc.}, "troopCount": {13: 12, 12: 10, etc.}, etc.}

I am going to go with this approach

josephwccheng commented 3 years ago

adding file in resources/data/card_types.json with the following schema to perform the filter

{ 2600000: 'troop', # Knight 2600001: 'troop', # Archers ... 28000002: 'spell', # Rage }