MQ2Events

From the wonderful RedGuides Wiki
MQ2Events
Respond to message-based events
View details
Authors Bardomatic, Sic, brainiac, eqmule
Software type Plugin
Config file MQ2Events_CharacterName.ini, MQ2Events.ini


Maintained Yes and supported
Links

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

MQ2Events allows you to configure a reaction to any text-based event. For example, if you want to /cry when the text "has become ENRAGED" appears, you're in the right place.

If the event doesn't make text, such as entering a body of water, you should use MQ2React.

Commands

Syntax Description
/event [option] [<name> <trigger text | command text>] Adds, lists, deletes, and controls all events
/eventdebug [on|off] Turns event debugging on or off

Settings

The settings are found in MQ2Events_CharacterName.ini, though they can be added entirely with in-game commands.

You can also use a "generic" MQ2Events.ini

Here's a simple example:

[mecry]
;the name of the event, can be any short name
* trigger=#1# has become ENRAGED#*#
;the trigger will take anything that appears in #1# and writes it to the TLO ${EventArg1}
* command=/me cowers in fear at the sight of ${EventArg1}
;this is the command that's run, a little emote that includes the mob's name.

Examples

The triggers, #1# through #9#, act as a wildcard and will take any text that appears in their place and writes it to the corresponding TLO, ${EventArg1} through ${EventArg9}. For example, if the text is:

  • For sale: baby shoes, never worn.

and the trigger is,

  • For sale: #1#, never #5#

then following command, /echo ${EventArg1} ${EventArg5} will output:

  • [MQ2] baby shoes worn.


Here's an example to help characters duck when a monster asks them to,

[kaelraidduck]
trigger="#*#The ice-encrusted Avatar of War shouts that each of these must bend the knee: #1#, #2#, and #3#.#*#"
command=/if ((${Me.CleanName.Equal[${EventArg1}]}) || (${Me.CleanName.Equal[${EventArg2}]}) || (${Me.CleanName.Equal[${EventArg3}]}) && (!${Me.Ducking})) /multiline ; /gsay Ducking! ; /mqp on ; /attack off ; /twist clear ; /keypress duck

Here's one to get notified via EQBC when a character completes a task step, so it notifies you that it completed a step, what Task it was updated in, what step you're currently on, and the instruction for that step.

[taskupdate]
trigger="Your task '#1#' has been updated#*#"
command=/bc Task Update ${EventArg1} now on step ${Task[${EventArg1}].Step.Index}:${Task[${EventArg1}].Step}.

Here's one that uses multiline and variables to congratulate players who have achieved greatness:

[congorats]
trigger=<SYSTEMWIDE_MESSAGE>: #1# has been defeated by a group of hardy adventurers! Please join us in congratulating #2# along with everyone#*#
command=/if (${congratz} == NULL) /multiline ; /timed 10 /if (!${Defined[congratz]}) /declare congratz timer global 990; /timed 15 /varset congratz 990; /timed 20 /if (!${Defined[randreply]}) /declare randreply int global ${Math.Rand[300]}; /timed 25 /varset randreply ${Math.Rand[300]}; /timed 90 /if (${randreply} >= 0 && ${randreply} <= 100) /tell ${EventArg2} congratz!; /timed 95 /if (${randreply} >= 101 && ${randreply} <= 200) /tell ${EventArg2} nice job!; /timed 100 /if (${randreply} >= 201 && ${randreply} <= 300) /tell ${EventArg2} thanks I hate ${EventArg1}!


More examples can be found in this excellent video, as well as the support thread.

See also


Top-Level Object(s)

TLOs added by MQ2Events:

TLO Data Type(s) Description
EventArg1 Holds a string set by MQ2Events trigger #1#
EventArg2 Holds a string set by MQ2Events trigger #2#
EventArg3 Holds a string set by MQ2Events trigger #3#
EventArg4 Holds a string set by MQ2Events trigger #4#
EventArg5 Holds a string set by MQ2Events trigger #5#
EventArg6 Holds a string set by MQ2Events trigger #6#
EventArg7 Holds a string set by MQ2Events trigger #7#
EventArg8 Holds a string set by MQ2Events trigger #8#
EventArg9 Holds a string set by MQ2Events trigger #9#