→ WoW API
Returns information about a player's score in battlegrounds.
name, killingBlows, honorKills, deaths, honorGained, faction, rank, race, class, filename, damageDone, healingDone = GetBattlefieldScore(index);
Parameters[edit | edit source]
Arguments[edit | edit source]
- ( index )
- Integer - The characters index in battlegrounds.
Returns[edit | edit source]
- name, killingBlows, honorKills, deaths, honorGained, faction, rank, race, class, classToken, damageDone, healingDone, bgRating, ratingChange
- String - The player's name, with their server name attached if from a different server to the player.
- Integer - Number of killing blows.
- Integer - Number of honourable kills.
- Integer - The number of deaths.
- Integer - The amount of honour gained so far (Bonus Honour).
- Integer - (Battlegrounds: Horde = 0, Alliance = 1 / Arenas: Green Team = 0, Yellow Team = 1).
- Integer - The players rank (0 - 14).
- String - The players race (Orc, Undead, Human, etc).
- String - The players class (Mage, Hunter, Warrior, etc).
- String - The player's class name in english given in all capitals (MAGE , HUNTER, WARRIOR, etc)
- Integer - The amount of damage done.
- Integer - The amount of healing done.
- Integer - The players current battleground rating. (0 if not rated)
- Integer - The rating change (0 if not rated)
Example[edit | edit source]
How to count the number of players in each faction.
local numScores = GetNumBattlefieldScores() local numHorde = 0 local numAlliance = 0 for i=1, numScores do name, killingBlows, honorableKills, deaths, honorGained, faction, rank, race, class = GetBattlefieldScore(i); if ( faction ) then if ( faction == 0 ) then numHorde = numHorde + 1 else numAlliance = numAlliance + 1 end end end
Community content is available under CC-BY-SA unless otherwise noted.