Skip to content

Top-Level Objects

A "Top-Level Object" is any kind of object that you can start with when trying to find a property.

TLOs are called Top-Level Objects because nothing comes before them. A TLO is not a member of any object, it is itself an accessor to objects.

Note

A TLO provides access to instances of datatypes.

See Also: DataType Reference

The data that a TLO gives you may depend on the parameters that are provided. Most TLOs don't take any parameters (like Me). However, some TLOs return different data dependent on what is provided to them. This is explained in the documentation by using the term Forms. A TLO with multiple Forms may return different datatypes depending on what is passed in.

Examples

Me

Me is a Top Level Object that returns a character. Me has access to the members of the character datatype, but Me is not the character datatype. You will notice that the character datatype inherits the spawn datatype, which means the TLO Me will have access to both the character and spawn members.

Int

The datatype named int and the Top Level Object named Int are not the same thing.

The TLO is used to parse integer strings. the int datatype represents a numeric value.

See Also

A Beginners Guide to TLOs and MQ2DataVars may be useful for understanding how TLOs work.

TLO List

Achievement

Provides access to achievements.

Forms

achievement Achievement[#|Name]

Look up an achievement by name or by id.

achievementmgr Achievement

Access the achievement manager which provides access to information about achievements

AdvLoot

The AdvLoot TLO grants access to items in the Advanced Loot window.

Alert

Provides access to spawn search filter criteria in alerts. Alerts are created using /alert.

Forms

alert Alert[ID]

Retrieve information for the alert category by its id

string Alert

Returns pipe | separated list of alert ids

Alias

Provides a way to query whether a given alias exists. See /alias.

Forms

bool Alias[Name]

Returns bool indicating if named aliase exists

AltAbility

Danger

This AltAbility TLO is for accessing the full database of alternate abilities.

If you want to access alternate abilities associated with your character, use Me.AltAbility instead.

Forms

altability AltAbility[Number]

Look up an AltAbility by its altability id.

altability AltAbility[Name]

Look up an AltAbility by its name.

Bool

Creates a bool object from a string. The resulting value is a bool depending on whether the given string is falsey or not.

"Falsey" is defined as any of the following values:

  • Empty String
  • FALSE
  • NULL
  • The string "0"
If the string is one of these values, the resulting bool is false. Otherwise, it is true.

Forms

bool Bool[Text]

Converts the given Text to a bool based on the rules presented above.

Corpse

Access to objects of type corpse, which is the currently active corpse (ie. the one you are looting).

Cursor

Creates an object which references the item on your cursor.

Defined

Determines whether a variable, array, or timer with this name exists. The variable, array or timer must not be enclosed with ${}.

Forms

bool Defined[Name]

Returns true if the given variable name is defined.

DisplayItem

This TLO gives you access to all the information in the Item Display window.

DoorTarget

Object used to return information on your doortarget.

DynamicZone

Provides access to properties of the current dynamic (instanced) zone.

EverQuest

Provides access to general information about the game and its state.

Familiar

Used to get information about items on your familiars keyring.

Forms

keyring Familiar

Access to the familiar keyring.

keyringitem Familiar[N]

Retrieves the item in your familiar keyring by index.

keyringitem Familiar[Name]

Retrieve the item in your familiar keyring by name. A = can be prepended for an exact match.

FindItem

A TLO used to find an item on your character, corpse, or a merchant by partial or exact name match. See examples below.

Forms

item FindItem[name|id]

Search for an item using the given item id, or partial name match. Will search character inventory and any items stored in key rings (illusion, mount, etc).

Example

Looks for an item with the name swirling in it, and prints the ID.

/echo ${FindItem[swirling].ID}
print(mq.TLO.FindItem("swirling").ID())

item FindItem[=name]

Search for an item using exact name match (case insensitive). Will search character inventory and any items stored in key rings (illusion, mount, etc).

Example

Looks for the Cleric Epic (by exact match) and prints its ID.

/echo ${FindItem[=Water Sprinkler of Nem Ankh].ID}
print(mq.TLO.FindItem("=Water Sprinkler of Nem Ankh").ID())

FindItemBank

A TLO used to find an item in your bank by partial or exact name match. See examples below.

Of note: The FindItemBank with ItemSlot REQUIRES that bank item containers be open to function correctly. Due to potential exploits the command will not work if the bank containers are closed. This is in contrast to FindItem functionality with character containers, where ItemSlot was designed to allow inventory management without opening containers.

Forms

item FindItemBank[name|id]

Search for an item in your bank using the given item id, or partial name match.

Example

Looks for an item in your bank with the name swirling in it, and prints the ID.

/echo ${FindItemBank[swirling].ID}
print(mq.TLO.FindItemBank("swirling").ID())

item FindItemBank[=name]

Search for an item in your bank using exact name match (case insensitive).

Example

Looks for the Cleric Epic (by exact match) in your bank and prints its ID.

/echo ${FindItemBank[=Water Sprinkler of Nem Ankh].ID}
print(mq.TLO.FindItemBank("=Water Sprinkler of Nem Ankh").ID())

FindItemBankCount

A TLO used to find a count of items in your bank by partial or exact name match. See examples below.

Forms

int FindItemBankCount[name|id]

Counts the items in your bank using the given item id, or partial name match.

Example

Echos the number of items in your bank with the name swirling in it.

/echo ${FindItemBankCount[swirling]}
print(mq.TLO.FindItemBankCount("swirling"))

int FindItemBankCount[=name]

Counts the items in your bank using exact name match (case insensitive).

Example

Echoes the number of Swirling Shadows you have in your bank.

/echo ${FindItemBankCount[=Swirling Shadows]}
print(mq.TLO.FindItemBankCount("=Swirling Shadows"))

FindItemCount

A TLO used to find a count of items on your character, corpse, or a merchant by partial or exact name match. See examples below.

Forms

int FindItemCount[name|id]

Counts the items using the given item id, or partial name match. Will search character inventory and any items stored in key rings (illusion, mount, etc).

Example

Echos the number of items in your inventory with the name swirling in it.

/echo ${FindItemCount[swirling]}
print(mq.TLO.FindItemCount("swirling"))

int FindItemCount[=name]

Counts the items using exact name match (case insensitive). Will search character inventory and any items stored in key rings (illusion, mount, etc).

Example

Echoes the number of Water Flasks you have in your inventory.

/echo ${FindItemCount[=Water Flask]}
print(mq.TLO.FindItemCount("=Water Flask"))

Float

Creates a float object from n.

Forms

float Float[n]

Returns a float with value n.

FrameLimiter

The FrameLimiter TLO provides access to the frame limiter feature.

Friends

Grants access to your friends list.

GameTime

A time object indicating EQ Game Time.

Ground

Object which references the ground spawn item you have targeted.

GroundItemCount

Access to all Groundspawn item count information.

Group

Access to all group-related information.

Heading

Object that refers to the directional heading to of a location or direction.

Forms

heading Heading[#]

Creates a heading object using degrees (clockwise)

heading Heading[y,x]

Creates a heading object using the heading to this y,x location

heading Heading[N,W]

Same as above, just an alternate method

If

Executes an inline condiition, similar to a ternary expression in other languages.

Forms

string If[conditions,whentrue,whenfalse]

Performs Math.Calc on conditions, gives whentrue if non-zero, gives whenfalse if zero.

Example

If I am sitting, stand up. Otherwise, echo "I am not sitting down"

/docommand ${If[${Me.Sitting},/stand,/echo I am not sitting down]}

string If[conditions~whentrue~whenfalse]

Alternate syntax, behaves the same as above but uses the ~ character as a separator instead of a comma.

Illusion

Used to get information about items on your illusions keyring.

Forms

keyring Illusion

Access to the illusion keyring.

keyringitem Illusion[N]

Retrieves the item in your illusion keyring by index.

keyringitem Illusion[Name]

Retrieve the item in your illusion keyring by name. A = can be prepended for an exact match.

Ini

Reads value(s) from an ini file located in a relative or absolute path.

Forms

string Ini[filename,section,key,default]

The section, key, and default do not need to be given. If section or key are not given, multiple values are read.

Section and key may be set to -1 to skip them and give a new value.

If the ini is located in a directory other than the root Macros directory is located, you can use a DOS-style filepath (relative or absolute) to locate the ini. If the macro accessing the ini is in the same non-root directory, you will still to provide the (relative or absolute) filepath.

ini Ini

When passed with no parameters to Ini[] the more robust form of the Ini TLO is used. See below and the reference to the Key datatype for further usage.

Int

Object that creates an integer from n.

Forms

int Int[N]

Parses whatever value for n is provided and converts it into an int.

InvSlot

Object used to get information on a specific inventory slot.

Forms

invslot InvSlot[N]

Inventory slot by index N.

invslot InvSlot[SlotName]

Inventory slot matching SlotName.

Inventory

This is a hierarchical container for things relating to inventory (Bank, etc). It is not currently fully implemented and will be added onto.

ItemTarget

Gives access to the ground item that is previously targeted using /itemtarget.

LastSpawn

Information about the spawns that have occurred since you entered the zone. When you enter a zone you dont know the spawn order of anything already there, just anything that spawns while you are in the zone.

The useful thing about ${LastSpawn[-1]} is just being able to get the first spawn in the list which you might use in conjunction with other spawn members to go through the entire spawn list in a loop.

Forms

spawn LastSpawn[N]

The nth latest spawn (chronological order)

spawn LastSpawn[-N]

The nth oldest spawn (chronological order)

LineOfSight

Object that is used to check if there is Line of Sight betwen two locations.

Forms

bool LineOfSight[y,x,z:y,x,z]

Check for line-of-sight between the two specified coordinates.

Macro

Information about the macro that's currently running.

MacroQuest

Creates an object related to MacroQuest information.

Math

Creates a Math object which gives allows access to the math type members.

Me

Character object which allows you to get properties of you as a character.

Access to menu objects when a menu is open.

Mercenary

Object used to get information about your mercenary.

Merchant

Object that interacts with the currently active merchant.

Mount

Used to get information about items on your Mount keyring.

Forms

keyring Mount

Access to the Mount keyring.

keyringitem Mount[N]

Retrieves the item in your mount keyring by index.

keyringitem Mount[Name]

Retrieve the item in your mount keyring by name. A = can be prepended for an exact match.

NearestSpawn

Object that is used in finding spawns nearest to you.

Forms

spawn NearestSpawn[N]

The Nth nearest spawn

spawn NearestSpawn[Search]

The nearest spawn matching this search string (see Spawn Search).

spawn NearestSpawn[N,Search]

The Nth nearest spawn matching this search string (see Spawn Search).

Pet

Pet object which allows you to get properties of your pet.

Plugin

Object that has access to members that provide information on a plugin.

Forms

plugin Plugin[Name]

Finds plugin by name, uses full name match, case insensitive.

plugin Plugin[N]

Plugin by index, starting with 1 and stopping whenever the list runs out of plugins.

PointMerchant

Access to point merchants (such as those found in LDoN) when a window is open.

Raid

Object that has access to members that provide information on your raid.

Range

Test if n is inside a range of 2 numbers or between 2 numbers

Select

Object used to determine if a match was made to argument in the given set of values.

Warning

Values must be single words. Quoted strings do not work, as the parser will drop the quotes and uses spaces as a delimiter.

Forms

int Select[argument,value1[,value2,...]]

Example

Given:

/declare thing string outer foo

The following are true:

| Outputs: 1
/echo ${Select[${thing},foo,bar,baz]}

| Outputs: 2
/echo ${Select[${thing},bin,foo,baz]}

| Outputs: 3
/echo ${Select[${thing},bin,baz,foo]}

| Outputs: 0
/echo ${Select[${thing},bin,bar,baz]}

Example

/if (${Select[${Target.Class.ShortName},CLR,DRU,SHM]} > 0) {
    /echo Target is a healer
}

SelectedItem

Used to return information on the object that is selected in your own inventory while using a merchant.

Skill

Object used to get information on your character's skills.

Forms

skill Skill[name]

Retrieve skill by name

skill Skill[N]

Retrieve skill by number

Social

Access data about socials (in-game macro buttons)

Forms

social Social[Index]

Look up a social by its button index.

Each page as 12 socials, so index 13 would be the first social on the page 2. There are a total of 120 socials.

Spawn

Object used to get information on a specific spawn. Uses the filters under Spawn Search.

Forms

spawn Spawn[N]

Spawn matching ID N.

spawn Spawn[SearchString]

Any spawns matching SearchString. See Spawn Search.

SpawnCount

Object used to count spawns based on a set of queries. Uses the filters under Spawn Search.

Forms

int SpawnCount

Total number of spawns in current zone

int SpawnCount[SearchString]

Total number of spawns in current zone matching the SearchString. See Spawn Search.

Spell

Object used to return information on a spell by name or by ID.

Forms

spell Spell

Find spell by ID

spell Spell[Name]

Find spell by name

String

Access the string datatype

Forms

string String[text]

Access text as a string

SubDefined

Information about macro sub's definition

Forms

bool SubDefined[name]

Returns true if a sub called name is defined and the macro is currently running.

Switch

Object used when you want to find information on targetted doors or switches such as the portals in PoK.

Forms

switch Switch

Returns the currently targeted switch

switch Switch[ID]

Returns a switch matching the provided numeric ID

switch Switch[Search]

Based on the value of Search, return a switch:

  • target: Return the currently targeted switch
  • nearest: Return the nearest switch.
  • Otherwise, return switch by searching by name

SwitchTarget

Object used to return information on your switch target. Replaces DoorTarget

Target

Object used to get information about your current target.

Task

Object used to return information on a current Task.

TeleportationItem

Returns data on the teleportation item in your keyring.

Forms

keyringitem TeleportationItem[#]

Retrieves the item in your keyring by index

keyringitem TeleportationItem[name]

Retrieves the item in your keyring by name. A = can be prepended for an exact match.

keyring TeleportationItem

Time

Object used to return information on real time, not game time.

TradeskillDepot

Object that interacts with the personal tradeskill depot, introduced in the Night of Shadows expansion.

Type

Used to get information on data types.

Forms

type Type[Name]

Retrieve metadata about the type with given Name

Window

Used to find information on a particular UI window.

You can display a list of window names using the /windows command or by using the window inspector.

Forms

window Window[Name]

Retrieve window by searching for the first window matching Name.

Zone

Used to find information about a particular zone.

Forms

currentzone Zone

Retrieves the current zone information

zone Zone[N]

Retrieves information about a zone by zone ID. If this zone is the current zone, then this will return currentzone.

zone Zone[ShortName]

Retrieves information about a zone by short name. If this zone is the current zone, then this will return currentzone.