|
Blerghass Beginner
Joined: 25 Nov 2001 Posts: 26 Location: USA
|
Posted: Sat Jan 05, 2002 3:12 am
#SUB triggers and ; or " characters |
I have a trigger:
#TRIGGER {^(*)GSI$} {#if (%word( "%1", 1) = "") {#gag} {#sub "%1"}} "" {case}
Basically, it strips the GSI from the end of the line and gags it if it is just GSI. The problem is that if the stuff before the GSI has a ; character, it won't trigger at all, and if the stuff has a " character, it won't #sub right, and will create another trigger.
I guess I could fix these both with:
#trigger {GSI$} {#sub ""}
but I am still wondering about how to deal with the ; and " problems (for other triggers maybe, if I encounter the problem again). |
|
|
|
iljhar GURU
Joined: 10 Oct 2000 Posts: 1116 Location: USA
|
Posted: Sat Jan 05, 2002 6:42 am |
You might not want to do this, but use the %* in your pattern:
#TRIGGER {^(%*)GSI$} {#if (%word( "%1", 1) = "") {#gag} {#sub "%1"}} "" {case}
See if that does anything for ya.
Iljhar |
|
|
|
Blerghass Beginner
Joined: 25 Nov 2001 Posts: 26 Location: USA
|
Posted: Sun Jan 06, 2002 1:15 pm |
I never knew the difference between (*) and (%*) in trigger patterns. What is the difference and is it specifically relevant to my problem or just something I might try?
|
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Sun Jan 06, 2002 3:38 pm |
* in a pattern matches any number of characters or white spaces, or so the help file claims. In reality, * matches any number of characters and white spaces as long as they are not one of the special reserved character zMUD uses that * will not match. These are: ; @ # % &
%* however does match everything including these special characters. The limitation on * is mostly for security issues so that another character may not do something bad by using these special characters. However, if you do not to match these special characters, then you can use %* but be careful of any possible way that someone could exploit your trigger. Basically, if you do not use what you matched or part of it to execute something, then you are safe.
Kjata |
|
|
|
|
|