# DataType:achievementcat

Provides access to achievement categories. Achievements are organized hierarchically in the achievements window by categories.

While not required to access achievements, categories may be useful for enumerating lists of achievements.

## Members

| **Type**                                                                                                       | **Member**                      | **Description**                                                                                                                                                                                                         |
| -------------------------------------------------------------------------------------------------------------- | ------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [*int*](/macroquest/data-types-and-top-level-objects/data-types/datatype-int.md)                               | **ID**                          | The unique ID for the category                                                                                                                                                                                          |
| \_\_[*string*](/macroquest/data-types-and-top-level-objects/data-types/datatype-string.md)\_\_                 | **Name**                        | The category's display name                                                                                                                                                                                             |
| [*string*](/macroquest/data-types-and-top-level-objects/data-types/datatype-string.md)\_\_                     | **Description**                 | The category's description                                                                                                                                                                                              |
| \_\_[*achievement*](/macroquest/data-types-and-top-level-objects/data-types/datatype-achievement.md)\_\_       | **Achievement\[**#\|*Name***]** | Find an achievement in this category by its ID or name.                                                                                                                                                                 |
| \_\_[*achievement*](/macroquest/data-types-and-top-level-objects/data-types/datatype-achievement.md)\_\_       | **AchievementByIndex\[**#**]**  | Find an achievement by its index in this category.                                                                                                                                                                      |
| [*int*](/macroquest/data-types-and-top-level-objects/data-types/datatype-int.md)                               | **AchievementCount**            | The number of achievements in this category.                                                                                                                                                                            |
| \_\_[*achievementcat*](/macroquest/data-types-and-top-level-objects/data-types/datatype-achievementcat.md)\_\_ | **Category\[**#\|*Name***]**    | Find a child category in this category by its ID or name.                                                                                                                                                               |
| \_\_[*achievementcat*](/macroquest/data-types-and-top-level-objects/data-types/datatype-achievementcat.md)\_\_ | **CategoryByIndex**             | Find a child category by its index in this category.                                                                                                                                                                    |
| [*int*](/macroquest/data-types-and-top-level-objects/data-types/datatype-int.md)                               | **CategoryCount**               | The number of child categories in this category.                                                                                                                                                                        |
| [*int*](/macroquest/data-types-and-top-level-objects/data-types/datatype-int.md)                               | **Points**                      | The total earned points of achievements in this category.                                                                                                                                                               |
| [*int*](/macroquest/data-types-and-top-level-objects/data-types/datatype-int.md)                               | **CompletedAchievements**       | The number of achievements earned in this category and its subcategories                                                                                                                                                |
| [*int*](/macroquest/data-types-and-top-level-objects/data-types/datatype-int.md)                               | **TotalAchievements**           | The total number of achievements in this category and its subcategories.                                                                                                                                                |
| [*string*](/macroquest/data-types-and-top-level-objects/data-types/datatype-string.md)\_\_                     | **ImageTextureName**            | Name of the image texture that is used to represent this category in the Achievements Window.                                                                                                                           |
| [*int*](/macroquest/data-types-and-top-level-objects/data-types/datatype-int.md)                               | **Index**                       | The index of the category in the achievement manager. For more information see [Achievement Indices](/macroquest/data-types-and-top-level-objects/top-level-objects/tlo-achievement.md#note-about-achievement-indices). |

### Examples

List the unearned achievements in the **EverQuest / Exploration** category:

{% tabs %}
{% tab title="MQScript" %}

```
/declare cat achievementcat local
/vardata cat Achievement.Category[EverQuest].Category[Exploration]

/echo Unearned achievements in the ${cat.Name} category:
/declare i int local
/for i 1 to ${cat.AchievementCount} {
    /if (!${cat.AchievementByIndex[${i}].Completed}) {
        /echo ${cat.AchievementByIndex[${i}].Name}
    }
    /next i
}
```

{% endtab %}

{% tab title="Lua" %}

```lua
local category = mq.TLO.Achievement.Category('EverQuest').Category('Exploration')
for i = 1, category.AchievementCount() do
    local achievement = category.AchievementByIndex(i)
    if not achievement.Completed() then
        print(achievement.Name())
    end
end
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://macroquest.gitbook.io/macroquest/data-types-and-top-level-objects/data-types/datatype-achievementcat.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
