View Single Post
01/03/24, 12:08 PM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,999
You can only get the characterIds and their names, but no bags, items, achievements (afaik), or any other info while not having those characters logged in.
Here is an example function how to retrieve that from my addon FCOItemSaver with 2 possibilities to create a table with different keys:
Lua Code:
  1. --Function to get all characters of the currently logged in @account: server's unique characterID and non unique name.
  2. --Returns a table:nilable with 2 possible variants, either the character ID is key and the name is the value,
  3. --or vice versa.
  4. --Parameter boolean, keyIsCharName:
  5. -->True: the key of the returned table is the character name
  6. -->False: the key of the returned table is the unique character ID (standard)
  7. function FCOIS.GetCharactersOfAccount(keyIsCharName)
  8.     keyIsCharName = keyIsCharName or false
  9.     local charactersOfAccount
  10.     --Check all the characters of the account
  11.     for i = 1, GetNumCharacters() do
  12.         local name, _, _, _, _, _, characterId = GetCharacterInfo(i)
  13.         local charName = zo_strformat(SI_UNIT_NAME, name)
  14.         if characterId ~= nil and charName ~= "" then
  15.             if charactersOfAccount == nil then charactersOfAccount = {} end
  16.             if keyIsCharName then
  17.                 charactersOfAccount[charName]   = characterId
  18.             else
  19.                 charactersOfAccount[characterId]= charName
  20.             end
  21.         end
  22.     end
  23.     return charactersOfAccount
  24. end



Therefor several libraries have been created, or addons, like
Inventory Insight from Ashes, What pledges at my alts, LibCharacterKnowledge, etc.
which store that other char's data in the SavedVariables so you can have a look at that from your currently logged in char.

Last edited by Baertram : 01/03/24 at 12:14 PM.
  Reply With Quote