Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
Hypo
Beginner


Joined: 15 Mar 2007
Posts: 18

PostPosted: Wed Sep 26, 2007 5:45 pm   

MXPtrig and captures?
 
Can I use #MXPTRIG to create a more discriminating tell capture? For a variety of reasons, my current ones that match simple tell text end up capturing tells from all over, or NPC chats. I'd prefer to have my capture window capture only tells to me.

I turned off MXP in order to gather the MXP line from a tell, and it looks like this:
Code:
<event tell from="mienai"><C #EDD400><send href='tell mienai ' PROMPT>Mienai</send> exclaims to you: You must be the most amazing hypopo ever!<BR></event>


I tried #mxptrig {event tell from=*} {#cap tell}, with no luck, so I was wondering if this was even possible.
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Wed Sep 26, 2007 6:36 pm   
 
MXP triggers are interesting. You should be able to match a tell with any "from" with an MXP trigger pattern that's simply event tell. That is, unless the event tag is also sent when NPCs send you tells, but without the "from" attribute.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Hypo
Beginner


Joined: 15 Mar 2007
Posts: 18

PostPosted: Wed Sep 26, 2007 8:50 pm   
 
NPCs can't send tells, so I am safe there.
However, #mxptrig {event tell} {#say You got a tell!} isn't firing when receiving tells on the MUD.
Could this because it's an unrecognized MXP tag? The various <event>s all pop up when debug MXP is turned off.
Reply with quote
Seb
Wizard


Joined: 14 Aug 2004
Posts: 1269

PostPosted: Wed Sep 26, 2007 9:21 pm   
 
What version of CMUD are you using? Unrecognized MXP tags do not fire MXPTRIGgers in 1.x: only in 2.x. So if you are using 1.x you will need to check that the "event" tag is defined.
Reply with quote
Hypo
Beginner


Joined: 15 Mar 2007
Posts: 18

PostPosted: Wed Sep 26, 2007 10:19 pm   
 
Ok, thanks for the info about versions.

I've been using 1.34 generally, though I have 2.03 installed in a separate directory, and it did not seem to be working either.

I'm afraid I'm not too familiar with MXP, so how can I check that <event> is defined?

Thanks!


Edit:

The MUD is Discworld, if that's relevant, and this is sent (and not recognized, kicked to me by debug MXP upon connect.
Code:
<!EVENT tell from="{player}"><!EVENT say from="{player}"><!EVENT soul from="{player}"><!EVENT shout from="{player}"><!EVENT echo from="{player}"><!EVENT emote from="{player}"><!EVENT whisper from="{player}"><!EVENT emoteall from="{player}"><!EVENT combat from="{player}"><!EVENT channel from="{player}" channel="{channels}"><!EVENT talker from="{player}" channel="{talkerchannels}"><!EVENT group from="{player}" command="{groupcmds}"><!EVENT club from="{player}" club="{clubnames}"><!EVENT map><!EVENT score><!EVENT inform from="{player}" type="{informtype}"><!EVENT inventory><!define player "Details about the player" guild="{guilds}" guilddesc="The guild the player belongs to" clubs="clubs" clubsdesc="All the clubs the player belongs to" family="family" familydesc="The family the player is in" killer="yes|no" killerdesc="The player is a playerkiller" friend="yes|no" frienddesc="Member of the friends list on the mud">


Last edited by Hypo on Wed Sep 26, 2007 10:38 pm; edited 1 time in total
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Wed Sep 26, 2007 10:37 pm   
 
Try creating a simpler MXP trigger in v2.03 like this:

#MXPTRIG {event} {#say event fired}

to see if it is triggering on the event at all. It's possible that the "event tell" argument testing isn't working on undefined tags. If that works, then you can try:

#MXPTRIG {event} {#IF (!%null(%mxp.tell)) {#say You got a tell!}}

This will test to see if the "tell" argument was given and maybe that will work. If not, let me know since it might be a bug in v2.03. However, I'm curious why your MUD is using other MXP tags but hasn't defined the "event" tag. MUDs that support MXP are supposed to define all of the custom tags that they use.
Reply with quote
Hypo
Beginner


