DataType:task

From the wonderful RedGuides Wiki

This is the type for your current task.


This Data Type is referenced in MacroQuest, and accessed by Top-Level Object(s): Task

Members

Type Member Description
action Select Selects the task. Can select list items and combobox items.
int ID Returns an int of the task ID
Index Returns the task's place on the tasklist
Members Returns number of members in task
WindowIndex Returns the Quest Window List Index. (if the window actually has the list filled)
string Title Returns name of the shared task
Type Returns one of the following: Unknown, None, Deliver, Kill, Loot, Hail, Explore, Tradeskill, Fishing, Foraging, Cast, UseSkill, DZSwitch, DestroyObject, Collect, Dialogue, Null
taskmember Leader Returns task leader's name
Member[#|name] Returns specified member in task by index or name
taskobjectivemember Objective[#] Returns information about a task's objectives
Step Gets the first step that's not done in the task objective, and returns a description.
timestamp Timer Returns amount of time before task expires

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}

See also