MQ2Melee

From the wonderful RedGuides Wiki
MQ2Melee
287.png
Automate melee skills & movement
View details
Authors s0rcier, Wasted, Jobey, htw, pms, Maskoi, teichou, cr4zyb4rd, rswiders, Nayenia, winnower, Saar, eqmule, alynel, Sic, ctaylor22, Redbot, Knightly, BigDorf
Software type Plugin
Config file <server>_<character>.ini, MQ2Melee.ini(optional)


Maintained Yes and supported
Links

🏠Resource (review)
🥤Quick start •🤝Support •🛠️Repository

MQ2Melee is used for assisting with melee skills, abilities, AA's and movement in combat. It can also be configured to handle pets and items depending on combat conditions.

Commands

Syntax Description
/enrageoff <targetID> Tell plugin to react like the enrage event is over.
/enrageon <targetID> Tell plugin to react like an enrage event was detected. Target ID is optional.
/infurateoff <targetID> Tell plugin to react like the infuriate event is over.
/infuriateon <targetID> Tell plugin to react like infuriate was detected.
/killthis Tell the plugin you want to attack current target.
/melee [on|off] [setting=on|off]... [setting=<int>]... Turns settings on and off, sets items for settings that require them, and turns the plugin on and off. /melee by itself will list all settings that are available to your character.
/throwit Tell plugin to perform a ranged attack on current target

Settings

To see settings available for your character, type /melee in-game. Only options your class can use are listed. Alternatively you can reference the /melee page. Most options in the INI file are set using the command line /melee command=on|off and they are best set this way, and not by editing the INI file. Any options given this way are then saved to the INI file when you issue the command /melee save. Options that contain macro commands are set by editing the INI file and then loading the values with /melee load.

Example TLP rogue INI from server_charname.ini

[MQ2Melee]
assassinate=0
backstab=1
disarm=0
enrage=0
escape=20
evade=0
facing=0
infuriate=1
melee=1
pickpocket=0
plugin=1
pothealover=25
resume=75
stickbreak=1
stickrange=75
stickcmd=snaproll rear fast

"IF" options

The following "IF" options can be set in the INI file. They will then be evaluated before the relevant disc/skill is triggered.

Requirements:
- They all need to take the form of ${If[condition,1,0]} statements. For example: withstandif=${If[${Melee.GotAggro},1,0]} or slightly more complex, withstandif=${If[${Melee.GotAggro} && ${Me.PctHPs}<80,1,0]}
- Your defined condition must not exceed 255 characters, or it will cause the plugin to crash.
  • assaultif
  • backstabif
  • bashif
  • beggingif
  • aspif
  • bviviif
  • cloudif
  • boastfulif
  • bleedif
  • bloodlustif
  • callchallengeif
  • cstrikeif
  • crippleif
  • gutpunchif
  • opstrikeif
  • throatjabif
  • battleleapif
  • challengeforif
  • commandingif
  • cryhavocif
  • defenseif
  • disarmif
  • dragonpunchif
  • eaglestrikeif
  • enragingkickif
  • eyegougeif
  • evadeif
  • fallsif
  • feralswipeif
  • fieldarmif
  • fistofwuif
  • fclaw
  • flyingkickif
  • forageif
  • frenzyif
  • gbladeif
  • gorillasmashif
  • harmtouchif
  • pothealfastif
  • pothealoverif
  • hideif
  • intimidationif
  • joltif
  • jltkicksif
  • jugularif
  • kickif
  • kneestrikeif
  • knifeplayif
  • layhandif
  • leopardclawif
  • mendif
  • monkeyif
  • opfrenzyif
  • pickpocketif
  • pinpointif
  • provokeif
  • ragevolleyif
  • rakeif
  • rallosif
  • ravensif
  • rightindif
  • roundkickif
  • sensetrapif
  • selosif
  • slamif
  • slapfaceif
  • sneakif
  • steelyif
  • stormbladesif
  • strikeif
  • stunningif
  • synergyif
  • tauntif
  • thiefeyeif
  • throwstoneif
  • tigerclawif
  • twistedshankif
  • vigaxeif
  • vigdaggerif
  • vigshurikenif
  • withstandif
  • yaulp (for some reason no "if" on this one)