Joined: 15 Mar 2007
Posts: 18

PostPosted: Thu Sep 27, 2007 1:00 am   
 
Ok, I tried #MXPTRIG {event} {#say even fired} in my 2.03 install, and it wasn't firing regardless of the types of events received.

And it looks like I edited just after you posted Zugg, so the stuff received upon connect should be new to you. Regardless, even the plain trigger wasn't firing.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Thu Sep 27, 2007 1:58 am   
 
Quote:

<!EVENT


Does !event work? It might be an issue similar to the <tag/> problem fixed earlier, since according to CMud <tag> did not equate to <tag/>.
_________________
EDIT: I didn't like my old signature
Reply with quote
Seb
Wizard


Joined: 14 Aug 2004
Posts: 1269

PostPosted: Thu Sep 27, 2007 2:02 am   
 
Try:
#MXP <!element event OPEN>
from the command line and see if that helps. This will define event elements (as OPEN tags).
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Thu Sep 27, 2007 8:14 am   
 
MattLofton wrote:
Does !event work?

It's not part of the MXP spec - it must be defined somewhere else.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Thu Sep 27, 2007 4:38 pm   
 
You might want to contact the admins at DiscWorld to find out what protocol they are using. !EVENT is not part of MXP. Maybe it was part of Pueblo, but I've never seen it before. Or maybe it is part of some other MUD client that they are supporting. It would be nice to find out what it is supposed to do so that CMUD could support it.
Reply with quote
Hypo
Beginner


Joined: 15 Mar 2007
Posts: 18

PostPosted: Thu Sep 27, 2007 6:03 pm   
 
Ok, I asked on Discworld, and I guess they are further extensions to MXP?
I was given a link to http://whelkmud.sourceforge.net/mxp_extensions.html.
With a little luck, I'll be able to track down who implemented them on Discworld and see if there is further documentation.

I take it that for the moment I will be unable to trigger on them, as they aren't quite MXP?
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Thu Sep 27, 2007 7:18 pm   
 
Let me know what you find out. I'm a bit annoyed that they are calling these "MXP" extensions when they didn't bother to contact any of us who originally wrote the MXP spec in the first place. I wouldn't call them "MXP" extensions...I'd call them "Discworld" extensions. Not sure what they are doing or how they plan to get any support from MUD client writers by just doing this themselves.

MXP is designed to trigger on "normal" tags. Tags like !EVENT have the ! in front, and are not normal tags. The !ELEMENT and !ENTITY tags used in MXP come directly from the XML standard. There is no such !EVENT in XML, so they are just inventing new stuff without paying any attention to the standards that MXP is based upon. That's a very bad way to add extensions.

Encourage them to come here and start a discussion of MXP extensions. But I would definitely complain to them about this since what they are doing really has nothing to do with MXP as it was defined by myself and Nick Gammon (of MUSHclient).
Reply with quote
Hypo
Beginner


Joined: 15 Mar 2007
Posts: 18

PostPosted: Thu Sep 27, 2007 8:30 pm   
 
Looking back at it, I think this is a bit of an abstract idea that was never completely implemented.

I hope I didn't cause any offence- Nobody at Discworld is claiming these are real MXP extensions, in fact, they're never mentioned. I just happened to notice them being spit out with debug MXP on, and assumed they were MXP with nothing else to go on. I took a look at the WhelkMud client development page, and I think the whole thing was a bit of an idea that was later abandoned before it got to the stage where they wanted support, which is probably why they never talked to you or Nick Gammon, and now they're just remnants in the code.

I'd say most of us at discworld have no idea that these event tags were being sent, and some of us that noticed (like myself) just assumed they were MXP- nobody at the MUD itself has ever mentioned they existed to me, let alone claim them as MXP. Still, I'll see if I can find who's behind the tags, and point them this way.

Thanks!
Reply with quote
Seb
Wizard


Joined: 14 Aug 2004
Posts: 1269

PostPosted: Thu Sep 27, 2007 8:39 pm   
 
!events are pretty daft, as they could just have been defined as !elements and they would have just worked! I can't see what the benefits of !events over !elements is.
Anyway, did you try my suggestion?
#MXP <!element event OPEN>
Reply with quote
Hypo
Beginner


