question about one trigger that can match two things

Posted by Hefan on Sun 22 Aug 2004 06:03 PM — 5 posts, 20,037 views.

#0
this is what i have
match="^((\d+)h, (\d+)m (\D{0,7})\-\s*|.?)You are blinded.*?$"

and i hope to use it to match either:
You are blinded.
or match:
2714h, 4205m ex-You are blinded.

but it won't work as i intended. is it possible to do something like this with one trigger? if it is,can anyone help me with this? Thanks
USA #1
^(\d+h\, \d+m ex\-)?You are blinded\.$

Youll have to add whitespace where needed, but that should work.

Er, You seem to indicate that the "ex" is also variable? If so, youll need to change the trigger to reflect that as well.
Amended on Sun 22 Aug 2004 07:54 PM by Flannel
#2
hmm..i tried what you said, but it seems the trigger still won't fire. this is what i have:
match="^(\d+h\, \d+m \D{0,7}\-)?\s*Your state of paralysis prevents you from doing that.*?$"

and the trigger can only fire when the message match:
Your state of paralysis prevents you from doing that.

but when the message matches:
2714h, 3670m cexkdb-Your state of paralysis prevents you from doing that.
the trigger won't fire.
any idea what is wrong? thanks
USA #3
Its obviously in that prefix. And its most likely something were overlooking. Like leading spaces, or spaces in between. Try just matching on that first part (dont have a $ at the end of your regexp, and dont do anything but change the color) to see if you can get something to match. The forum eats up whitespace, so I couldnt point you in the right direction if it was.

And you dont have that period at the end in your regexp. If you were planning on it or not. (you never check for a period.)
Canada #4
Just a question, but does that dash always appear in the prompt? If it always does (and is always the last prompt character) couldn't you try:

(^|\-)You are blinded\.$

I do something similar with Aetolia's prompt which looks slightly different but always ends with a ] character.

(^|\])You are blinded\.$

The rest of the information (the ex etc.) is inconsequential for the trigger, so you don't need to bother matching it.