|
Daagar Magician
Joined: 25 Oct 2000 Posts: 461 Location: USA
|
Posted: Tue Dec 10, 2002 7:36 pm
Simple trigger help |
I feel silly asking this, but the syntax is beyond me today. I need to have a single trigger that can trigger on:
E[]
and on:
E[42%]
Obviously, to trigger on each case individually is a snap. But how do I make a single trigger that can react to both cases? Thanks. |
|
|
|
Charbal GURU
Joined: 15 Jun 2001 Posts: 654 Location: USA
|
Posted: Tue Dec 10, 2002 8:38 pm |
How about:
#TRIGGER {E~[(%*)~]} {#SAY Value between brackets is "%1"}
- Charbal |
|
|
|
Daagar Magician
Joined: 25 Oct 2000 Posts: 461 Location: USA
|
Posted: Tue Dec 10, 2002 9:38 pm |
Close, but I need to capture the numerical value separate from the % symbol (ie., grab the '42' alone, with something like E~[(%d}~%~]). Unfortunately, that breaks the case where it is empty (E[]). |
|
|
|
Charbal GURU
Joined: 15 Jun 2001 Posts: 654 Location: USA
|
Posted: Tue Dec 10, 2002 10:28 pm |
Okay, try:
#TRIGGER {E~[(*){%|}~]} {#SAY Number value between brackets is "%1"}
- Charbal |
|
|
|
Daagar Magician
Joined: 25 Oct 2000 Posts: 461 Location: USA
|
Posted: Wed Dec 11, 2002 12:01 am |
Thanks! That works. I had tried a variation of that and couldn't make it work:
E~[{(%d)~%|}~]
This will do fine, though. |
|
|
|
|
|