API:GetFriendsList
From RoR Wiki
UI Lua API · Social functions
Version: WAR 1.4.8
Returns the player's friends list.
friends = GetFriendsList()
Arguments
None.
Returns
- friends
table– Array of friend tables, indexed from 1. Empty if the list is empty.
Each friend table has these fields:
| Key | Type | Meaning |
|---|---|---|
name |
wstring |
Character name. |
rank |
number |
Character rank (level). |
careerID |
number |
Career id. |
careerName |
wstring |
Career name. The stock UI treats L"" as "details unknown" and hides the rank.
|
zoneID |
number |
Zone the friend is in. The stock UI treats 0 as offline. |
guildName |
wstring |
Guild name. |
Details
- The list is the client's copy; the function does not contact the server.
- GetIgnoreList returns the same fields for the ignore list.
- A new table is built on every call.
Errors
None.
Example
From default/ea_socialwindow/source/socialwindowbuddylisttabfriends.lua:
local FriendsListData = GetFriendsList()
if ( FriendsListData ~= nil ) then
for key, value in ipairs( FriendsListData ) do
-- These should match the data that was retrived from war_interface::LuaGetFriendsList
SocialWindowBuddyListTabFriends.playerListData[key] = {}
SocialWindowBuddyListTabFriends.playerListData[key].name = value.name
SocialWindowBuddyListTabFriends.playerListData[key].friendType = FRIENDTYPE.FRIENDED
SocialWindowBuddyListTabFriends.playerListData[key].isOnline = ( value.zoneID ~= 0 )
...
