The MQ2Data system is composed of types of objects, and instances of those types. Each object type may have "data members" as well as a direct method of converting this type to the actual output string.
Note for afraid newbies... "int" and "byte" are whole numbers, "float" uses a decimal point, "bool" means true/false
Syntax
The basic syntax for usage is something like this...
${TopLevelObject[index](cast).Member[index](cast).Member[index](cast)}
You must always use a top level object, but you don't necessarily have to use an index, cast, or member. For example, ${Me.Name}. Me is a top level object of type "character", and Name is a member of that type. ${Spawn[1].Name}. Spawn is a top level object of type "spawn", and Name is a member of that type. You may nest your ${} usage, for example ${TopLevelObject[${TopLevelObject[index].Member}]}
* Failures will ALWAYS result in NULL
Types
Immediate Value types: byte,argb,int,float,bool,ticks,class,race,body,deity,heading,invslot
Reference types(in the code itself, these are pointers): string,spawn,character,buff,spell,ground,switch,window,merchant,item,zone,type,time
Careless types(casting these to ints will give you 0): macro,macroquest,math,currentzone
byte
- Members: none
- To string: The number...
argb
- Members:
...int A: Alpha
...int R: Red
...int G: Green
...int B: Blue
...int Int: The integer formed by ARGB
- To string: The hex value of the integer formed by ARGB
int
- Members:
...float Float: The number as a float (instead of 123, this will give 123.0)
...string Hex: The hex value of the integer
...int Reverse: Endianness reversed
- To String: The number...
float
- Members:
...string Deci: ###.#
...string Centi: ###.##
...string Milli: ###.###
...int Int: The whole number portion (will not round)
...string Precision[n]: Convert to a string with this number of digits after the decimal (1 is Deci, 2 is Centi, etc)
- To String: ###.##
bool
- Members: none
- To String: "TRUE" for non-zero, or "FALSE" for zero
ticks
- Members:
...int Hours: The number of hours in hh:mm:ss
...int Minutes: The number of minutes in hh:mm:ss (will never be 60+)
...int Seconds: The number of seconds in hh:mm:ss (will never be 60+)
...string Time: Time in the form mm:ss
...string TimeHMS: Time in the form hh:mm:ss (if there are no hours, the form will be mm:ss)
...int TotalMinutes: The total number of minutes
...int TotalSeconds: The total number of seconds
...int Ticks: The value in ticks
- To String: Same as Ticks
heading
- Members:
...int Clock: The nearest clock direction, e.g. 1-12
...float Degrees: Heading in degrees (same as casting to float)
...float DegreesCCW: Heading in degrees Counter-Clockwise (the way the rest of MQ2 uses it, the way EQ uses it, and is expected by older macros)
...string Name: "south" "south by southeast" etc
...string ShortName: "S" "SSE" etc
- To String: Same as ShortName
class
- Members:
...string Name: The "long name" as in "Ranger"
...string ShortName: The "short name" as in "RNG"
...int ID: The class's ID #
...bool PetClass: Pet class? (shaman, necromancer, mage, beastlord)
...bool PureCaster: Pure caster? (can gate!)
...bool CanCast: Can usually cast? (not melee only)
...bool DruidType: Druid/Ranger?
...bool ShamanType: Shaman/Beastlord?
...bool NecromancerType: Necromancer/Shadowknight?
...bool ClericType: Cleric/Paladin?
- To String: Same as Name
race
- Members:
...string Name: The full race name
...int ID: The race's ID #
- To String: Same as Name
body
- Members:
...string Name: The full body type name
...int ID: The body type's ID #
- To String: Same as Name
deity
- Members:
...string Name: The full deity name
...string Team: The team name
...int ID: The deity's ID #
- To String: Same as Name
string
- Members:
...int Find[text]: Looks for the given text, gives position (currently NULL if not found)
...int Length: The length of the string
...string Upper: The string in all UPPER CASE
...string Lower: The string in all lower case
...string Left[length]: The left (length) of the string.. Left[2] of "Left" will be "Le"
...string Right[length]: The right (length) of the string.. Right[2] of "Left" will be "ft"
...string Left[-length]: The left ("all but" length) of the string.. Left[-1] of "Left" will be "Lef"
...string Right[-length]: The right ("all but" length) of the string.. Right[-1] of "Left" will be "eft"
...string Mid[position,length]: The left (length) starting at (position).. Mid[2,2] of "Left" will be "ef"
...int Compare[text]: -1 if the string is alphabetically before text, 0 if equal, 1 if after. Case does not count.
...int CompareCS[text]: -1 if the string is alphabetically before text, 0 if equal, 1 if after. Case counts.
...bool Equal[text]: Strings equal? Case does not count...
...bool NotEqual[text]: Strings not equal? Case does not count...
...bool EqualCS[text]: Strings equal? Case counts!
...bool NotEqualCS[text]: Strings not equal? Case counts!
...string Arg[n,separator]: Gets nth argument using separator as the separator (single character). If separator is not given, defaults to space
...string Token[n,separator]: Retrieve a token from the string using a custom separator. Unlike Arg, this will not skip empty values
...int Count[char]: Count the number of occurrences of a particular character in the string
- To String: ... this IS a string, assface
spawn
- Members:
...int ID: SpawnID
...string Name: Name
...int Level: Level
...float X: X
...float Y: Y
...float Z: Z
...float N: Y, the Northward-positive coordinate
...float W: X, the Westward-positive coordinate
...float U: Z, the Upward-positive coordinate
...float S: Shortcut for -Y (makes Southward positive)
...float E: Shortcut for -X (makes Eastward positive)
...float D: Shortcut for -Z (makes Downward positive)
...float DistanceX: Distance from player in X plane
...float DistanceY: Distance from player in Y plane
...float DistanceZ: Distance from player in Z plane
...float DistanceW: Distance from player in X plane (East/West)
...float DistanceN: Distance from player in Y plane (North/South)
...float DistanceU: Distance from player in Z plane (Up/Down)
...float Distance: Distance from player in (x,y)
...float Distance3D: Distance from player in (x,y,z)
...float DistancePredict: Estimated distance in (x,y), taking into account the spawn's movement speed but not the player's...
...spawn Next: Next spawn in the list
...spawn Prev: Previous spawn in the list
...heading Heading: Heading in this direction
...float Speed: Speed
...bool Levitating: Levitating?
...bool Sneaking: Sneaking?
...heading HeadingTo: Heading player must travel in to reach this spawn
...string Light: Name of the light class this spawn has
...body Body: Body type
...string State: STAND SIT DUCK BIND FEIGN DEAD STUN UNKNOWN
...int CurrentHPs: Current hit points
...int MaxHPs: Maximum hit points
...int PctHPs: Percent hit points
...deity Deity: Deity
...string Type: PC NPC Untargetable Mount Pet Corpse Chest Trigger Trap Timer Item
...string CleanName: The "cleaned up" name
...string Surname: Last name
...string Guild: Guild name
...string GuildStatus: Guild status
...spawn Master: Master, if it is charmed or a pet
...spawn Pet: Pet
...spawn Mount: Mount
...race Race: Race
...class Class: Class
...string Gender: Gender
...bool GM: GM?
...float Height: Height
...float MaxRange: Max distance from this spawn for it to hit you
...float MaxRangeTo: Max distance from this spawn for you to hit it
...int AARank: AA rank number
...spell Casting: Spell, if currently casting
...bool Swimming: Swimming?
...bool FeetWet: Feet wet/swimming?
...bool Underwater: Underwater?
...int Animation: Current animation id
...int Holding: Represents what they are holding...
...float Look: Looking this angle
...string ConColor: GREEN, LIGHT BLUE, BLUE, WHITE, YELLOW, RED
...bool Invis: Invisible? (also includes both successful and failed hides as well as shroud of stealth)
...bool Sitting: Sitting?
...bool Standing: Standing?
...bool Ducking: Ducking?
...bool Binding: Binding wounds?
...bool Feigning: Feigning?
...bool Invited: Invited to group?
...spawn NearestSpawn[search]: Find the nearest spawn matching this search, to this spawn (most efficient on yourself)
...spawn NearestSpawn[n,search]: Find the nth nearest spawn matching this search, to this spawn (most efficient on yourself)
...bool LFG: LFG?
...bool Linkdead: Linkdead?
...bool Trader: Trader?
...bool AFK: AFK?
...bool GroupLeader: Is this your group's leader?
...string AATitle: Actual AA title (e.g. Sage, Impresario, etc)
...bool Anonymous: Anonymous?
...bool Roleplaying: Roleplaying?
- To String: Same as Name
character
- Inherits spawn (all spawn members are accessible without going through Spawn, but character members take precedence if names are the same)
- Members:
...int ID: Spawn ID
...string Name: First name
...int Level: Level
...int Exp: Experience (of 330)
...float PctExp: Experience as a %
...spawn Spawn: The character's spawn
...int AAExp: AA exp
...float PctAAExp: AA exp as a %
...int AAPoints: Unused AA points
...int CurrentHPs: Current hit points
...int MaxHPs: Max hit points
...int HPRegen: Hit point regeneration
...int PctHPs: Percent hit points
...int CurrentMana: Current mana
...int MaxMana: Max mana
...int ManaRegen: Mana regeneration
...int PctMana: Percent mana
...int Endurance: Current endurance
...int MaxEndurance: Max endurance
...int PctEndurance: Percent endurance
...buff Buff[slot]: The buff in this slot (1-15)
...buff Buff[name]: Finds buff with this name
...buff Song[slot]: The song in this slot (1-6)
...buff Song[name]: Finds song with this name
...string Surname: Last name
...int Cash: Cash in copper
...int CashBank: Banked cash in copper
...int PlatinumShared: Shared-banked platinum
...bool Grouped: Grouped?
...int HPBonus: Hit point bonus from gear/spells
...int ManaBonus: Mana bonus from gear/spells
...int GukEarned: Total ldon points earned in guk
...int MMEarned: Total ldon points earned in mm
...int RujEarned: Total ldon points earned in ruj
...int TakEarned: Total ldon points earned in tak
...int MirEarned: Total ldon points earned in mir
...int LDoNPoints: Available ldon points
...int CurrentFavor: Current favor
...int CareerFavor: Career favor
...item Inventory[slot]: Item in this slot (1-29)
...item Inventory[slotname]: Item in this slot (inventory slots only, but same names as /itemnotify)
...item Bank[slot]: Item in this slot (1-18)
...zone Bound: The zone you are bound in
...bool Combat: In combat?
...bool Grouped: Grouped?
...spell Gem[slot]: The spell in this slot #
...int Gem[name]: The slot # with this spell name
...int Dar: Damage absorption remaining
...bool Moving: Moving? (including strafe)
...int Hunger: Hunger level
...int Thirst: Thirst level
...spell Book[slot]: Spell assigned to this slot in your spellbook
...int Book[name]: Spell slot the spell with this name is assigned to in your spellbook
...int Skill[name]: Skill level of skill with this name
...int Skill[n]: Skill level of skill with this ID
...string Ability[slot]: Skill name assigned to this doability button
...int Ability[name]: Doability button number this skill name is on
...bool AbilityReady[name]: Ability with this name ready?
...bool AbilityReady[slot]: Ability on this button ready?
...bool SpellReady[name]: Gem with this spell name ready for cast?
...bool SpellReady[slot]: Spell in this gem ready for cast?
...int PetBuff[name]: Finds slot with this spell name
...spell PetBuff[n]: The spell in this slot (1-29)
...int GroupLeaderExp: Group leadership exp
...float PctGroupLeaderExp: Group leadership exp as a %
...int GroupLeaderPoints: Group leadership points
...int RaidLeaderExp: Raid leadership exp
...float PctRaidLeaderExp: Raid leadership exp as a %
...int RaidLeaderPoints: Raid leadership points
...int Platinum: Platinum
...int Gold: Gold
...int Silver: Silver
...int Copper: Copper
...int PlatinumBank: Platinum in bank
...int GoldBank: Gold in bank
...int SilverBank: Silver in bank
...int CopperBank: Copper in bank
...bool Stunned: Stunned?
...bool RangedReady: Ranged attack ready?
...bool AltTimerReady: Alternate timer ready? (Bash/Slam/Frenzy/Backstab. Note that AbilityReady works fine with most of these)
...int AltAbility[n]: Alt ability rank by number
...int AltAbility[name]: Alt ability rank by name
...bool AltAbilityReady[n]: Alt ability readiness by number
...bool AltAbilityReady[name]: Alt ability readiness by name
...ticks AltAbilityTimer[n]: Alt ability reuse time left, by number
...ticks AltAbilityTimer[name]: Alt ability reuse time left, by name
...spell CombatAbility[n]: Combat ability by number in your list (not same as others lists!)
...int CombatAbility[name]: Combat ability number in your list by name (not same as others lists!)
...int character.FreeInventory: Count of free inventory spaces
...int character.FreeInventory[n]: Count of free inventory spaces of at least n size (giant=4)
...int character.LargestFreeInventory: Size of largest free inventory space
...spawn TargetOfTarget: Target of target
- To String: Same as Name
buff
- Inherits spell (all spell members are accessible without going through Spell, but buff members take precedence if names are the same)
- Members:
...int ID: Buff or song number
...int Level: Level
...spell Spell: Spell
...float Mod: Bard song modifier (e.g. 2.4)
...ticks Duration: Duration
- To String: Same as Spell.Name
spell
- Members:
...int ID: Spell ID
...string Name: Name
...int Level: Level
...string Skill: Skill name
...int Mana: Mana cost (unadjusted)
...int ResistAdj: Resist adjustment
...float Range: Range to target
...float AERange: AE range
...float PushBack: Push back amount
...float CastTime: Cast time (unadjusted)
...float FizzleTime: Time to recover after fizzle
...float RecoveryTime: Same as FizzleTime
...float MyCastTime: Adjusted cast time
...float RecastTime: Time to recast after successful cast
...ticks Duration: Duration of the spell if any
...string SpellType: Beneficial(Group) Beneficial Detrimental Unknown
...string TargetType: Group v2 AE PC v2 etc
...string ResistType: Chromatic Disease Poison Cold Fire Magic Unresistable Unknown
- To String: Same as Name
ground
- Members:
...int ID: Ground item ID (not the same as item ID, this is like spawn ID)
...float Distance: Distance from player to ground item in (x,y)
...float X: X
...float Y: Y
...float Z: Z
...float W: X (Westward-positive)
...float N: Y (Northward-positive)
...float U: Z (Upward-positive)
...heading Heading: Ground item is facing this heading..
...heading HeadingTo: Direction player must move to meet this ground item
...string Name: Name
- To String: Same as ID
switch
- Members:
...int ID: Switch ID
...float Distance: Distance from player to switch in (x,y)
...float X: X
...float Y: Y
...float Z: Z
...float W: X (Westward-positive)
...float N: Y (Northward-positive)
...float U: Z (Upward-positive)
...heading Heading: Switch is facing this heading..
...float DefaultX: "closed" state X
...float DefaultY: "closed" state Y
...float DefaultZ: "closed" state Z
...float DefaultW: "closed" state X (Westward-positive)
...float DefaultN: "closed" state Y (Northward-positive)
...float DefaultU: "closed" state Z (Upward-positive)
...heading DefaultHeading: "closed" state heading
...bool Open: Open?
...heading HeadingTo: Direction player must move to meet this switch
...string Name: Name
- To String: Same as ID
math
- Members:
...float Abs[formula]: Absolute value (calculates first)
...int Rand[n]: Random number with range of n, meaning Rand[n]=0-(n-1). e.g. Rand[2] will give 0 or 1
...float Calc[formula]: Performs any number of mathematical calculations ! ^ \ % + / - * != < <= == >= > && & || |
...float Sqrt[formula]: The square root of formula
...float Sin[formula]: The Sin of formula
...float Cos[formula]: The Cos of formula
...float Tan[formula]: The Tan of formula
...float Asin[formula]: The Asin of formula
...float Acos[formula]: The Acos of formula
...float Atan[formula]: The Atan of formula
...string Hex[n]: The hex value of n
...int Dec[hex]: The decimal value given a hexadecimal string
...int Not[n]: Performs a bitwise not on n
...float Distance[y,x,z:y,x,z]: Performs distance calculations in 1, 2 or 3 dimensions. Any not given will default to your character's current x y or z.
...float Distance[N,W,U:N,W,U]: Same as above, just demonstrating that the order is the same as above
- To String: NULL
window
- Members:
...bool Open: TRUE if the window is open
...window Child[name]: Child with this name
...int VScrollMax: Vertical scrollbar range
...int VScrollPos: Vertical scrollbar position
...int VScrollPct: Vartical scrollbar position in % to range from 0
...int HScrollMax: Horizontal scrollbar range
...int HScrollPos: Horizontal scrollbar position
...int HScrollPct: Horizontal scrollbar position in % to range from 0
...bool Children: Has children?
...bool Siblings: Has siblings?
...window Parent: Parent window
...window FirstChild: First child window
...window Next: Next sibling window
...bool Minimized: Minimized?
...int X: Screen X position
...int Y: Screen Y position
...int Height: Height in pixels
...int Width: Width in pixels
...bool MouseOver: Mouse currently over?
...argb BGColor: Background color
...string Text: Window's text
...string Tooltip: TooltipReference text
...string List[n]: Get the first-column text for the nth item in a list box. Example: ${Window[TradeskillWnd].Child[RecipeList].List[1]}
...int List[text]: Find an item in a list box by partial match (use window.List[=text] for exact) Example: ${Window[TradeskillWnd].Child[RecipeList].List[=Inky Shadow Silk]}
...bool Checked: Checked? (useful for buttons)
...bool Highlighted: Highlighted/mouse over?
...bool Enabled: Enabled?
...int Style: Window style code
- To String: TRUE if exists, FALSE if not
zone
...int ID: Zone ID
...string Name: Full name like "Ocean of Tears"
...string ShortName: Short name like "oot"
- To String: Same as Name
currentzone
- Inherits zone (all zone members are accessible, but currentzone members take precedence if names are the same.. which all of them are, so it's almost like not being inherited!)
- Members:
...string Name: Full name like "Ocean of Tears"
...string ShortName: Short name like "oot"
...int Type: Zone type
...float Gravity: Gravity
...int SkyType: Sky type
...float SafeX: Safe location X
...float SafeY: Safe location Y
...float SafeZ: Safe location Z
...float SafeW: Safe location X (Westward-positive)
...float SafeN: Safe location Y (Northward-positive)
...float SafeU: Safe location Z (Upward-positive)
...float MinClip: Minimum clip plane allowed in this zone
...float MaxClip: Maximum clip plane allowed in this zone
...int ID: Zone ID
- To String: Same as Name
item
- Members:
...int ID: Item ID
...string Name: Name
...bool Lore: Lore?
...bool NoDrop: No drop?
...bool NoRent: No rent?
...bool Magic: Magic?
...int Value: Item value in copper
...int Size: Item size
...int Weight: Item weight
...int Stack: Stack count
...string Type: Type
...int Charges: Charges
...string LDoNTheme: "Non-LDON" "Deepest Guk" "Miragul's" "Mistmoore" "Rujarkian" "Takish"
...string DMGBonusType: None Magic Fire Cold Poison Disease
...bool Stackable: Stackable?
...int Container: Number of slots, if this is a container
...int Items: Number of items, if this is a container
...item Item[n]: nth contained item, if this is a container
...invslot InvSlot: Inventory slot for this item
...int BuyPrice: Price to buy this item at this merchant
...int SellPrice: Price to sell this item at this merchant
...spell Spell: Spell effect
...float CastTime: Spell effect's cast time
...string EffectType: Spell effect type
- To String: Same as Name
macro
- Members:
...string Name: Name of current macro
...int RunTime: Amount of time macro has been running
...string Return: Last value from /return
...int Params: Number of parameters to current sub
- To String: Same as Name
macroquest
- Members:
...string GameState: CHARSELECT INGAME UNKNOWN
...string LoginName: Your station name
...string Server: Full name of your server
...string LastTell: Name of last person to send you a tell
...string LastCommand: Last command entered
...string Error: Last normal error message
...string SyntaxError: Last syntax error message (usage: /blahblah)
...string MQ2DataError: Last MQ2Data parsing error message
...int Running: Running time of current MQ2 session, in milliseconds
...int MouseX: Mouse's x location
...int MouseY: Mouse's y location
- To String: None
time
- Members:
...int Hour: Hour (0-23)
...int Minute: Minute...
...int Second: Second...
...int DayOfWeek: 1=sunday to 7=saturday (might make a data type later...)
...int Day: Day of the month
...int Month: Month of the year
...int Year: Year...
...string Time12: hh:mm:ss, 12-hour format
...string Time24: hh:mm:ss, 24-hour format
...string Date: MM/DD/YYYY
...bool Night: Gives true if the current hour is considered "night" in EQ (7:00pm-6:59am)
...int SecondsSinceMidnight: Number of seconds since midnight
- To String: Same as Time24
type
- Members:
...string Name: Type name
...string Member[id]: Member name based on an internal ID number (based on 1 through n, not all values will be used)
...int Member[name]: Member internal ID number based on name (will be a number from 1 to n)
- To String: Same as Name
corpse
- Members:
...bool Open: Corpse open?
...int Items: Item count on the corpse
...item Item[n]: nth item on the corpse
...item Item[name]: Finds an item by partial name on this corpse (use corpse.Item[=name] for exact)
- To String: FALSE, except if a corpse is open gives TRUE
merchant
- Members:
...bool Open: Merchant open?
...float Markup: The amount used to calculate item values on this merchant (Markup is what your charisma, faction, etc change). Markup*Cost=Merchant's sell price. Cost*(1/Markup)=Your sell price. Markup of 1.05 is highest no matter what, so there might not be any actual cap based on charisma.
...int Items: Item count on the merchant
...item Item[n]: nth item on the merchant
...item Item[name]: Finds an item by partial name at this merchant (use merchant.Item[=name] for exact)
- To String: FALSE, except if a merchant is open gives TRUE
invslot
- Members:
...int ID: Number of this item slot (usable directly by /itemnotify)
...item Item: Item contained by this item slot
...invslot Pack: Container that must be opened to access the slot with /itemnotify
...int Slot: Slot # inside that pack
...string Name: For inventory slots not inside packs, the slot name
- To String: Same as ID
plugin
- Members:
...string Name: Name of the plugin, for example "MQ2ChatWnd"
- To String: Same as Name
skill
- Members:
...string Name: Name of the skll
...int ID: Skill number
...float Accuracy: Base accuracy of the skll
...int ReuseTime: Reuse timer (dont know yet if it's in 10ths of seconds or what)
...bool AltTimer: Skill uses the kick/bash/slam/backstab/frenzy timer?
...int MinLevel: Minimum level for your class
...int StartingSkill: Base skill level for your class
...int SkillCapPre50: Skill cap pre-50 for your class
...int SkillCapPost50: Skill cap post-50 for your class
- To String: Same as Name
altability
- Members:
...string Name: Name of the alt ability
...string ShortName: Short name
...string Description: Basic description
...int ID: ID number
...int ReuseTime: Reuse time in seconds
...int MinLevel: Minimum level to train
...int Cost: Base cost to train
...spell Spell: Spell used by the ability (if any)
...altability RequiresAbility: Required ability (if any)
...int RequiresAbilityPoints: Points required in above ability
...int MaxRank: Max rank available in this ability
...int AARankRequired: Rank required to train
...int Type: Type (1-6, this may change to string eventually)
- To String: Same as Name
raid
- Members:
...raidmember Member[n]: Raid member by number
...raidmember Member[name]: Raid member by name
...raidmember Target: Raid target (clicked in raid window)
...raidmember Leader: Raid leader
...int Members: Total number of raid members
...int TotalLevels: Sum of all raid members' levels
...float AverageLevel: Average level of raid members (yay more accurate than in the window)
...int LootType: Loot type number (1-leader 2-leader&groupleader 3-leader&specified)
...string Looter[n]: Specified looter name by number
...int Looters: Number of specified looters
- To String: None
raidmember
- Inherits spawn (all spawn members are accessible without going through Spawn, but raidmember members take precedence if names are the same)
- Members:
...string Name: Player's name
...int Group: Current group number (or 0)
...bool GroupLeader: Group leader?
...bool RaidLeader: Raid leader?
...spawn Spawn: spawn object for this player if available (must be in zone)
...bool Looter: Allowed to loot with current loot rules and looters?
...class Class: Player's class (works outside of zone)
...int Level: Player's level (works outside of zone)
- To String: Same as Name
timer
- Members:
...int Value: Current value of the timer
...int OriginalValue: Original value of the timer
- To String: Same as Value
array
- Members:
...int Dimensions: Number of dimensions this array stores
...int Size: Total number of elements this array stores
...int Size[n]: Total number of elements stored in the nth dimension of this array
- To String: None
Top Level Objects:
character Me: The local character (you!)
spawn Spawn[ID]: Find spawn by ID
spawn Spawn[search string]: Find spawn by standard spawn search string. Example usage: Spawn[npc radius 500 trakanon]
spawn Target: Your target
spell Spell[n]: Find spell by ID
spell Spell[name]: Find spell by name
switch Switch: Your target, if you have a switch (door, etc) targeted
ground Ground: Your target, if you have a ground item targeted
merchant Merchant: Currently active merchant
window Window[name]: Find window by name
currentzone Zone: Current zone
zone Zone[name]: Find zone by short name
zone Zone[n]: Find zone by ID
int Group: Gets the number of players in your group
spawn Group[n]: Finds the nth group member
string String[text]: Make a string object using text. Example usage: String[MacroQuest].Right[5]
int Int[n]: Make an int object using n. Example usage: Int[123].Hex
bool Bool[text]: Make a bool object using text. Value is set to TRUE unless text is "NULL" "FALSE" or "0" (capitalization does not count)
float Float[n]: Make a float object using n. Example usage: Float[12.345].Deci
macro Macro: Currently running macro
macroquest MacroQuest: MacroQuest
math Math: Math functionality
corpse Corpse: Currently active corpse (looting)
item Cursor: Item on cursor
string If[conditions,whentrue,whenfalse]: performs Math.Calculate on conditions, gives whentrue if non-zero, gives whenfalse if zero
spawn LastSpawn[n]: The nth latest spawn (chronological order)
spawn LastSpawn[-n]: The nth oldest spawn (chronological order)
spawn NearestSpawn[n]: The nth nearest spawn
spawn NearestSpawn[search]: The nearest spawn matching this search (same as Spawn[search])
spawn NearestSpawn[n,search]: The nth nearest spawn matching this search
type Type[name]: Finds an MQ2 Data type by name
heading Heading[degrees]: Makes a heading object using degrees (clockwise). Example usage: Heading[15].ShortName
heading Heading[y,x]: Makes a heading object using the heading to this y,x location. Example usage: Heading[0,0].ShortName
heading Heading[N,W]: Same as above, just demonstrating
bool Defined[name]: Determines whether a variable with this name exists
string Ini[filename,section,key,default]: Reads from an ini file. section, key, and default do not need to be given. section and key may be set to -1 to skip them and give a new value. If section or key are not given, multiple values are read...
time Time: Your local time in real life
time GameTime: Game time
invslot InvSlot[name]: Inventory slot by name
invslot InvSlot[#]: Inventory slot by number
item FindItem[name]: Find item on character by partial name match. FindItem[=name] will find exact
item FindItemBank[name]: Find item in bank by partial name match. FindItemBank[=name] will find exact
int FindItemCount[name]: Count of items on character by partial name match. FindItemCount[=name] will find exact
int FindItemBankCount[name]: Count of items in bank by partial name match. FindItemBankCount[=name] will find exact
item SelectedItem: When using a merchant, etc. this is the selected item
plugin Plugin[name]: Finds plugin by name
plugin Plugin[n]: Plugin by number, starting with 1 and stopping whenever the list runs out of plugins.
string GroupLeaderName: group leader's name (works even if they are out of zone)
spawn GroupLeader: group leader (only works if they are in zone)
skill Skill[n]: Skill by number
skill Skill[name]: Skill by name
raid Raid: Current raid
int SpawnCount: Total number of spawns in current zone
int SpawnCount[search]: Total number of spawns in current zone matching the search
Type Casting
This is a relatively advanced topic. *Please* be aware that you can cause unavoidable crashes by using this, and unless you really know what you're doing, type casting isn't something you want to mess with. Type casting is causing a type to be directly seen as another type. For example, if you have an int value such as the number of people in your group -- the Group top level object used without an index -- you could cast this as a bool like so: ${Group(bool)}.
Immediate value types can be safely cast as any other immediate value type, or as a careless type (although that's useless). Careless types can be cast as any other careless type (although that's useless), or as any immediate value (they will act as though the value is 0).
The problem, and most of the actual usage, lies in casting reference types. You can get the memory address of any reference type by casting it as an int, or you could see if the memory address is non-zero by casting it as a bool. One potential usage of type casting THAT SHOULD NEVER BE USED is to store a memory address to be cast back to a reference type later. The address is NOT guaranteed to be valid when used again! Example:
Code: Select all
/varset myvar ${Spawn[1](int)}
/echo ${Int[@myvar](spawn).Name}Code: Select all
/varset myvar ${Spawn[1].ID}
/echo ${Spawn[@myvar].Name}** Important Note: Special handling is used for casting to "type", such that the new data is equal to the old type, and the new type is "type". **
Comments?
Please direct comments, questions, etc to this thread: http://macroquest2.com/phpBB2/viewtopic.php?t=5919
