 |
chamenas Wizard

Joined: 26 Mar 2008 Posts: 1547
|
Posted: Fri May 09, 2008 11:17 am
Suggestion: Direct to Variables |
Maybe make something for the CMUD pattern syntax that attaches a variable to a value right there in the pattern? maybe something like...
#trigger (or regex) trigger {^ you gain \d+:@exp: experience!}
So...
you gain 234 experience!
would set exp to 234 |
|
|
|
 |
Rorso Wizard
Joined: 14 Oct 2000 Posts: 1368
|
Posted: Fri May 09, 2008 11:29 am Re: Suggestion: Direct to Variables |
Try as standard trigger pattern to use &exp instead of @exp and see what happens .
Edit: I usually don't use the regex, but in the manual it is mentioned that in regex you can use (?Varname:exp) to do the same, where exp is a regex for the pattern to match the variable. See #REG. |
|
|
|
 |
chamenas Wizard

Joined: 26 Mar 2008 Posts: 1547
|
Posted: Fri May 09, 2008 11:44 am |
using &variablename in a trigger pattern or (?varname:\w+) catch variable names in the pattern?
|
|
|
|
 |
Rorso Wizard
Joined: 14 Oct 2000 Posts: 1368
|
Posted: Fri May 09, 2008 11:50 am |
| chamenas wrote: |
| using &variablename in a trigger pattern or (?varname:\w+) catch variable names in the pattern? |
Yes so the matched data would then be stored in @variablename. |
|
|
|
 |
Caled Sorcerer
Joined: 21 Oct 2000 Posts: 821 Location: Australia
|
|
_________________ Athlon 64 3200+
Win XP Pro x64 |
|
|
 |
Fang Xianfu GURU

Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Fri May 09, 2008 12:11 pm |
You can also use local variables with ($localvar:something) in both regex and normal triggers, where "something" is whatever you want it to capture.
|
|
|
|
 |
Rorso Wizard
Joined: 14 Oct 2000 Posts: 1368
|
Posted: Fri May 09, 2008 12:13 pm |
| Fang Xianfu wrote: |
| You can also use local variables with ($localvar:something) in both regex and normal triggers, where "something" is whatever you want it to capture. |
I think you can set database variables as well e.g &dbvarname.membername. Is it possible to have a local variable be a database variable? So you could capture $localvar.member? |
|
|
|
 |
Fang Xianfu GURU

Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Fri May 09, 2008 12:20 pm |
I believe so, but I've never tried it. Have a go.
|
|
|
|
 |
|
|
|