WoW:API GetFriendInfo: Difference between revisions

no edit summary
mNo edit summary
No edit summary
Line 1: Line 1:
<center>'''GetFriendInfo''' - ''Documentation by [[user:Author|IonDefender]]''</center>
<center>'''GetFriendInfo''' - ''Documentation by [[user:Author|IonDefender]]''</center>


Gets the name, level, class, location and status of a friend
Gets the name, level, class, location, connection, status of a friend


  name, level, class, area, connected = GetFriendInfo(friendIndex)
  name, level, class, area, connected, status = GetFriendInfo(friendIndex)
== Parameters ==
== Parameters ==
=== Arguments ===
=== Arguments ===
Line 17: Line 17:
:;area : String - Friend's current location ("Unknown" if index is out of bounds or friend is offline).
:;area : String - Friend's current location ("Unknown" if index is out of bounds or friend is offline).
:;connected : Flag - 1 if friend is online, nil if not online (or index out of bounds).
:;connected : Flag - 1 if friend is online, nil if not online (or index out of bounds).
:;status : String - Friends current status (IE AFK/etc found by [[User:Tigerheart|Tigerheart]]).
== Example ==
== Example ==
<!-- begin code -->
<!-- begin code -->
  local name, level, class, loc = GetFriendInfo(1);
  local name, level, class, loc, connected, status = GetFriendInfo(1);
  DEFAULT_CHAT_FRAME:AddMessage("Your friend "..name.." (The level "..level.." "..class..") is in "..loc..".");
  DEFAULT_CHAT_FRAME:AddMessage("Your "..status.." friend "..name.." (The level "..level.." "..class..") is in "..loc..".");
<!-- end code -->
<!-- end code -->
==== Result ====
==== Result ====
<!-- begin code -->
<!-- begin code -->
  Your friend Bill (The level 99 Leprechaun) is in Neverland.
  Your <AFK> friend Bill (The level 99 Leprechaun) is in Neverland.
<!-- end code -->
<!-- end code -->


Anonymous user