|
Emit Magician
Joined: 24 Feb 2001 Posts: 342 Location: USA
|
Posted: Sat Jan 18, 2003 11:55 pm
mxp things |
does anybody know of or have a function that will strip mxp tags from a string? or know a good way to do this?
also, i've seen the #debug command mentioned, but i can't find the documentation/help for it. you can use this to see info on mxp, right? how is it used? |
|
|
|
Emit Magician
Joined: 24 Feb 2001 Posts: 342 Location: USA
|
Posted: Sun Jan 19, 2003 12:05 am |
one more thing, is it possible to make a trigger both an mxp trigger and a reparse trigger?
|
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sun Jan 19, 2003 12:56 am |
quote:
one more thing, is it possible to make a trigger both an mxp trigger and a reparse trigger?
Both are trigger states, right? I don't think that'd be possible to assign the same single trigger two different states, but you could create two different triggers with two different states that would then fire simultaneously.
li'l shmoe of Dragon's Gate MUD |
|
|
|
Emit Magician
Joined: 24 Feb 2001 Posts: 342 Location: USA
|
Posted: Sun Jan 19, 2003 1:46 am |
well, here's what i'm trying to do
line in->
(OOC) [Mudperson] '<C #00F5FF>A message</C>'
with different ansi color codes mixed outside of the mxp tags. i want to substitute <C #00F5FF> for a different color, but only on an (OOC) line, not all occurences. Also the number (00F5FF) is subject to change. i have this script:
#TRIGGER {^~(OOC} {color = 667788;#T+ mxp}
#CLASS {mxp}
#TRIGGER {C #(%d)} {#SUBSTITUTE %1 {@color}
#ECHO fired
#T- mxp} "" {mxp|prompt}
#CLASS 0
problem is, the second trigger doesn't go off.
if i could strip the mxp tags from a string i could do something like this:
#tr {^~(OOC~) ~[%w~] '(*)'$} {
#sub %1 {<color @newcolor>@stripmxp(%1)</color>}
}
but i'm looking for a way that doesn't go into designing @stripmxp()
i thought maybe the second trigger wasn't firing because i'm off on the pattern (even though i'm pretty sure thats whats being sent) and thought that #debug might help me intercept and examine mxp tags?
anyway, i hope this sheds a little more light on my problem |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Sun Jan 19, 2003 6:32 am |
hmm, so you know the line will be colored in a certain way but don't care what the color will be because you want to replace it? Why not match the entire line and simply replace the color yourself?
#trigger {^~(OOC~) ~[(*)~] '(*)'} {#substitute {~(OOC~) ~[%1~] '"<c #@color>"%2"</c>"'}}
li'l shmoe of Dragon's Gate MUD |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Sun Jan 19, 2003 1:46 pm |
This is just what the MXP triggers were created for. Take a look at the #MXPTRIG command help entry.
Also, #DEBUG is one of those hidden feautures, like CTRL-Q, which are not documented anywhere.
Kjata |
|
|
|
TonDiening GURU
Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
|
|
|
Emit Magician
Joined: 24 Feb 2001 Posts: 342 Location: USA
|
Posted: Sun Jan 19, 2003 6:31 pm |
matt: 2 reasons why not to replace the entire line.
1) i'd like to preserve the original ansi color codes (there are lots of them). i could replicate them, but thats lots of work :P.
2) unless i'm wrong, the %2 in your trigger still has mxp tags in it, so the line would end up looking like this
(OOC) [person] '<c #@color><C #theircolor>message</C></c>'
effectively overwriting my mxp colors (i had already tried it, and came up with solution of stripping mxp tags from a string, might be best solution, unless i can get the mxp trig to work).
kjata: yah, i know that what mxp triggers are for . my example had an mxp trigger, but i couldn't get it to fire. i.e. i don't know how to make the pattern to trigger on the line i showed. i tried:
#tr {<C #(%d)>} {#echo fire} "" {mxp|prompt}
#tr {C #(%d)} {#echo fire} "" {mxp|prompt}
#tr {color #(%d)} {#echo fire} "" {mxp|prompt}
and none them went off :( |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Sun Jan 19, 2003 6:36 pm |
Well, I can't test right now, but as per the help file, I would guess that the trigger would be:
#MXPTRIG {color #00F5FF} {%mxp.fore="#667788"} "" {prompt|nocr}
Kjata |
|
|
|
Emit Magician
Joined: 24 Feb 2001 Posts: 342 Location: USA
|
Posted: Mon Jan 20, 2003 4:56 pm |
this doesn't appear to be working right.
i entered the trigger as you showed and tried
#show <color #00F5FF>color change</color>
i change it to
#MXPTRIG {color #00F5FF} {%mxp.fore="#667788";#echo fire} "" {prompt|nocr}
and i don't think the trigger is firing (don't see an echo) is this a bug or am i still not understanding something?
-emit
(misses obvious things sometimes) |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Mon Jan 20, 2003 5:41 pm |
Yes, I could not test it with #SHOW (even the example provided in the help file). Try to see if output from the MUD makes it fire. Otherwise, try sending an e-mail to Zugg to see if it a bug.
Kjata |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Mon Jan 20, 2003 6:03 pm |
Opened blank zMUD window (from character selection screen, press ESC)
Pasted in trigger
#MXPTRIG {color #00F5FF} {%mxp.fore="#667788";#echo fire} "" {prompt|nocr}
Pasted in show
#show <color #00F5FF>color change</color>
zMUD output (includes echo of "fire")
color #00F5FFfire>color change/color
<color #00F5FFfire
In fact, it actually echoes "fire" twice
*shrug*
LightBulb
Senior Member |
|
|
|
Emit Magician
Joined: 24 Feb 2001 Posts: 342 Location: USA
|
Posted: Tue Jan 21, 2003 1:05 am |
is it possible the mxptrig doesn't fire because the mud sets mode to permenant secure? or would this just prevent elements of %mxp from changing? or neither?
moon.icebound.net:9000 |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Tue Jan 21, 2003 2:26 am |
Yes, it does fire. I didn't notice it before because the text in #SAY is outputted before the text is colored by MXP, thus it gets overwritten. This can be seen with:
#MXPTRIG {color red} {#SAY fire} "" {prompt|nocr}
#SH ~<color red~>test~</color~>
However, it still does not want to set the color to the new one, even when using <font> which I know is open. Seems like a bug to me.
Kjata |
|
|
|
Emit Magician
Joined: 24 Feb 2001 Posts: 342 Location: USA
|
Posted: Fri Jan 24, 2003 12:13 am |
is there a way to disable mxp from the command line? if there was i thought i might do something like:
#TRIGGER {~(OOC~) ~[*~] '(%*)'} {
;#turnoffmxpcommand
#PCOL red %x1
;#turnonmxpcommand
}
--------
moon.icebound.net:9000 |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Fri Jan 24, 2003 8:29 am |
If the goal is to color the entire line, use this:
#CW {^~(OOC~)*} {mxp~#667788}
LightBulb
Senior Member |
|
|
|
|
|