Other settings

Setting Description
stickcmd= This command takes a list of options that should be passed to the /stick command. e.g. "stickcmd=hold 15"
strikecmd= This command takes a list of options that should be passed to the /stick command for rogue strike/assassination (must set strikemode=1)

HolyShit and DownShit

Yes, these are the real names. Holy is for combat, and Down is for out of combat. When setting these in your .ini, you must be careful not to create an endless loop that will spam the game server. For your account's safety, make sure that when your line finishes it will set up something that will force it to be FALSE for a while! These Commands are turned on and off by downflagx and holyflagx if your downshit or holyshit parses ANY macro variables, you MUST set these flags to 2 instead of 1.

Setting Description
downshit0= (up to downshit90=) Each one of these takes a macro command that will be run when you are not in combat and your cursor is free. Remember, you have to enable each option with /melee downflag#=on.
downflag0= (up to downflag90=) Turn on/off the downshit with the same number. 0 is off, 1 is on, and if the downshit uses a macro variable (e.g. ${ModVersion}) set this to 2.
holyshit0= (up to holyshit90=) Each one of these takes a macro command that will be run in combat and your cursor is free. Remember, you have to enable each option with /melee holyflag#=on.
holyflag0= (up to holylag90=) Turn on/off the holyshit with the same number. 0 is off, 1 is on, and if the holyshit uses a macro variable (e.g. ${ModVersion}) set this to 2.

INI examples

Please Note: Use this section only for adding useful examples that can be included in the INI file, not for copy/pastes of the INI files themselves.

