|
Cartan Newbie
Joined: 21 Feb 2002 Posts: 3 Location: USA
|
Posted: Thu Feb 28, 2002 5:19 am
Matching MUD text containing brackets? |
I've been trying to get a trigger working that captures certain text on the MUD, and then sends it to a friend. Well, everything works just great, except if the captured text has brackets. Such as:
Farlong - [-] Temple of Midgaard [-]
Obviously, because zMUD tries to eval -, which then causes an error. Is there any way I could match that text, and put it into a variable, either stripping out the []'s or just escaping them? I know I can change this by disabling [] for eval, but I'd rather not do that, if possible.
And the %quote function doesn't handle it. In fact, I could write a routine to go through and %replace them or whatnot, but everything along those lines that I've tried still results in an error.
Any ideas?
-- Dave |
|
|
|
Agroamar Beginner
Joined: 09 Feb 2002 Posts: 10 Location: USA
|
Posted: Thu Feb 28, 2002 5:52 am |
Ah, try this.
#Trigger {Farlong - ~[-~] Temple of Midgaard ~[-~]} {Do whatever}
Use the little squiggly things to make it so Zmud doesn't mistake it for a special character. Hope this helps :) |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Thu Feb 28, 2002 11:04 pm |
quote:
Ah, try this.
#Trigger {Farlong - ~[-~] Temple of Midgaard ~[-~]} {Do whatever}
Use the little squiggly things to make it so Zmud doesn't mistake it for a special character. Hope this helps :)
A better way would be to turn on VERBATIM mode for the trigger. When you are matching a static pattern like this:
I got a %12 grade on my test
verbatim will allow you to create a literal pattern of the above:
I got a %12 grade on my test
instead of a dynamic pattern using wildcards:
I got a ~%%d grade on my test
li'l shmoe of Dragon's Gate MUD |
|
|
|
|
|
|
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
|
|