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

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

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

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: Triggering on MXP
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please)
Maximum of 6000 characters. Text only please, no HTML.
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Sat 15 Aug 2009 03:26 AM (UTC)  quote  ]
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

Posted by Teapot   Australia  (9 posts)  [Biography] bio
Date Fri 14 Aug 2009 07:25 AM (UTC)  quote  ]
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  (18,770 posts)  [Biography] bio   Forum Administrator
Date Fri 14 Aug 2009 06:45 AM (UTC)  quote  ]
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 Fri 14 Aug 2009 06:25 AM (UTC)  quote  ]
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

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.


1,631 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

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

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]