Heya, It seem to be more WoW/LUA spcific question, but still - maybe someone aware about it: How to really get the BattleNet given/surname of the friend? All "BNGetXXX" functions returns these as WoW escape sequences (|Kg9|k for example), and I was not able to find the final answer how to parse it to real name... Of course, it would be even better if this one could be obtained with HB API, but LUA will work for me as well. Thank you, Me.
Code: Lua.Events.AttachEvent("CHAT_MSG_BN_WHISPER", HandleBNWhisper); .... void HandleBNWhisper(object sender, LuaEventArgs args) { string message = args.Args[0].ToString(); string presenceId = args.Args[12].ToString(); string senderName = Lua.GetReturnVal<string>(string.Format("return BNGetFriendInfoByID({0})", presenceId), 3); }
docs/api/BNGetFriendInfoByID - World of Warcraft Programming: A Guide and Reference for Creating WoW Addons Code: string firstName= Lua.GetReturnVal(string.Format("return BNGetFriendInfoByID({0})", presenceId), 1); string lastName= Lua.GetReturnVal(string.Format("return BNGetFriendInfoByID({0})", presenceId), 2); or Code: var result = Lua.GetReturnValues(string.Format("return BNGetFriendInfoByID({0})", presenceId)); string firstName = result[1]; string lastName = result[2]; string charName = result[3];
These strings are escape sequences in form |K[gsf]\d|k, there is no real text in it, i.e. no name/surname. These are only becomes visible when WoW renders it on screen.