LibMultiAccountAchievements

Developer Reference

Table of Contents

  1. Getting Started
  2. Functions

Getting Started

First, add LibMultiAccountAchievements (LMAA) as a dependency in your addon's manifest:

## DependsOn: LibMultiAccountAchievements

The library can be accessed via the LibMultiAccountAchievements global variable, and it is recommended that you localize it for usage; for example:

local LMAA = LibMultiAccountAchievements

Functions

The following functions mirror (and behave identically to) their counterparts found in the in-game API, except with the added owner parameter:

LMAA.GetAchievementProgress( owner, achievementId )
LMAA.GetAchievementTimestamp( owner, achievementId )
LMAA.IsAchievementComplete( owner, achievementId )
LMAA.GetAchievementCriterion( owner, achievementId, criterionIndex )
LMAA.GetAchievementLink( owner, achievementId, linkStyle )

If owner is a string, it is treated as a character ID, and the returned result will be for that character (if the achievement is character-specific) or for the account associated with that character (if the achievement is account-wide).

If owner is a table of strings in the form of { server, account }; the returned result will be for the specified account (if the achievement is account-wide). If server is nil, the current server is assumed.

If owner is omitted (nil), the returned result will be for the current character (if the achievement is character-specific) or for the current account on the current server (if the achievement is account-wide).

Retrieve a list of all the servers for which data is available:

LMAA.GetServers( )

Returns: A table of strings

Retrieve a list of all the accounts for which data is available:

LMAA.GetAccounts( )

Returns: A table of tables, where each table contains two strings in the form of { server, account }

Retrieve a list of all the characters for which data is available:

LMAA.GetCharacters( server, account )

If server is a string, characters from the specified server will be included in the return. If it is a boolean true, characters from the current server will be included in the return. If it is omitted (nil), characters from all servers will be included in the return.

If account is a string, characters from the specified account will be included in the return. If it is a boolean true, characters from the current account will be included in the return. If it is omitted (nil), characters from all accounts will be included in the return.

Returns: A table of tables, where each table contains four strings in the form of { charId, server, account, charName }

Retrieve the server, @account name, and character name associated with a particular character ID:

LMAA.GetCharacterInfo( charId )

If charId (string) is omitted (nil), the current character is assumed.

Returns: server, accountName, characterName

The return is nil if there is no data available for the specified character.

Get the highest valid achievement ID:

LMAA.GetMaxAchievementId( )