DataType:string

From the wonderful RedGuides Wiki

A string is an array of characters. In MQ there is no single character datatype, so any variable or expression that contains text is considered a string.


This Data Type is referenced in MacroQuest, and accessed by Top-Level Object(s): If, Ini, String
string is used as a return type by these members:  [ Toggle ]

Page Member Description
achievement Description The achievement's description
Link[opt: Name] Generate an achievement link. An optional name can be provided to display in the achievement, otherwise the current character's name will be used.
Name The achievement's name
State The achievement state.
achievementcat Description The category's description
ImageTextureName Name of the image texture that is used to represent this category in the Achievements Window.
Name The category's display name
achievementobj Description Text describing this objective.
advlootitem Name
AdvPath CheckPoint Checkpoint name
CustomSearch contains value used for filtering CustomPaths and /play listcustom
Direction N/R, Normal or Reverse
Flag# Can access flags 1 through 9
Path Returns closest path
X[<name>|#] Checkpoint name or Waypoint number, returns LOC or checkpoint name
Y[<name>|#]
Z[<name>|#]
alertlist BodyType
Class
Light
Name
Race
altability Category The name of the category that this AA belongs to.
Description Basic description
Name Name
ShortName First line of button label (if any)
ShortName2 Second line of button label (if any)
To String Same as Name
augtype Name
auratype
bandolier Returns the name of the specified bandolier profile
bandolieritem Returns name of specified item
bazaaritem FullName Will return full name of the item, including ( and ) characters, such as Burynai Burial Regalia (Caza)
Name Returns the name of the specified result. e.g. /echo ${Bazaar.SortedItem[5].Name}
Trader The name of the trader selling the specified item. e.g. /echo ${Bazaar.Item[20].Trader}
body Name The full name of the body type
Boxr Current Key of the automation that is controlling the toon
buff Caster Name of the buff's caster, if available.
cachedbuff Alias: CasterName. Returns the name of the caster who applied the cached buff
Cast Result Returns a string containing the result of the /casting command. It can be one of the following:
Types
Result Description
CAST_ABORTED Casting Aborted (/interrupt)
CAST_CANCELLED Casting was aborted
CAST_CANNOTSEE Cannot see target
CAST_COLLAPSE Your Gate collapsed
CAST_COMPONENTS Missing Component
CAST_DISTRACTED You were distracted
CAST_FIZZLE Your cast fizzled
CAST_IMMUNE Target is immune the spell's effect
CAST_INTERRUPTED Casting was interupted
CAST_INVISIBLE You are invisible
CAST_NOTARGET No target
CAST_NOTREADY Not ready to cast
CAST_OUTOFMANA Not enough mana to cast spell
CAST_OUTOFRANGE Target is out of range
CAST_OUTDOORS Spell not working here (on mount ect..)
CAST_PENDING Casting is in progress
CAST_RECOVER Spell is not ready
CAST_RESIST Cast was resisted
CAST_STANDING Not standing
CAST_STUNNED You are stunned
CAST_SUCCESS The cast was a success
CAST_TAKEHOLD The spell did not take hold
CAST_UNKNOWN Unknown Spell
Return Returns the result of the casting/memorize/interrupt request.
Status Returns a string containing all the pending events. This string often contains multiple events (eg. when /casting still has to immobilize you and then memorize the spell before it can cast).
  • The list of possible pending events is:
    • I: idle and waiting for you
    • A: advpath pause
    • F: stick pause
    • S: immobilize in progress
    • M: memorize in progress
    • E: item swapped
    • D: ducking casting
    • T: targeting
    • C: spell casting in progress
character Ability[#] The doability button number that the skill name is on
CombatState Returns one of the following: COMBAT, DEBUFFED, COOLDOWN, ACTIVE, RESTING, UNKNOWN
GroupList Returns a string of your group members (excluding you)
Inviter Name of the inviter
Language[#] The EQ language number of the specified language. See Language list
MercenaryStance Current active mercenary stance
MercListInfo[#]
Name Returns your character's first name
Subscription Returns FREE SILVER or GOLD
To String Same as Name
charselectlist Class Class of specified character
Name Name of specified character
Race Race of specified character
chatwnd Title Returns the title of the MQ2ChatWnd window
circle Direction Movement direction of current circle.
Rotation Displays CCW if reverse circling.
Status Returns off / paused / on. On if circling.
To string Same as Status
class Name The long name, e.g. "Ranger"
ShortName The short name, e.g. "RNG"
currentzone Name Full zone name
ShortName Short zone name
To String Same as Name
CWTN Command Returns the class command for the CWTN plugin.
  • Ex: "Shd" for MQ2Eskay, "Clr" for MQ2Cleric, etc.
GroupWatch Returns your groupwatch setting as a string.
  • Ex: "All", or "Self Only"
Mode What mode you are in as a string. Ex: "Manual" for mode 0
RaidAssistName Returns the name of your Raid Assist as a string.
  • Ex: "Bob" if Bob was your Raid Assist 1 in your eq raid window, and your RaidAssist was set to "1".
Stance Plugins: MQ2Shaman
  • Returns the value of this setting in as a string.
Ex: stance 0 would return "Heal", stance 1 would return "Hybrid", stance 2 would return "DPS"
DanNet Groups list of all groups (this includes hidden groups used internally! use Joined if you want only groups that are visible)
Joined list of joined groups
Name current node name (fully qualified)
Observe observe accessor, accessed like: ${DanNet[peer_name].Observe}
  • short version: O
  • if no indices are specified, lists all queries observers have registered
  • if only the peer is specified, list all queries that self has registered on peer
Peers List of connected peers
Peers[<${GroupName}>] List of connected peers in the ${GroupName} group
Timeout timeout for implicit delay in /dquery and /dobserve commands
Version current build version
Deity Name The full deity name
Team The team name
DisplayItem AdvancedLore Displays lore text
Info Returns details from the item. Note that this is different from the "information" member.
Information Returns the "item information" text from the item window.
MadeBy Displays the maker of the crafted item
WindowTitle Returns the title of the window
double Centi
Deci
Milli
Precision
Prettify
dynamiczone Name The full name of the dynamic zone
dzmember The name of the member
Status The status of the member - one of the following: Unknown, Online, Offline, In Dynamic Zone, Link Dead
dztimer EventName The name of the event
ExpeditionName The name of the expedition
To String Returns the string formatted as "ExpeditionName|EventName"
EQBC Names List of connected characters
Port Returns port of the connected server
Server Returns hostname/ip of the connected server
ToonName Character name as seen by EQBC (may reflect YouPlayer)
everquest ChatChannel[#] Returns the name of chat channel #
CurrentUI return a string representing the currently loaded UI skin
GameState Returns one of the following: CHARSELECT INGAME PRECHARSELECT UNKNOWN
LastCommand Last command entered
LastTell Name of last person to send you a tell
LoginName Your station name
Path returns EverQuest's install path on the local drive
PPriority Returns the processor priority that Everquest is set to. Where 1 is Low 2 is below Normal 3 is Normal 4 is Above Normal 5 is High and 6 is RealTime
Server Short name of your server. Find a list here, Server short names
WinTitle Titlebar text of the Everquest window.
Farm Version Returns plugin version
fellowship Leader Fellowship leader's name
MotD Fellowship Message of the Day
To String TRUE if currently in a fellowship, FALSE if not
fellowshipmember Name Member's name
To String player name
float Centi The number as a string with two places of precision, i.e. ###.##
Deci The number as a string with one place of precision, i.e. ###.#
Milli The number as a string with three places of precision, i.e. ###.###
Precision[#] The number as a string with # places of precision
Prettify
To String Same as Centi
framelimiter Status
friend Friend[#] Returns the name of friend list member #
To String Number of friends on your friends list
GMCheck Count How many GMs are in the zone. Oddly this is a string!
Status Returns TRUE if a detectable GM is in the zone, FALSE if not, or DISABLED if /gmcheck off.
ground DisplayName
Name
groupmember The name of the group member. This works even if they are not in the same zone as you.
heading The long compass direction, eg. "south", "south by southeast"


Brosen windrose.svg
ShortName The short compass direction, eg. "S", "SSE"
iniadvfilesectionkey KeyAtIndex[<#>] The name of the key at the specified index number.
Value Returns the value for a specific key.
ValueAtIndex[<#>] The value of a key at the specified index number.
Value[index] If the key doesn't exist, will return the given index.
int Hex The hex value of the integer (10 is represented as 0xA)
Prettify
To String The number
int64 Hex
Prettify[precision]
To String The number
invslot Name For inventory slots not inside packs, the slot name, otherwise NULL
item DMGBonusType "None", "Magic", "Fire", "Cold", "Poison", "Disease"
EffectType Spell effect type.
  • Click Inventory - item has a right-click spell and can be cast from inventory.
  • Click Unknown - item has an unknown right-click effect restriction.
  • Click Worn - item has a right-click spell and must be equipped to click it
  • Combat - weapon has a proc.
  • Spell Scroll - Scribeable spell scroll.
  • Worn - item has a focus effect.
ItemLink[CLICKABLE] Prints the actual hexlink for an item (not clickable) unless [CLICKABLE] is included
LDoNTheme "All", "Deepest Guk", "Miragul's", "Mistmoore", "Rujarkian", "Takish", "Unknown"
Name
Type returns item class
itemfilterdata Name
itemspell OtherName
keyringitem Name name of the keyring item
linkdb Link
list Delimiter[string] Sets the delimiter used to separate items in Insert and Append method calls. The previous delimiter is returned.
Head Remove and return the current item described at position 0 in the list. False is returned if the list is empty.
Item[int] Returns the string at the indicated position in the list.
Tail Remove and return the current item described by position Count -1 in the list. False is returned if the list is empty.
listiterator Value Returns the element of the list under the iterator.
LoginProfile Account The account name for the current autologin profile
Character The character name set for the current autologin profile
HotKey The hotkey for the current autologin profile
Profile The profile group for the current autologin profile
Server The server for the current autologin profile
lua CRequirePaths the semicolon-delimited value for dll require search paths
Dir the base lua scripts directory
PIDs a comma-delimited list of integer PIDs that have info to access
RequirePaths the semicolon-delimited value for lua require search paths
luainfo Arguments a comma delimited list of arguments passed to the script
EndTime The time the most recent execution of the script ended or NULL if the script has not ended
Name the name of the script
Path the full path of the script
Return if not indexed, a comma-delimited list of return values. Accepts an integer index to get a single return value if there is more than one
StartTime The time the most recent execution of the script was started
Status The execution status of the script
macro CurCommand list the current line number, macro name, and code of the macro being processed
CurSub The current subroutine
Name The name of the macro currently running
Return The value that was returned by the last completed subroutine
Variable get macro variables outside the macro environment
macroquest BuildDate Date that MQ2Main.dll was built
BuildName The name of the client this build was made for. (Live, Test, Beta, Emu)
Error Last normal error message
InternalName The internal name from MQ2Main.dll ("Next")
MQ2DataError Last MQ2Data parsing error message
Path[Option] Returns MacroQuest path on local drive. Returns specific path with available index options: root/config/crashdumps/logs/mqini/macros/plugins/resources
SyntaxError Last syntax error message
Version The full version of MQ2Main.dll
makecamp Status Displays status of MakeCamp command. AltCamp returns off.
To string Same as Status.
mapiterator Key Returns the unique key for the element of the map under the iterator.
Value Returns the element of the map under the iterator.
math Hex[n] Returns hexidecimal value of int n
Medley Medley Current medley name. Empty string if no current medley.
Melee Status Current plugin status, can be one or more of the following: ENGAGED, WAITING, MELEE, RANGE, ENRAGE, INFURIATE, BACKING, ESCAPING, FEIGNING, EVADING, FALLING, STEALING, BEGGING.
menu Items[#] returns the Itemname specified by Index
Name returns the name of the menu or the first item's name.
To String If no menu open, returns "No Menu Open"
mercenary Name
Stance Current stance of the mercenary
State Current state of the mercenary (returns "DEAD","SUSPENDED","ACTIVE", "NONE", or "UNKNOWN"
MoveUtils Command Displays the currently active command. MAKECAMP returns if a camp is setup but no other command is currently in use.
To string Same as Command
MyButtons cmd[<#>] The command assigned to <Button#>
label[<#>] The name assigned to <Button#>
Navigation Setting[<key>] Will return the string value of the setting

Example:

/echo ${Navigation.Setting[OpenDoors]}
NetBots Buff A list of all buffs on [Name]
Client Returns a list of client names currently broadcasting
Detrimental All detrimental types affecting [Name]
Heading The heading of [Name]
Leader is [Name] the leader
Location The coordinates of [Name]
Name Returns the name of [Name]
Note Returns the custom note on [Name] (see Command:/netnote on how to set this)
PetBuff A list of buffs on [Name]'s pet
ShortBuff A list of short duration buffs on [Name]
State
  • State of [Name]:
STUN STAND SIT DUCK BIND FEIGN DEAD UNKNOWN
pet Name Returns name of pet, if no pet exists returns "NO PET"
Stance Returns the pet's current stance, (e.g. FOLLOW, GUARD)
petbuff Caster
plugin Name Name of the plugin
pointmerchant To String Returns TRUE if merchant window is visible, otherwise FALSE
pointmerchantitem Name Returns the name of the item.
Posse FriendNames Returns all friend names
StrangerNames Returns all stranger names
queue Peek False is returned if IsEmpty is true.
Pop
race Name The name of the race
raid Looter[#] Specified looter name by number
raidmember Name Raid member's name
React Action[nickname] Return the action from the react with "nickname"
Condition[nickname] Returns the condition from the react with "nickname"
Global[globalnickname] Returns the condition from the global condition with 'globalnickname'
RewardItem Reward[<#/name>].Text Returns name of the indicated reward if available; else NULL
RewardOption Reward[<#/name>].Option[#/name].Text Returns name of the indicated option if available; else NULL
RewardOptionItem Reward[<#/name>].Item[#/name].Text
saywnd LastSay The last /say received
LastSpeaker The last character to speak over /say
Title Returns the current title of the say window
To String
setiterator Value Returns the element of the set under the iterator.
skill Name Name of the skill
solventtype Returns name of solvent
spawn ActorDef
AssistName
CleanName
ConColor GREY, GREEN, LIGHT BLUE, BLUE, WHITE, YELLOW, RED
DisplayName Name displayed in game (same as EQ's %T)
EQLoc Location using EQ format
Gender
Guild Guild name
Light Name of the light class this spawn has
Loc location of the spawn
LocYX LocYX of the spawn
LocYXZ LocYXZ of the spawn
MQLoc Location using MQ format
Name
State STAND, SIT, DUCK, BIND, FEIGN, DEAD, STUN, HOVER, MOUNT, UNKNOWN
Suffix Suffix attached to name, eg. Billy Bob of Tunare
Surname Last name
Title Alias: AATitle. Prefix/Title before name.
Type Returns PC, NPC, Untargetable, Mount, Pet, Corpse, Chest, Trigger, Trap, Timer, Item, Mercenary, Aura, Object, Banner, Campfire, Flyer
SpawnMaster LastMatch Returns the name of the last spawn that popped matching the list.
Version Returns the Version of MQ2SpawnMaster
spell BaseName Removes rank information from spell
CastByMe
CastByOther
CastOnAnother Message when cast on others
CastOnYou Message when cast on yourself
Category The category name of the spell
CounterType The resist counter. Will be one of "Disease", "Poison", "Curse" or "Corruption"
Description
Extra
Link Generate a clickable spell link.
Link[text] Generate a clickable spell link, <text> replaces the text of the link.
Name spell name
ResistType Returns one of the following: Corruption, Physical, Prismatic, Chromatic, Disease, Poison, Cold, Fire, Magic, Unresistable, Unknown
Restrictions[#|name]
Skill Will return spell skill. e.g. Abjuration, Alteration, Conjuration, Divination, Evocation
SpellType "Beneficial(Group)", "Beneficial", "Detrimental" or "Unknown"
Subcategory The subcategory name of the spell
TargetType Returns one of the following: Target_AE_No_Players_Pets, Single Friendly (or Target's Target, Pet Owner, Target of Target, Free Target, Beam, Single in Group, Directional AE, Group v2, AE PC v2, No Pets, Pet2, Caster PB NPC, Caster PB PC, Special Muramites, Chest, Hatelist2, Hatelist, AE Summoned, AE Undead, Targeted AE Tap, Uber Dragons, Uber Giants, Plant, Corpse, Pet, LifeTap, Summoned, Undead, Animal, Targeted AE, Self, Single, PB AE, Group v1, AE PC v1, Line of Sight, Unknown
WearOff The "wear off" message
SQLite result[<QueryName> <Row> <ColumnName>] Will show results (or Failed). Must include all three parameters.
status[<QueryName>] Current status of the given query name - Either Active, Success, or Failed
stack Peek False is returned if IsEmpty is true.
Pop
stick Status Displays on if any form of stick is active.
StickTargetName Returns DisplayedName of stick target if stick id/hold used, else current target or None if no target and hold/id not used.
To string Same as Status
string Arg[#,s] Returns the #th argument of the string separated by s. The separator s must be a single character (defaults to space).
See below for difference between Token and Arg
Left[#] Returns the first # characters of the string. A negative # will return the whole string except for the last # characters
Lower Returns the string in all lower-case
Mid[p,n] Returns a segment of the string, starting at position p and running n characters
Replace[ReplaceThis,WithThis] Replaces ReplaceThis with WithThis
Right[#] Returns the last # characters of the string. A negative # will return the whole string except for the first # characters
StripLinks Strips links and tags from the text.
To String This is a string!
Token[#,s] Returns the #th token of the string separated by s. The separator s must be a single character (defaults to space).
See below for difference between Arg and Token
Upper Returns the string in all upper-case
swap CurrentSwap Returns the name of the instrument currently swapped
switch Name
task 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 Name Returns name of the member
taskobjectivemember Instruction Returns a tasks's Objectives
RequiredItem Returns a string of the required item to complete a objective.
RequiredSkill Returns a string of the required skill to complete a objective.
RequiredSpell Returns a string of the required spell to complete a objective.
Status Returns the status of the objective in the format amount done Vs total IE 0/3
Type Returns one of the following: Unknown, None, Deliver, Kill, Loot, Hail, Explore, Tradeskill, Fishing, Foraging, Cast, UseSkill, DZSwitch, DestroyObject, Collect, Dialogue, Null
Zone The zone in which the task's objective is found.
ticks Time Time in the form MM:SS
TimeHMS Time in the form HH:MM:SS (if there are no hours, the form will be MM:SS)
time Date Date in the format MM/DD/YYYY
Hour12 Hour with AM / PM
Time12 Time in 12-hour format (HH:MM:SS)
Time24 Time in 24-hour format (HH:MM:SS)
timer To String Same as Value
timestamp Time Remaining time value formatted in M:S
TimeDHM Remaining time value formatted in D:H:M (Days:Hours:Minutes)
TimeHMS Remaining time value formatted in H:M:S
Trophy Alchemy
  • Returns the name of our Alchemy trophy.
Blacksmithing
  • Returns the name of our Blacksmithing trophy.
Brewing
  • Returns the name of our Brewing trophy.
Fishing
  • Returns the name of our Fishing trophy.
Fletching
  • Returns the name of our Fletching trophy.
Jewelry
  • Returns the name of our Jewelry trophy.
Poison
  • Returns the name of our Poison trophy.
Pottery
  • Returns the name of our Pottery trophy.
Tailoring
  • Returns the name of our Tailoring trophy.
Tinkering
  • Returns the name of our Tinkering trophy.
TTS Voice Which voice is being used (additional voices must be installed)
twist List Returns the twist sequence in a format suitable for /twist.
type Member[#] Member name based on an internal ID number (based on 1 through n, not all values will be used)
Name Returns name of data type
Vendor Items[<#>].Name Specify the index of the item, and it will return the item name.

e.g.

${Vendor.Items[1].Name}
window List[#, y] Get the text for the #th item in a list box. Only works on list boxes. Use of y is optional and allows selection of the column of the window to get text from.
List[text, y] Find an item in a list box by partial match (use window.List[=text] for exact). Only works on list boxes. Use of y is optional and allows selection of the column of the window to search in.
Name Name of window piece, e.g. "ChatWindow" for top level windows, or the piece name for child windows.


Note: this is Custom UI dependent
ScreenID ScreenID of window. Note: This is not Custom UI dependent, it must be the same on all UIs
Size Returns Y,X size of window in pixels
Text Window's text.

STMLBox: returns the contents of the STML.

Page: returns the name of the page's Tab.
Tooltip TooltipReference text
Type Type of window piece (Screen for top level windows, or Listbox, Button, Gauge, Label, Editbox, Slider, etc)
xptracker RunTime How long since session began
xtarget Name Name of specified XTarget
TargetType Extended target type
zone Name Full zone name
ShortName Short zone name
To String Same as Name

Members

Type Member Description
bool EqualCS[text] EqualCS is exactly the same as Equal, except that it is case-sensitive
Equal[text] If the initial string and the second string text are exactly the same, returns TRUE. Equal is case-insensitive
NotEqualCS[text] NotEqualCS is exactly the same as NotEqual, except that it is case-sensitive
NotEqual[text] If the initial string and the second string text are exactly the same, returns FALSE. NotEqual is case-insensitive
int CompareCS[text] CompareCS is exactly the same as Compare, except that it is case-sensitive
Compare[text] Determines how the initial string and the second string, text, compare to each other:
  • If both are the same, Compare will return 0.
  • If the string is alphabetically before text, Compare will return -1.
  • If text is alphabetically after string, Compare will return 1.
Compare is case-insensitive
Count[c] Returns how many times a single character c occurs in the string
Find[text] This tries to find the second string text within the original string:
  • If it is successful, it returns the first position in the string where text begins.
  • It returns NULL if text is not found.
Find is case-insensitive
Length Returns the length of the string as an integer
string Arg[#,s] Returns the #th argument of the string separated by s. The separator s must be a single character (defaults to space).
See below for difference between Token and Arg
Left[#] Returns the first # characters of the string. A negative # will return the whole string except for the last # characters
Lower Returns the string in all lower-case
Mid[p,n] Returns a segment of the string, starting at position p and running n characters
Replace[ReplaceThis,WithThis] Replaces ReplaceThis with WithThis
Right[#] Returns the last # characters of the string. A negative # will return the whole string except for the first # characters
StripLinks Strips links and tags from the text.
To String This is a string!
Token[#,s] Returns the #th token of the string separated by s. The separator s must be a single character (defaults to space).
See below for difference between Arg and Token
Upper Returns the string in all upper-case

Examples

Simple Examples

/declare TestString abcdebc
/echo ${TestString.Find[bc]}          Will return 2
/echo ${TestString.Left[2]}           Will return "ab"
/echo ${TestString.Left[-2]}          Will return "abcde"
/echo ${TestString.Mid[2,3]}          Will return "bcd"
/echo ${TestString.Right[2]}          Will return "bc"
/echo ${TestString.Right[-2]}         Will return "cdebc"

Difference between Arg and Token

Arg[#,s] and Token[#,s] are very similar. The only difference between them is Token will include null values, while Arg will skip them. For example:

/declare TestString ABC,,DEF
/echo ${TestString.Arg[2,,]}          Will return "DEF" because it is the second non-null string separated by a comma
/echo ${TestString.Token[2,,]}        Will return "NULL" because the second token, the null string, is not ignored

Compare strings to strings

  • There is a temptation by some novice macro writers to put the string inside quotes within brackets. Don't!
#Event SpellWornOff  "Your #1# spell has worn off of #2#."

Sub Event_SpellWornOff(string Line, string SpellName, string OnWho) 
   | You can put all kinds of logic here, on what to do when certain buffs or debuffs wear off.
   | In this example, we'll just check to see if the spell that wore off is a particular spell
   | multiple words seperated by spaces. Note: No quotes inside the brackets, and pay attention
   | to where the curly brackets are in the /if compare statement.
   /echo SpellWornOff: ${SpellName} wore off ${OnWho}
   /if (${SpellName.Equal[Enveloping Roots]}) /echo Yikes, Root wore off ... run!
/return

See also