WoW:API GetFriendInfo: Difference between revisions

Line 5: Line 5:
== Parameters ==
== Parameters ==
=== Arguments ===
=== Arguments ===
:;friendIndex : Integer - Index of friend in the friend list (Note that status changes can re-order the friend list, indexes are not guaranteed to remain stable across events).
:;friendIndex : Integer - Index of friend in the friend list (Note that status changes can re-order the friend list, indexes are not guaranteed to remain stable across events) (Also note that index should not be greater than 50 [see Notes]).
 
=== Returns ===
=== Returns ===
:;name : String - Friend's name, or nil (if index is invalid)
:;name : String - Friend's name, or nil (if index is invalid)
Line 26: Line 27:
==Notes==
==Notes==
Friend information isn't necessarily automatically kept up to date. You can use the [[API ShowFriends|ShowFriends]] function to request an update from the server.
Friend information isn't necessarily automatically kept up to date. You can use the [[API ShowFriends|ShowFriends]] function to request an update from the server.
Do not use indexes greater than 50 (the maximum number of friend list entries)!
In some AddOn constellations I got WoW crashing by typing "/script GetFriendInfo(51)" (especially if FlagRSP was activated).
This crash leads to ERROR #132 (memory could not be "read").
Please use GetNumFriends() to iterate over all indexes securely.
Anonymous user