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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
kilthan
Wanderer


Joined: 21 Jan 2003
Posts: 76

PostPosted: Wed Mar 26, 2003 8:21 am   

character stripping
 
Ok here's my trigger that captures thoughts and puts it into a new window in a different format.

#TRIGGER {Your mind hears (%w) thinking, (*)}
{
#GAG
#WINDOW {Thoughts} {%ansi( high, red)~[%1~] %ansi( high, green)%2 %ansi( high, yellow) %time( "~[hh:nn:ss am/pm~]")}
}


Example mud output:

Your mind hears Drakyr thinking, "Trader is on duty at a gem shop near you. Come on by and let me unload them heavy gems for you."

which turns into

[Drakyr] Trader is on duty at a gem shop near you. Come on by and let me unload them heavy gems for you. [12:41:03 am]

in the Thoughts window (looks much nicer in zmud trust me)

Now the two quote marks on the outside are fine and get stripped but if there is a quote mark or any other special character inside of that, all that gets displayed to the other window is: {

Now finally to my question(just wanted to cover everything), how do I stop it from stripping any characters from %2?
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Wed Mar 26, 2003 12:12 pm   
 
#TRIGGER {Your mind hears (%w) thinking, &%*{Thought}}
{#GAG;#WINDOW {Thoughts} {%concat(%ansi( high, red),"[%1] ", %ansi( high, green),%expand(@Thought,1), %ansi( high, yellow), %time( " [hh:nn:ss am/pm]"))}}

This changes the trigger to use the highly hazardous %* wildcard. This wildcard allows capturing of all special characters. It is directly captured to a variable so that expansion can be completely controlled.
Reply with quote
kilthan
Wanderer


Joined: 21 Jan 2003
Posts: 76

PostPosted: Wed Apr 02, 2003 1:01 am   
 
there is still a problem with the < > characters

Your mind hears Someone thinking, "<laughs>"

turns into

[Someone] "" [time]
Reply with quote
Wrudyn
Novice


Joined: 24 Mar 2003
Posts: 44
Location: USA

PostPosted: Wed Apr 02, 2003 3:37 am   
 
In the general preferences, uncheck the box "enable mxp", or at least check the box "debug mxp"
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Wed Apr 02, 2003 4:15 am   
 
You may have to turn off Allow <> for expand in the Script Parser preferences.
Reply with quote
kilthan
Wanderer


Joined: 21 Jan 2003
Posts: 76

PostPosted: Wed Apr 02, 2003 4:34 am   
 
None of those work.
Reply with quote
zlaker
Newbie


Joined: 01 Apr 2003
Posts: 9

PostPosted: Wed Apr 02, 2003 6:41 am   
 
Please let me know if you figure this out Kilthan.

I've been puzzling the same thing myself, for the exact same purpose infact.

But I figure: why do I want to hear the emotes people are using in their gweth conversations anyway?
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed Apr 02, 2003 11:51 am   
 
There's a simple solution.
#TR {Your mind hears (%w) thinking, } {#CAP Thoughts}

Of course, you'll have to accept the MUD's formatting/colors, but it will capture the special characters. You can even get most of the formatting you wanted:
#TR {Your mind hears (%w) thinking, } {:Thoughts:#SAYP {%ansi( high, red)~[%1~] %ansi( yellow)~[%time( hh:nn:ss am/pm)~] %ansi( high, green)};#CAP Thoughts}

LightBulb
Advanced Member
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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