I use the FRIENDS_LIST_MANAGER for this, e.g.
Code:
local masterList = FRIENDS_LIST_MANAGER:GetMasterList()
for _, friend in ipairs(masterList) do
if (friend.online) then
-- do something
elseif (friend.status == _G.PLAYER_STATUS_OFFLINE) then
-- do something else
else
-- might be afk, eg.
end
end
If you just need a single player you could instead use:
Code:
local friendData = FRIENDS_LIST_MANAGER:FindDataByDisplayName(displayName)
That will give you all kinds of info like zone, alliance, level, online status ...