; Will just echo that the macro is paused (this is stupid btw, but its an example.)
; SINCE WE USE A MACRO VARIABLE (ModVersion) WE NEED TO SET THE FLAG TO 2!
downflag0=2
downshit0=/if (${Macro.Paused}) /echo ${Macro} ${ModVersion} is PAUSED!
; Swapping an Avatar-proccing weapon when needed.
; - The first line swaps your Ancient Prismatic Spear [id=29435] into your offhand if you don't already have it equipped and you don't have the Avatar buff
; - The second line swaps your Orcish Bone Axe [id=82634] back into your offhand if it's not equipped and you have the Avatar buff already
holyshit0=/if (${Me.Inventory[offhand].ID}==82634 && !${Me.Buff[avatar].ID} && ${Spell[avatar].Stacks} && (${Melee.AggroMode} && ${Melee.GotAggro})) /exchange 29435 offhand
holyshit1=/if (${Me.Inventory[offhand].ID}==29435 && (${Me.Buff[avatar].ID} || !${Spell[avatar].Stacks} || (${Melee.AggroMode} && !${Melee.GotAggro}))) /exchange 82634 offhand
; Activating the Area Taunt AA when multiple mobs in range
holyshit2=/if (${Melee.Combat} && ${SpawnCount[npc radius 50 zradius 10]}>1 && ${Me.AltAbilityReady[area taunt]} && ${Melee.AggroMode}) /alt activate 110
; Forage if you have a chest item (usually used to check if you awaiting a rez) and your cursor is free
forageif=${If[${Me.Inventory[chest].ID} && !${Cursor.ID},1,0]}
;Swap in and click monk epic haste gloves [id=10652] (or monk ornate gloves [id=12623]) if needed
holyshit0=/if (!${Me.Buff[Celestial Tranquility].ID} && ${Spell[Celestial Tranquility].Stacks} && ${Me.FreeBuffSlots}>=1) /casting 10652|hands
;For monks, toggle enrage detection if you have Master's Aura (makes you immune to enrage)
holyshit2=/if (!${Me.Song[Master's Aura Effect].ID} && !${meleemvi[enrage]}) /melee enrage=1
holyshit3=/if (${Me.Song[Master's Aura Effect].ID} && ${meleemvi[enrage]}) /melee enrage=0
; During downtime, check my clicky buffs and recast them if needed
downshit0=/if (${Spell[Form of Defense I].Stacks} && !${Me.Buff[Form of Defense I].ID} && !${Me.Moving}) /casting "Shroud of the Fallen Defender"|back
downshit1=/if (${Spell[Shield of the Arcane].Stacks} && !${Me.Buff[Shield of the Arcane].ID} && !${Me.Moving}) /casting "Kizrak's Chestplate of Battle"|chest
; Cast my clicky DS ring during combat if needed (it's insta-cast, so I can do so while in combat without affecting anything)
holyshit4=/if (${Spell[Shield of the Eighth].Stacks} && !${Me.Buff[Shield of the Eighth].ID}) /casting "Velium Coldain Insignia Ring"|item
;Uses crippling strike to snare
holyshit4=/if (${Target.CurrentHPs}<20 && ${Target.Speed}>50) /disc crippling strike
;During downtime, check my aura's and recast if needed
downshit1=/if (!${Spell[${Me.Aura[1]}].ID} && !${Me.Moving} && !${Me.Invis} && ${Me.PctEndurance} > 4 && ${Me.Standing}) /disc Myrmidon's Aura
;Activate Respite on Warrior if Endurance is low and deactivate running defensive if needed
downshit1=/if (${Me.PctEndurance}<25 && ${Me.CombatAbilityReady[Respite Rk. II]} && ${Me.CurrentEndurance}>100 && (${Zone.ID}!=344)) /disc Respite Rk. II
downshit2=/if (${Window[CombatAbilityWnd].Child[CAW_CombatEffectLabel].Text.Equal[Staunch Defense Rk. II]} && ${Me.PctEndurance}<25) /notify CombatAbilityWnd CAW_CombatEffectButton leftmouseup
;Change cleric merc to reactive on named mobs, to balanced on non named mobs. Easily adjustable for DPS mercs
holyshit1=/if (!${Target.Named} && ${Mercenary.State.Equal[ACTIVE]} && ${Mercenary.Stance.NotEqual[Balanced]} && ${Mercenary.Class.Name.Equal[Cleric]}) /stance balanced
holyshit2=/if (${Target.Named} && ${Mercenary.State.Equal[ACTIVE]} && ${Mercenary.Stance.NotEqual[Reactive]} && ${Mercenary.Class.Name.Equal[Cleric]}) /stance reactive
;Pal/Sk check if target is undead and is not otherwise slowed, then use Helix of the Undying
holyshit4=/if (${Target.Body.Name.Equal[Undead]} && ${Me.AltAbilityReady[2018]} && !${Bool[${Target.Slowed}]}) /alt activate 2018
;Alernatively a slow weapon exchange using the Bandolier and mainhand check, if there is no enc/sham nearby to slow
holyshit19=/if (!${Bool[${Target.Slowed}]} && ${Me.Inventory[mainhand].ID}!=133167  && !${SpawnCount[pc class shaman radius 50]} && !${SpawnCount[pc class enchanter radius 50]}) /Bandolier Activate Slow
holyshit20=/if (${Bool[${Target.Slowed}]} && ${Me.Inventory[mainhand].ID}!=140616) /Bandolier Activate 1Hand
;Necro - utilize the aggro meter to FD off aggro when over a set percentage
holyshit3=/if (${Me.PctAggro}>80 && ${Target.Distance}<15) /casting "Improved Death Peace" alt
;Sk centric but can be edited for use with any tank
;first line checks if first damage mod disc is ready, the target is named , endurance is over needed amount, and there is no current disc running
;second line does the same as first, but also check that first damage mod disc is unavailable
;third line does same as second , except it also checks that the second damage mod disc is unavailable
holyshit7=/if (${Me.CombatAbilityReady[${Spell[Unholy Guardian Discipline].RankName}]} && ${Target.Named} && ${Me.CurrentEndurance}>5300 && !${Melee.DiscID}) /disc ${Spell[Unholy Guardian Discipline].RankName}
holyshit8=/if (${Me.CombatAbilityReady[${Spell[Doomscale Mantle].RankName}]} && !${Me.CombatAbilityReady[${Spell[Unholy Guardian Discipline].RankName}]} && ${Target.Named} && ${Me.CurrentEndurance}>7700 && !${Melee.DiscID}) /disc ${Spell[Doomscale Mantle].RankName}
holyshit9=/if (${Me.CombatAbilityReady[${Spell[Grelleth's Carapace].RankName}]} && !${Me.CombatAbilityReady[${Spell[Doomscale Mantle].RankName}]} && !${Me.CombatAbilityReady[${Spell[Unholy Guardian Discipline].RankName}]} && ${Target.Named} && ${Me.CurrentEndurance}>2700 && !${Melee.DiscID}) /disc ${Spell[Grelleth's Carapace].RankName}

More examples can be found in the support thread.

Optional Global INI File

MQ2Melee has 3 global parameters that can be set in an optional INI file, which must be manually created. MQ2Melee uses default values for these parameters unless it finds a file named MQ2Melee.ini that you created in the same directory. Here is an example of a MQ2Melee.ini:

[Settings]
SpawnType=10
;0 + all desired target type modifier: (+1 PC) (+2 NPC) (+4 PC PET) (+8 NPC PET) (+16 PC CORPSE) (+32 NPC CORPSE) default is 10 (0 for base + 2 for NPC and + 8 for NPC PET).
MeleeKeys=z
;Melee Attack Key (not same as eq please unless you like problems) default is z.
RangeKeys=x
;Range Attack Key default is x.

See also


Top-Level Object(s)

TLOs added by MQ2Melee:

TLO Data Type(s) Description
Melee Melee Holds the Melee datatype which is much more interesting
meleemvb A TLO for debugging skills
meleemvi A TLO for debugging variables
meleemvs A TLO to debug options

Forms. Typical usage, /echo ${TLO}

Type TLO Description
int meleemvb[idskill] 1 if the skill is ready and target in range, 0 if not. Most combat and/or character kills that can use an ID are testable here. Examples of idskills are: idleopardclaw, idslam, idforage, idfrenzy, idtigerclaw, idescape.
meleemvi[variable] 1/0 if the variable is set to on/off. This includes all variables that can be set on the command line.
Melee Melee Returns TRUE if plugin is loaded.
string meleemvs[option] Evaluates option based on the current conditions and target. Options are all the INI options that contain command lines that need to be evaluated. Examples are: bashif, beggingif, tauntif, holyshit0, holyshit1, downshit1, slamif, etc. Echoing one of these options will show you how they evaluate.

Members. More may be available if inherited. Typical usage, /echo ${TLO.Member}

TLO Data Type Return Type Member Description
Melee Melee bool AggroMode TRUE/FALSE if the plugin is operating in Aggro-mode or not.
BackStabbing TRUE/FALSE if backstab setting is on/off.
Combat TRUE/FALSE if plugin enable and got valid kill target. Should replace ${Me.Combat} logic.
Enable TRUE/FALSE if plugin on/off, NULL if not loaded.
Engage TRUE if we have a valid kill target and it's okay to turn attack on, FALSE if not.
Enrage True if enraged
GotAggro TRUE/FALSE if current target seems to be aggroed on you (not perfect).
Immobilize TRUE if you have been standing still for more then 250ms, FALSE if not.
Infuriate TRUE if kill target is infuriated!
XTaggro Aggro from xtarget mobs
float BackAngle Angle representing heading difference with current target's back.
ViewAngle Angle of view with current target.
int Ammunition Count of defined ammunition or current equipped ammunition.
Casted Time (in miliseconds) elapsed since last detected spell casting (60000 if none).
DiscID Spell ID of currently running discipline, 0 if none.
Hidden How long you've been hidden
MeleeMode Maximum distance to target to be considered in melee range.
NumHits Total number of hits
RangeMode Minimum distance to target to be considered in archery range.
Silent How long you've been sneaking
Target SpawnID of current valid kill target, otherwise 0.
string 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.