# DataType:task

This is the type for your current task.

## Members

| **Type**                                                                                                           | **Member**                      | **Description**                                                                                                                                                                                                                                                                                                                  |
| ------------------------------------------------------------------------------------------------------------------ | ------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [*string*](/macroquest/data-types-and-top-level-objects/data-types/datatype-string.md)\<em>\</em>                  | **Index**                       | Returns the task's place on the tasklist                                                                                                                                                                                                                                                                                         |
| [*string*](/macroquest/data-types-and-top-level-objects/data-types/datatype-string.md)\<em>\</em>                  | **Objective\[#].Instruction**   | Returns a tasks's Objectives                                                                                                                                                                                                                                                                                                     |
| [*string*](/macroquest/data-types-and-top-level-objects/data-types/datatype-string.md)\<em>\</em>                  | **Objective\[#].Status**        | Returns the status of the objective in the format amount done Vs total IE 0/3                                                                                                                                                                                                                                                    |
| [*string*](/macroquest/data-types-and-top-level-objects/data-types/datatype-string.md)\<em>\</em>                  | **Objective\[#].Zone**          | Returns the zone the objective is to be performed in                                                                                                                                                                                                                                                                             |
| [*int*](/macroquest/data-types-and-top-level-objects/data-types/datatype-int.md)                                   | **CurrentCount**                | Returns the current count of the .Type needed to complete a objective                                                                                                                                                                                                                                                            |
| [*int*](/macroquest/data-types-and-top-level-objects/data-types/datatype-int.md)                                   | **RequiredCount**               | Returns the required count of the .Type needed to complete a objective                                                                                                                                                                                                                                                           |
| [*bool*](/macroquest/data-types-and-top-level-objects/data-types/datatype-bool.md)                                 | **Optional**                    | Returns true or false if a objective is optional                                                                                                                                                                                                                                                                                 |
| [*string*](/macroquest/data-types-and-top-level-objects/data-types/datatype-string.md)\<em>\</em>                  | **RequiredItem**                | Returns a string of the required item to complete a objective.                                                                                                                                                                                                                                                                   |
| [*string*](/macroquest/data-types-and-top-level-objects/data-types/datatype-string.md)\<em>\</em>                  | **RequiredSkill**               | Returns a string of the required skill to complete a objective.                                                                                                                                                                                                                                                                  |
| [*string*](/macroquest/data-types-and-top-level-objects/data-types/datatype-string.md)\<em>\</em>                  | **RequiredSpell**               | Returns a string of the required spell to complete a objective.                                                                                                                                                                                                                                                                  |
| [*int*](/macroquest/data-types-and-top-level-objects/data-types/datatype-int.md)                                   | **DZSwitchID**                  | Returns an int of the switch used in a objective.                                                                                                                                                                                                                                                                                |
| [*int*](/macroquest/data-types-and-top-level-objects/data-types/datatype-int.md)                                   | **ID**                          | Returns an int of the task ID                                                                                                                                                                                                                                                                                                    |
| [*string*](/macroquest/data-types-and-top-level-objects/data-types/datatype-string.md)\<em>\</em>                  | **Step**                        | Returns description of current step in the task                                                                                                                                                                                                                                                                                  |
| [*string*](/macroquest/data-types-and-top-level-objects/data-types/datatype-string.md)\<em>\</em>                  | **Select**                      | Selects the task                                                                                                                                                                                                                                                                                                                 |
| [*string*](/macroquest/data-types-and-top-level-objects/data-types/datatype-string.md)\<em>\</em>                  | **Title**                       | Returns name of the shared task                                                                                                                                                                                                                                                                                                  |
| \<em>\</em>[*timestamp*](/macroquest/data-types-and-top-level-objects/data-types/datatype-timestamp.md)\<em>\</em> | **Timer**                       | Returns amount of time before task expires                                                                                                                                                                                                                                                                                       |
| [*int*](/macroquest/data-types-and-top-level-objects/data-types/datatype-int.md)                                   | **Members**                     | Returns number of members in task                                                                                                                                                                                                                                                                                                |
| [*taskmember*](/macroquest/data-types-and-top-level-objects/data-types/datatype-task.md)                           | **Member\[**#**]**              | Returns specified member in task by index                                                                                                                                                                                                                                                                                        |
| [*taskmember*](/macroquest/data-types-and-top-level-objects/data-types/datatype-task.md)                           | **Member\[**&#x6E;am&#x65;**]** | Returns specified member in task by name                                                                                                                                                                                                                                                                                         |
| [*string*](/macroquest/data-types-and-top-level-objects/data-types/datatype-string.md)\<em>\</em>                  | **Leader**                      | Returns task leader's name                                                                                                                                                                                                                                                                                                       |
| [*int*](/macroquest/data-types-and-top-level-objects/data-types/datatype-int.md)                                   | **WindowIndex**                 | Returns the Quest Window List Index. (if the window actually has the list filled)                                                                                                                                                                                                                                                |
| [*string*](/macroquest/data-types-and-top-level-objects/data-types/datatype-string.md)\<em>\</em>                  | **Type**                        | <p>Returns a string that can be one of the following:</p><ul><li>Unknown</li><li>None</li><li>Deliver</li><li>Kill</li><li>Loot</li><li>Hail</li><li>Explore</li><li>Tradeskill</li><li>Fishing</li><li>Foraging</li><li>Cast</li><li>UseSkill</li><li>DZSwitch</li><li>DestroyObject</li><li>Collect</li><li>Dialogue</li></ul> |

## Examples

`- Task TLO can be accessed by index to make iteration possible.`\
`Example: /echo ${Task[2].Title}`\
`NOTE: THIS INDEX IS NOT THE SAME INDEX AS THE ONE YOU SEE IN THE QUEST WINDOW LIST.`\
`We are iterating through the IN MEMORY quest entries, we are NOT`\
`iterating the window list, if you want to do that, use the Window TLO.`

If you're smart don't use ${Task\[1].ID} and expect it to be whatever is the first list item. ALWAYS refer to tasks by their NAME.

`Example: /echo ${Task[3].WindowIndex}`\
`Example: /echo ${Task[Into The Muck].WindowIndex}`

`/echo ${Task[hatch].Type}`

Output: Shared (Can be Shared or Quest in this context)

The Task TLO also has a .Select "Method":

".Select" can select list items and combobox items.

".Select" returns TRUE if a selection was made and FALSE if not.

`/if (${Task[hatch].Select}) {`\
`/echo I just Selected a task that has the name "hatch" in it...`\
`} else {`\
`/echo I did not find a task that has the word "hatch" in it, so nothing was selected.`\
`}`\
`/echo The task with "hatch" in is name is called: ${Task[hatch]}`

Output: The task with "hatch" in is name is called: Hatching a Plan

`/echo ${Task[hatch]} is listed as number ${Task[hatch].Index} in the tasklist.`

Output: Hatching a Plan is listed as number 1 in the tasklist.

`/echo The ${Task[hatch]} first objective is to ${Task[hatch].Objective[1].Instruction}`

Output: The Hatching a Plan first objective is to find where the eggs are being incubated

`/echo The ${Task[hatch]} first objective status is ${Task[hatch].Objective[1].Status}`

Output: The Hatching a Plan first objective status is 0/1

`/echo The ${Task[hatch]} first objective should be completed in ${Task[hatch].Objective[1].Zone}`

Output: The Hatching a Plan first objective should be completed in Hatchery Wing

`/echo I should be working on ${Task[hatch].Step} in ${Task[hatch].Step.Zone}`


---

# 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-task.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.
