UnitTokenFromGUID

From Warcraft Wiki
Jump to navigation Jump to search

Finds a unit token that maps to the supplied unit GUID.

unitToken = UnitTokenFromGUID(unitGUID)

Arguments

unitGUID
string : GUID - A unit GUID to query.

Returns

unitToken
string? : UnitId - A unit token that matches the supplied unit GUID if one can be found, or nil if not.

Details

  • The return from this function is inherently unstable and may change during processing of UI events or across frames. If storing the result of this function in a table or upvalue, you should confirm before using the stored unit token that it still maps to the unit GUID that was initially requested.
  • Internally this function will iterate over a list of unit tokens to find a matching candidate. Unit tokens will be tested in the order given below, returning the first one that matches.
  1. player
  2. vehicle
  3. pet
  4. party<x>
  5. partypet<x>
  6. raid<x>
  7. raidpet<x>
  8. nameplate<x>
  9. arena<x>
  10. arenapet<x>
  11. boss<x>
  12. target
  13. focus
  14. npc
  15. mouseover
  16. softenemy
  17. softfriend
  18. softinteract

Patch changes