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


Joined: 17 Dec 2001
Posts: 24
Location: USA

PostPosted: Wed Jul 07, 2004 5:55 am   

Special Characters in triggers
 
I am normally pretty good about searching old posts, but I couldn't think of any good things to search for for this. My mud has a section where things are written in "script" where an M is represented with // and so on. I am just translating it.

My problem is that some of the things use Zmud characters, and I need to match the pattern. for example, R is |? and D is |)

some of them I can crudely get around by doubling (for whatever reason it works.) I.E. T is ~|~ and my trigger is ~~|~~ and it works.

I am sure there is a fairly easy way to do this.
Thanks

P.S. If anyone wants to put down here the way to prioritize your triggers, that would be nice so that U |_| doesn't get represented as L |_ or J _| but I saw a post a little bit ago about that so I will search
Reply with quote
mr_kent
Enchanter


Joined: 10 Oct 2000
Posts: 698

PostPosted: Wed Jul 07, 2004 6:51 am   
 

By default the tilde(~) character is defined as the QUOTE CHARACTER. The quote character is used to define the character following it as a literal symbol rather than a 'special character'. Without a tilde, zMud parses special characters differently.

The reason your ~~|~~ example works is because the first tilde causes the second tilde to be an actual tilde instead of a special character. The same goes for the third and fourth. The | symbol isn't defined by default as a special character so it is parsed as a normal character.

You can find a list of special characters in zMud help under Preferences -> Special Characters OR view and/or modify them from the zMud menu bar, View|Preferences|Special Characters...

In order to make the zMud parser recognize any of these special characters as literal characters, they must be preceeded by the quote character.

There are two ways to trigger on the strings you've shown.

One way is the way you're doing it, but you'll need to use the quote character before each the special characters in your pattern. You'll also have to prioritize your triggers as you've said or use %q to delineate the pattern. In the settings editor, either click-drag the trigger to the correct priority position (high priorty is at the top) or use the 'Up' and 'Down' buttons to move the highlighted setting.

A second way to trigger on special characters would be to select Verbatim on the options tab for your trigger. This will cause the parser to ignore special characters altogether and accept them as literal for that particular trigger.
Reply with quote
Murdlih
Beginner


Joined: 17 Dec 2001
Posts: 24
Location: USA

PostPosted: Wed Jul 07, 2004 6:57 am   
 
hey, thanks. I appreciate it.

:)
Reply with quote
LightBulb
MASTER


Joined: 28 Nov 2000
Posts: 4817
Location: USA

PostPosted: Wed Jul 07, 2004 2:23 pm   
 
You might try using the Verbatim option on your triggers. I'm not sure if it will work for partial lines, though.

This will probably prove very difficult, if not impossible, to script. Whoever designed the section probably intended it that way. Good luck!
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