WoWInterface

WoWInterface (https://www.wowinterface.com/forums/index.php)
-   Lua/XML Help (https://www.wowinterface.com/forums/forumdisplay.php?f=16)
-   -   BNGetFriendInfo issue (https://www.wowinterface.com/forums/showthread.php?t=55920)

Sythalin 12-15-17 03:42 PM

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?

Fizzlemizz 12-15-17 04:15 PM

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.

Sythalin 12-15-17 05:56 PM

Quote:

Originally Posted by Fizzlemizz (Post 326157)
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! :banana:


All times are GMT -6. The time now is 09:53 PM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2004 - 2022 MMOUI