|
Gage Beginner
Joined: 07 Jan 2003 Posts: 23
|
Posted: Mon Mar 03, 2003 3:43 am
Matching variables |
In the pattern:
^You {step|kick|smash|circle kick|stomp|stomp-kick|spin-kick|lunge|attack|leg-twist|side-kick|thud|gouge|strike|bearhug|jump-kick|back-kick|SNAP-KICK|FLY-KICK}
How would I find out which variable matched? |
|
|
|
TonDiening GURU
Joined: 26 Jul 2001 Posts: 1958 Location: Canada
|
Posted: Mon Mar 03, 2003 3:52 am |
In the pattern:
^You ({step|kick|smash|circle kick|stomp|stomp-kick|spin-kick|lunge|attack|leg-twist|side-kick|thud|gouge|strike|bearhug|jump-kick|back-kick|SNAP-KICK|FLY-KICK})
Value:
#VAR Match {%1}
Ton Diening |
|
|
|
Gage Beginner
Joined: 07 Jan 2003 Posts: 23
|
Posted: Mon Mar 03, 2003 4:50 am |
Hum, That doesn't seem to be working correctly.
This is what I have:
#CW white
@attack_match = %1
#IF ( @attack_match == "circle kick") {
say test
}
I have also had it VAR attack_match %1, but that did not work either.
I don't really care about the attack_match variable, I just want to be able to match which attach was detected with either an IF statement or a CASE statement if zmud supports those. |
|
|
|
LightBulb MASTER
Joined: 28 Nov 2000 Posts: 4817 Location: USA
|
Posted: Mon Mar 03, 2003 5:29 am |
#VAR attack_match {%1}
LightBulb
Advanced Member |
|
|
|
Gage Beginner
Joined: 07 Jan 2003 Posts: 23
|
Posted: Sat Mar 29, 2003 10:52 am |
#VAR attack_match {%1} isn't capturing what I need either.
And I'm finding alot of uses for this....
Heres another example of what I would like to do:
Pattern:
^%1 {type1|type2|type3} {coin|coins}$
Action:
Get %2
OR
#VAR temp {%2}
get @temp
However, the value of the {type1|type2|type3} list doesn't seem to be saving in the %2 variable.
Any sugestions? |
|
|
|
Wrudyn Novice
Joined: 24 Mar 2003 Posts: 44 Location: USA
|
Posted: Sat Mar 29, 2003 11:09 am |
^%1 ({type1|type2|type3}) {coin|coins}$
The parenthesis are important. And you really shouldn't use %1 in a trigger pattern. Use * if you need to match several things at once, but in your case you can take out the whole ^%1 and it won't make a difference. |
|
|
|
Gage Beginner
Joined: 07 Jan 2003 Posts: 23
|
Posted: Sat Mar 29, 2003 12:00 pm |
Got it with this...
Pattern:
^(*) ({type1|type2|type3}) {coin|coins}$
Action:
get "%2"
Now I just have to do the same for the first one.
Thanks all who help,
Gage |
|
|
|
|
|