|
Babyl Beginner
Joined: 15 Oct 2000 Posts: 24 Location: USA
|
Posted: Sat Jul 19, 2003 11:25 pm
Question about semi-colon in a trigger |
trigger is this
#tri {(%w) (%w) '(*)'} {#cap chatter}
if i get this from the mud....
Jobob narrates 'i l;ike this mud!'
the trigger does not match, is this a bug, or is there a way around this?
thanx,
Babyl |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Sat Jul 19, 2003 11:41 pm |
It's not a bug, it's intentional. Since ; is the command separator, matching this character and using what was matched in the trigger might allow others to execute code in your zMUD. There is a way around this. First, if you are not doing anything with what a wildcard matches, then there is no need to surround it in parenthesis. You pattern now becomes:
%w %w '*'
Next, since * will not match a ;, you need to use a wildcard that does match it. %* is the one that does this. This is not easily found in the help file because it is a possible security risk. However, if you are not doing anything with what it matches, then it is safe to use it. Your pattern would then be:
%w %w '%*'
If you do need to use what this wildcard matches, you must never surround it in parenthesis and use %1..%n to access it. The only safe way to this would be like:
%w %w '&%*{message}'
which would save what %* matches to variable named @message and you would access it with:
%expand(@message, 1)
So basically, you can match ;'s, but you must be very careful how you do it. |
|
|
|
Babyl Beginner
Joined: 15 Oct 2000 Posts: 24 Location: USA
|
Posted: Thu Jul 24, 2003 5:26 am |
Thanks a lot, this is a big help! One more question, is capturing to a seperate window considered, using? Or is that a safe command to use on it?
Babyl |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Thu Jul 24, 2003 10:41 am |
#CAPTURE captures the entire line, not just the part of it that matches the trigger. This means your trigger pattern doesn't need to match the entire line, so you don't need to use * at all.
#TR {^%w %w '} {#CAP chatter} |
|
|
|
|
|
|
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
|
|