Thread Tools Display Modes
12-15-17, 03:42 PM   #1
Sythalin
Curse staff
 
Sythalin's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 680
Question BNGetFriendInfo issue

Code:
-- get number of online friends
local _,num=BNGetNumFriends()

-- cycle through friends to find "Bob"
for i=1,num do
    local id,name=BNGetFriendInfo(i)
    if (name=="Bob") then
        BNSendWhisper(id, "Hi Bob!")
    else
        print("Bob is not online.")
    end
end
Even if Bob is online, it never sends him the message and goes to "Bob is not online." Any ideas?
  Reply With Quote
12-15-17, 04:15 PM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,871
If you save the name to a saved variable you'll find it's for all intents and purposes, junk. You should use the BattleTagId.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
12-15-17, 05:56 PM   #3
Sythalin
Curse staff
 
Sythalin's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 680
Originally Posted by Fizzlemizz View Post
If you save the name to a saved variable you'll find it's for all intents and purposes, junk. You should use the BattleTagId.
Swapped to compare this instead and works as intended. Thanks!
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » BNGetFriendInfo issue

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off