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
Alkatr0z
Newbie


Joined: 09 Aug 2005
Posts: 8

PostPosted: Thu Dec 31, 2009 6:04 am   

Trigger to trigger on HTML output from MUD
 
I'm trying to get a trigger to work on HTML output from the MUD I play, but just cannot get it to work. Heres the relevant HTML & MXP tags

Code:
<span style="color:maroon;"><livingpopup>Cujo</livingpopup></span>

The livingpopup I realise is an MXP tag, I've tried several things so far:

Code:
<livingpopup>Cujo</livingpopup>

as an MXP trigger works fine but not with the <span> since its a HTML entity. Unfortunately I need the HTML aspect in there.. My next attempt was:
Code:
<span style="color:maroon;">.*?</span>

as a normal trigger PerlRE pattern, Unfortunately this fails as well I suspect because the normal trigger triggers on what you see on the screen and so any HTML is ignored since its not in the final output.
The same thing as a MXP trigger also fails since its not an MXP tag.

The prime goal is to trigger on the colour itself being different. The colour is the colour I've selected to highlight other people's names with in the MUD(ingame option).

I'm sure I've just missed something simple in what I need to select but cannot see what it could be. Any help would be much appreciated.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Thu Dec 31, 2009 7:06 am   
 
MXP tags need to have an <!ELEMENT> tag definition in place before they can be recognized as MXP (ie, MXP triggers).

If your game officially supports MXP, you need to let them know that they forgot to define the <span> tag (also, ask them why they didn't just use the <color> tag instead). If your game does not officially support MXP, then <livingpopup> shouldn't be doing anything either and it's up to the user (ie, you) to provide the tag definitions.

Either way, to use MXP triggers you have to have a tag definition in place (it doesn't save across sessions, so put it in an onLoad event):

#MXP <!ELEMENT span ATT="style;" TAG=20 OPEN>

A more detailed demonstration can be found under the ZMud Support link in the menu, the MXP protocol page should still be the last link on that support page.
_________________
EDIT: I didn't like my old signature
Reply with quote
Alkatr0z
Newbie


Joined: 09 Aug 2005
Posts: 8

PostPosted: Thu Dec 31, 2009 7:51 am   
 
Span appears to work fine in CMud as the display is correct as shown in this screenshot:

The log for that snippet is this:
Code:
<span style="color:#008080;">Inventory regeneration complete.</span><br/>
The occasional gargoyle gallivants around on the rooftops.  Perhaps they're having a party.<br/>
[<span style="color:#00B300;">Blystyryng enters Discworld</span>]<br/>
Squelch.<br/>
Someone opens the Mended Drum's door.<br/>
Someone closes the Mended Drum's door.<br/>
A plume of black smoke rises above a building to the west.  That's progress for you.<br/>
Someone opens the Mended Drum's door.<br/>
Someone closes the Mended Drum's door.<br/>
<u><span style="color:maroon;"><livingpopup>Sharcrow</livingpopup></span></u> arrives from the west.<br/>
<span style="color:#800000;">Sharcrow</span> leaves east.<br/>


As you can see there is liberal use of the <span> tags which all appear correctly since they are valid HTML.
The livingpopup is defined by the MUD by the looks of it and is defined properly.

Entering the line you gave me didn't make any difference to the appearance of the MUD(the element tag did show up in the MXP options as a user defined trigger),but didn't allow the MXP trigger
Code:
<span style="color:maroon;">.*?</span>
to run.

I looked at the script debugger and could see the <livingpopup> mxp trigger firing but there was no sign of the <span> trigger firing
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