API BNGetGameAccountInfo

From Wowpedia
Jump to: navigation, search

Returns information about the specified toon of a RealID friend.

hasFocus, characterName, client, realmName, realmID, faction, race, class, guild, zoneName, level, gameText, broadcastText, broadcastTime, canSoR, toonID, bnetIDAccount, isGameAFK, isGameBusy  = BNGetGameAccountInfo(bnetIDGameAccount)

Arguments

bnetIDGameAccount 
Number - A unique numeric identifier for the friend during this session.

Returns

hasFocus 
Boolean - Whether or not this toon is the one currently being displayed in Blizzard's FriendFrame.
characterName 
String - The name of the logged in toon/character.
client 
String - Either "WoW" (BNET_CLIENT_WOW), "S2" (BNET_CLIENT_S2), "WTCG" (BNET_CLIENT_WTCG), "App" (BNET_CLIENT_APP), "Hero" (BNET_CLIENT_HEROES), "Pro" (BNET_CLIENT_OVERWATCH), "CLNT" (BNET_CLIENT_CLNT), or "D3" (BNET_CLIENT_D3) for World of Warcraft, StarCraft 2, Hearthstone, BNet Application, Heroes of the Storm, Overwatch, another client, or Diablo 3.
realmName 
String - The name of the logged in realm.
realmID 
Number - The ID for the logged in realm.
faction 
String - The faction name (i.e., "Alliance" or "Horde").
race 
String - The localized race name (e.g., "Blood Elf").
class 
String - The localized class name (e.g., "Death Knight").
guild 
String - Seems to return "" even if the player is in a guild.
zoneName 
String - The localized zone name (e.g., "The Undercity").
level 
String - The current level (e.g., "90").
gameText 
String - For WoW, returns "zoneName - realmName". For StarCraft 2 and Diablo 3, returns the location or activity the player is currently engaged in.
broadcastText 
String - The Battle.Net broadcast message.
broadcastTime 
Number - The number of seconds elapsed since the current broadcast message was sent.
canSoR 
Boolean - Whether or not this friend can receive a Scroll of Resurrection.
toonID 
Number - A unique numeric identifier for the friend's character during this session.
bnetIDAccount 
Number -
isGameAFK 
Boolean -
isGameBusy 
Boolean -

Example

local bnetIDGameAccount = select(6,BNGetFriendInfo(1)) -- assuming friend index 1 is me (Grdn)
local _, characterName, _, realmName = BNGetGameAccountInfo(bnetIDGameAccount)
print(toonName.." plays on "..realmName)

Result

Grdn plays on Onyxia

Patch changes

  • Warlords of Draenor Patch 6.2.4 (2016-03-22): API Changed from BNGetToonInfo to BNGetGameAccountInfo.
  • Mists of Pandaria Patch 5.0.4 (2012-08-28): Returns changed: faction is now a string. canSoR and toonID added.

See also