From the wonderful RedGuides Wiki

This command is added by MacroQuest

Syntax Key
Notation Description
Text without brackets or braces Required items
<Text inside angle brackets> Placeholder for which you must supply a value
[Text inside square brackets] Optional items
Vertical bar (|) Separator for mutually exclusive items; choose one
{Text | inside | braces} Set of required items; choose one
Ellipsis () Items that can be repeated
Syntax /vardata <varname> <new datatype value>
Description Sets a variable directly to the end result of a datatype string. To use this, do not put ${} around the outer data to parse.
  • This is more efficient than using /varset as it skips a step. For example, /varset first converts the MQ2Data to text, and then back to MQData. /vardata converts directly through MQData.



/vardata MyFloat Math.Calc[${Me.X}+${Me.Y}]

/vardata M_Assist Param0

Using /vardata with non-basic data types,

/declare x int local
/declare xSpawn spawn local
/for x 1 to ${SpawnCount[pc]}
   /vardata xSpawn NearestSpawn[${x},pc]
   /echo ID:${xSpawn.ID} NAME:${xSpawn.Name}
/next x

See also