Triggers to match MXP Elements

Posted by David Haley on Sun 07 Sep 2003 12:28 AM — 2 posts, 10,173 views.

USA #0
I tried searching the forums for this ("mxp match" on the first try and "mxp trigger" on the second) but found nothing relevant.

My problem is that I may want to have a trigger match when I receive an MXP element, and then retrieve whatever is inside it. e.g. <Ex>west</Ex>
Having a trigger match "<Ex>*</Ex>", even in regex format, does not work.

To give the full context, I'm trying to have a trigger beep when someone uses immtalk. Immtalk is in the format:

----
Fred: This is an immtalk!
Joe: Oh... this too!
----

The initial reaction would be to match:
*: *

This obviously does not work, because of:

Log: Fred killed by a goblin in room 0.2456
Comm: Disconnect: 12.34.56.78


So, I figured that the MUD could always send an "empty element" that just displays the text, but would serve as a placemark for "this is an immtalk". Of course, matching other MXP elements may be useful for all sorts of other things, but the example I have off the top of my head is that one.

My question: is there some way to match MXP elements sent by the MUD? Or is this a possible addition for future version? *hopes* :)
Australia Forum Administrator #1
Yes, you can do exactly that. See:

http://www.gammon.com.au/forum/?bbsubject_id=1124

Search for: OnMXPEndTag