[Home] [Downloads] [Search] [Help/forum]


Register forum user name Search FAQ

Gammon Forum

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  MXP and Pueblo
. . -> [Subject]  Triggering on MXP

Triggering on MXP

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Teapot   Australia  (9 posts)  [Biography] bio
Date Fri 14 Aug 2009 06:25 AM (UTC)
Message
Hello! I haven't yet worked out how to make triggers in any way interact with MXP. Can anyone point me in the right direction?

Here is a sample line from my MUD:
.[4z<Green>.[4z<b>(.[4z<talker>Channel.[4z</talker>) Someone wisps: Testing!.[3z.[4z<BR>

I'd like a way to make a trigger fire on colours like <Green> or <C #AF1E2D>. This is for when I want to check that a line is a certain colour, and also for when I'm matching only on colour.

I'd also like to be able to match specific tags like <talker>, which I assume will be very similiar to matching <Green>.

Thanks!
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #1 on Fri 14 Aug 2009 06:45 AM (UTC)
Message
http://www.gammon.com.au/scripts/doc.php?general=mxp_callbacks

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Teapot   Australia  (9 posts)  [Biography] bio
Date Reply #2 on Fri 14 Aug 2009 07:25 AM (UTC)
Message
I gave that a go, and thought I was barking up the wrong tree. When using the OnPluginMXPcloseTag and the OnPluginMXPcloseTag functions provided on that page, everything (both the tag name and the arguments/text) seems to be passed to the function as the 'name' argument. For instance:
Closing tag: green,(Channel) Someone wisps: Testing.
Text: No text


or

Opening tag: send,expire='Exits'
Argument list: No arguments


What am I doing wrong?

[Edit: failure to operate slashes.]
[Go to top] top

Posted by Nick Gammon   Australia  (22,975 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Sat 15 Aug 2009 03:26 AM (UTC)
Message
Maybe the documentation is slightly wrong. I found this in another post:





OnPluginMXPstart
OnPluginMXPstop
OnPluginMXPopenTag
OnPluginMXPcloseTag
OnPluginMXPsetVariable
OnPluginMXPerror




OnPluginMXPopenTag

It seems that in the case of OnPluginMXPopenTag it the callback expects a single argument in the form:

name,arguments

In other words, you would get something like this:

sound,FName="mm_door_open.*" V=100 L=1 P=50 T="misc"

Thus you could use Split to break up the line into "sound" and the arguments, and then proceed much the same as before.


OnPluginMXPcloseTag

Just to complete the documentation, in the case of OnPluginMXPcloseTag you get the tag name followed by the text of the tag. eg.

<b>Hi there</b>

In this case the close tag for "b" would have as its argument:

b,Hi there


OnPluginMXPsetVariable

For OnPluginMXPsetVariable the argument is variable name=value, eg.

RoomName=Red Square


OnPluginMXPerror

For OnPluginMXPerror the argument is:

level,number,line_number,message

eg.

I,10008,417,MXP mode change from 'open' to 'permanently secure'





- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


17,095 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at HostDash]