Returns a list of character names which complete a given partial name prefix


See also Utility functions.

Signature:

... = GetAutoCompleteResults("inputString", includeBitfield, excludeBitfield, maxResults [, cursorPosition])

Arguments:

  • inputString - Partial name for which to return completions (string)

  • includeBitfield - One or more of the following flags (combined via bit.bor()), indicating which characters should be included in the result list: (number, bitfield)

    • 0x00000000 - AUTOCOMPLETE_FLAG_NONE: No characters
    • 0x00000001 - AUTOCOMPLETE_FLAG_IN_GROUP: Characters in the player's party or raid
    • 0x00000002 - AUTOCOMPLETE_FLAG_IN_GUILD: Characters in the player's guild
    • 0x00000004 - AUTOCOMPLETE_FLAG_FRIEND: Characters from the player's friends list
    • 0x00000010 - AUTOCOMPLETE_FLAG_INTERACTED_WITH: Characters with whom the player has recently interacted
    • 0x00000020 - AUTOCOMPLETE_FLAG_ONLINE: Currently online friends and guildmates
    • 0xffffffff - AUTOCOMPLETE_FLAG_ALL: All characters

  • excludeBitfield - One or more of the following flags (combined via bit.bor()), indicating which characters should be excluded from the result list: (number, bitfield)

    • 0x00000000 - AUTOCOMPLETE_FLAG_NONE: No characters
    • 0x00000001 - AUTOCOMPLETE_FLAG_IN_GROUP: Characters in the player's party or raid
    • 0x00000002 - AUTOCOMPLETE_FLAG_IN_GUILD: Characters in the player's guild
    • 0x00000004 - AUTOCOMPLETE_FLAG_FRIEND: Characters from the player's friends list
    • 0x00000010 - AUTOCOMPLETE_FLAG_INTERACTED_WITH: Characters with whom the player has recently interacted
    • 0x00000020 - AUTOCOMPLETE_FLAG_ONLINE: Currently online friends and guildmates
    • 0xffffffff - AUTOCOMPLETE_FLAG_ALL: All characters

  • maxResults - Maximum number of results to be returned (number)

  • cursorPosition - Cursor position in the inputString; currently unused (number)

Returns:

  • ... - A list of strings, each the name of a character matching the search parameters (list)

Examples:

-- prints up to 10 names of friends and guild members starting with "G"
print(GetAutoCompleteResults("g", bit.bor(AUTOCOMPLETE_FLAG_IN_GUILD, AUTOCOMPLETE_FLAG_FRIEND), AUTOCOMPLETE_FLAG_NONE, 10))

-- prints up to 10 names of guild members not on the friends list starting with "G"
print(GetAutoCompleteResults("g", AUTOCOMPLETE_FLAG_IN_GUILD, AUTOCOMPLETE_FLAG_FRIEND, 10))