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


Joined: 25 Nov 2001
Posts: 26
Location: USA

PostPosted: 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).
Reply with quote
iljhar
GURU


Joined: 10 Oct 2000
Posts: 1116
Location: USA

PostPosted: 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
Reply with quote
Blerghass
Beginner


Joined: 25 Nov 2001
Posts: 26
Location: USA

PostPosted: 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?
Reply with quote
Kjata
GURU


Joined: 10 Oct 2000
Posts: 4379
Location: USA

PostPosted: 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
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