m
Move page script moved page API GetBattlefieldScore to WoW:API GetBattlefieldScore without leaving a redirect
(changed argument "filename" to "classToken" as thats more accurate and consistant with other API pages) |
m (Move page script moved page API GetBattlefieldScore to WoW:API GetBattlefieldScore without leaving a redirect) |
||
| (2 intermediate revisions by 2 users not shown) | |||
| Line 12: | Line 12: | ||
---- | ---- | ||
=== Returns === | === Returns === | ||
:name, killingBlows, honorKills, deaths, honorGained, faction, rank, race, class, classToken, damageDone, healingDone | :name, killingBlows, honorKills, deaths, honorGained, faction, rank, race, class, classToken, damageDone, healingDone, bgRating, ratingChange | ||
:;name : String - The player's name, with their server name attached if from a different server to the player. | :;name : String - The player's name, with their server name attached if from a different server to the player. | ||
| Line 26: | Line 26: | ||
:;damageDone: Integer - The amount of damage done. | :;damageDone: Integer - The amount of damage done. | ||
:;healingDone: Integer - The amount of healing done. | :;healingDone: Integer - The amount of healing done. | ||
:;bgRating: Integer - The players current battleground rating. (0 if not rated) | |||
:;ratingChange: Integer - The rating change (0 if not rated) | |||
---- | |||
=== Example === | |||
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 | |||
<br><center>''Last updated: Patch 2.0''</center> | <br><center>''Last updated: Patch 2.0''</center> | ||