Joined: 15 Mar 2007
Posts: 18

PostPosted: Thu Sep 27, 2007 9:51 pm   
 
Seb, just tried your suggestion now.

Defining it like that seems to work (it stops showing up with Debug MXP turned on), however, I still can't get it to fire with #mxptrig, not even on #mxptrig {event} {say event fired}.

Tried this in both 1.34 and 2.03 and behavior seemed the same both times.



EDIT:
There was some behavior, though. Very rarely, but sometimes, things that would usually be <event>s had random formatting changes- italicized or underlined.
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Thu Sep 27, 2007 11:33 pm   
 
OK, thanks for the clarification on that. I didn't realize that "WhelkMud" was a MUD client. It's possible that in a future version I'll allow MXP triggers to also fire on tags that start with a !

I'm not sure why it's not working after you define the tag though. You might try just

Code:
#MXP <!element event>


to define it as a "secure" tag in case they are sending this tag on a secure MXP line from the MUD.
Reply with quote
Seb
Wizard


Joined: 14 Aug 2004
Posts: 1269

PostPosted: Fri Sep 28, 2007 12:30 am   
 
Hmm, your code is not displaying Zugg!
But here it is:
Quote:
#MXP <!element event>
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Fri Sep 28, 2007 1:24 am   
 
I added some code tags to the post to make it a little clearer. How very bizarre!
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Hypo
Beginner


Joined: 15 Mar 2007
Posts: 18

PostPosted: Fri Sep 28, 2007 1:26 am   Progress!
 
Ok, looked at Seb's suggestion, and thought to try
#MXP <!element Event OPEN>
And now all the #MXPTRIGs fire properly. I guess it was just capitalisation that was the issue.
Though #capture is now capturing something- my tell window gets the update green dot, but it captures the line from immediately beforehand, rather than the one following, most often >, the MUD prompt. Is there a way to make it capture the tell instead?
Reply with quote
Fang Xianfu
GURU


Joined: 26 Jan 2004
Posts: 5155
Location: United Kingdom

PostPosted: Fri Sep 28, 2007 1:40 am   
 
That's interesting. Sounds like a bug, given the layout of your text in your original post.

For now, try using #window with the %line2 variable.
_________________
Rorso's syntax colouriser.

- Happy bunny is happy! (1/25)
Reply with quote
Seb
Wizard


Joined: 14 Aug 2004
Posts: 1269

PostPosted: Fri Sep 28, 2007 8:54 am   
 
So, does the pattern of your MXPTRIG have a capital leading E or not? Does it only work with a lowercase e, uppercase E, or either, and only the #MXP <!element part is case-sensitive?
e.g.
#mxptrig {event} {say event fired}.
Or
#mxptrig {Event} {say Event fired}.

You could use #window with %0. I don't think %line2 will give you what you want either based on my testing in v2.02.
Reply with quote
Hypo
Beginner


Joined: 15 Mar 2007
Posts: 18

PostPosted: Mon Oct 01, 2007 9:11 pm   
 
No, I don't have a capital E there.
The willingness of the trigger to fire seems to be entirely based on my terminal setting with the MUD. With Terminal ansi the trigger fires fine, if I change the terminal type to MXP it does not. Somehow my addled brain decided that was a capitalisation issue, but I haven't been able to reproduce it in capitalisation since, and changing the terminal type works, even if I dislike Term ANSI.

My assumption is that the #MXPTRIG is firing before the rest of the line, containing the visible text from the MUD, has been displayed?

I tried #MXPTRIG {even tell} {#window tell %0} and though it is firing, it's not capturing to the window.
Reply with quote
Seb
Wizard


Joined: 14 Aug 2004
Posts: 1269

PostPosted: Mon Oct 01, 2007 9:30 pm   
 
Hmm, you have a <BR> before the </event>... If the <event> tag was not on a secure MXP line, and this is an actual new line character (rather than the <BR> tag), you will need to use:
#MXP <!element event MULTILINE>
This was a feature added in v2.02.
So try that...
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net