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
Gael
Beginner


Joined: 18 Sep 2006
Posts: 29

PostPosted: Sun Apr 04, 2010 9:38 pm   

Local MXP color tags not working when used in a trigger
 
Hi zuggers,

Recently my mud updated some of its MXP support and since that time I've been having the following trouble:

I have several CMUD triggers that #ECHO text to the main session window using the <color> MXP tag. These worked just fine for quite a while, but now the output is just showing the actual color tags as well as what I wanted to display. Eg:

I want to see:
Code:
This is a red word
with the word 'red' actually in red. What I'm actually seeing is:
Code:
This is a <color red>red</color> word.


The confusing part is that this only seems to happen on triggers. If I make an alias that does the same thing..

Code:
#ALIAS mxptext {#ECHO "This is a <color red>red</color> word."}


... it works just fine. Same if I use the command line.

It's only on triggers where I'm experiencing the problem. The triggers themselves are firing just fine, and that part of the script has no interaction with the mud itself. It's just an #ECHO display.

Am I missing some necessary setting on the triggers? Any other ideas?

Any help would be much appreciated! Thanks.
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Mon Apr 05, 2010 1:25 am   
 
Odd. Is the trigger sending to a different window? If it is, click on Options|General|Session in that specific window. Make sure the Telnet Options and the MXP/HTML are both checkmarked.

You could try using #say instead of #echo. There is a slight difference in #echo vs. #say when used in triggers, but I would not expect that to give this result, unless the trigger is sending it to a different window, as I mention above.
Reply with quote
Private
Adept


Joined: 10 Jan 2002
Posts: 264
Location: USA

PostPosted: Thu Apr 08, 2010 5:52 pm   
 
<alias name="mxptext" id="4702">
<value>#MXP This is a &lt;color %1&gt;%1&lt;/color&gt; word.</value>
</alias>

#ALIAS mxptext {#MXP This is a ~<color %1~>%1~</color~> word.}
or
#ALIAS mxptext {#MXP This is a ~<color red~>red~</color~> word.}

for your specific example. :)
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Thu Apr 08, 2010 6:28 pm   
 
He already came up with an alias that works. What we are trying to figure out is why the same command isn't working from within a trigger. Gael, you didn't answer whether the trigger is sending to a different window? If you are still having problems, could you post your actual trigger?
Reply with quote
Gael
Beginner


Joined: 18 Sep 2006
Posts: 29

PostPosted: Sat Apr 10, 2010 8:43 pm   
 
Some further testing revealed that it's definitely got something to do with the mud. If I test the trigger below offline it works fine, including displaying the colours properly. If text comes in from the mud and fires the trigger (which does happen correctly) then I only see the codes as described in my original post. So what from the mud would 'turn off' handling of client-side-only MXP parsing??

Pattern:
Code:

You say: ({red|green|yellow|blue}) (*)

And associated script:
Code:

#LOCAL $colour
#LOCAL $what
#LOCAL $msg

$colour = %1
$what = %2
$msg = "A "
#SWITCH {$colour}
  ("red") { $msg = %concat($msg,"<color red>red</color>") }
  ("green") { $msg = %concat($msg,"<color green>green</color>") }
  ("blue") { $msg = %concat($msg,"<color blue>blue</color>") }
  ("yellow") { $msg = %concat($msg,"<color yellow>yellow</color>") }

 
$msg = %concat($msg," ",$what)

#ECHO $msg


Thanks,
Gael
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Sat Apr 10, 2010 9:35 pm   
 
Quote:

So what from the mud would 'turn off' handling of client-side-only MXP parsing?


The MXP spec on the Zuggsoft.com website

The 'what' is a line tag at the beginning of the line that tells CMud how to process it in terms of MXP/HTML. Some modes tell CMud how to handle the parsing of the line, some modes let games use MXP only for the automapper, and some modes are shorthand versions of regular tags set up by the game so that they can do %e[36zText sent to user instead of <tag>Text sent to user</tag>.

While users can certainly set their own tags, I'm not sure if they can use this shortened syntax (and if they can, I don't know how).

Mode 2 and Mode 7 turn off MXP parsing entirely "until the next newline" and "as the default mode", respectively. Mode 7 is generally the wrong mode to use for a game that supports MXP, unless they are sending you examples of MXP/HTML tag formats.
_________________
EDIT: I didn't like my old signature
Reply with quote
Private
Adept


Joined: 10 Jan 2002
Posts: 264
Location: USA

PostPosted: Sun Apr 11, 2010 12:32 pm   
 
try changing the #ECHO in your script to #MXP ... see if it works
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