|
Lokke11 Beginner
Joined: 27 Apr 2007 Posts: 16
|
Posted: Thu Sep 11, 2014 6:12 am
Trigger Help! |
I am having a problem with my trigger. What I have deduced is that when the Pattern comes in with a Very Good in the stats the #If command is counting as both the =Good and =Very Good which throw's off my Count Variable.
Pattern: Agility:(%s)&Agi Wisdom:(%s)&Wis
#if (@agi =~ "Good") {#add Count 1}
#if (@agi =~ "Very Good") {#add Count 2}
#if (@agi =~ "Excellent") {#add count 3}
#if (@wis =~ "Good") {#add count 1}
#if (@wis =~ "Very Good") {#add count 2}
#if (@wis =~ "Excellent") {#add count 3}
EXAMPLE:
Agility: Very Good Wisdom: Good
This will make my @count total 4, when it should be totaling 3. (2 for Very Good, 1 for Good)
Any Advice anyone? |
|
|
|
rozdwojeniejazni Wanderer
Joined: 13 Aug 2011 Posts: 74
|
Posted: Thu Sep 11, 2014 7:07 am |
Are you aware that =~ operator means pattern matching - not string comparison? Of course the string "Very Good" matches the pattern "Good".
Use = or == instead, as these mean exact string comparing. |
|
|
|
Lokke11 Beginner
Joined: 27 Apr 2007 Posts: 16
|
Posted: Thu Sep 11, 2014 3:34 pm |
Awesome. Thanks for the fix. Learned something new!
|
|
|
|
|
|