|
Gael Beginner
Joined: 18 Sep 2006 Posts: 29
|
Posted: 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:
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. |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: 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. |
|
|
|
Private Adept
Joined: 10 Jan 2002 Posts: 264 Location: USA
|
Posted: Thu Apr 08, 2010 5:52 pm |
<alias name="mxptext" id="4702">
<value>#MXP This is a <color %1>%1</color> 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. :) |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: 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?
|
|
|
|
Gael Beginner
Joined: 18 Sep 2006 Posts: 29
|
Posted: 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 |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: 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 |
|
|
|
Private Adept
Joined: 10 Jan 2002 Posts: 264 Location: USA
|
Posted: Sun Apr 11, 2010 12:32 pm |
try changing the #ECHO in your script to #MXP ... see if it works
|
|
|
|
|
|