|
JWhitney Wanderer
Joined: 20 Oct 2006 Posts: 51
|
Posted: Fri Oct 20, 2006 5:06 am
Stranger Trigger Issue |
I am attempting to create a song tracker for ZombieMUD, but for some reason that seems to escape me, I am missing something in this trigger.
MUD output for this trigger looks like:
Code: |
[ 1]: uplifting melody (Enchantment granting flight) |
Pattern is:
Code: |
^ ~[ 1~]~: (%*) ~((%*)~)$ |
Value is:
Code: |
#var song_1name {%1}
#if (%2 = Enchantment granting flight) {#var song_1 {Flight}}
#if (%2 = Enchantment granting bright light) {#var song_1 {Light}}
#if (%2 = Enchantment granting See Invisibilit) {#var song_1 {See Invis}}
#if (%2 = Healing spell restoring a large amount of health) {#var song_1 {Psalm}}
#if (%2 = Healing spell restoring a decent amount of health) {#var song_1 {Mend}}
#if (%2 = Healing spell restoring a light amount of health) {#var song_1 {Surgeon}} |
Here's what's happening - the pattern matches and sets @song_1name to the correct name, but song_1 itself matches the last #if in the list, 100% of the time. Even though, in this example, @song_1 should = Flight, it always ='s Surgeon.
Am I missing something? The list of #if's should fail each one except the matching one, it should not set @song_1 to Flight, then Light, then See Invis, and so on and so forth.
Thank you for any assistance you may provide. |
|
|
|
rajasetan Beginner
Joined: 14 Sep 2006 Posts: 11 Location: Jakarta, Indonesia
|
Posted: Fri Oct 20, 2006 7:15 am |
Try using
#IF ("%2" == "blah blah") {#var song_1 "blah"}
instead? |
|
|
|
JWhitney Wanderer
Joined: 20 Oct 2006 Posts: 51
|
Posted: Fri Oct 20, 2006 7:47 am |
Tried it, no effect. Anyone understand why the #if (%2 = Healing spell restoring a light amount of health) {#var song_1 {Surgeon}} lines are all acting as if they have a positive match when they don't (or shouldn't)?
|
|
|
|
JWhitney Wanderer
Joined: 20 Oct 2006 Posts: 51
|
Posted: Fri Oct 20, 2006 10:50 am |
Finding a way to work around it, thank you folks for your time.
|
|
|
|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: Fri Oct 20, 2006 11:59 pm |
They both need to be surrounded with quotes to work correctly
as to why it is always returning positive, I explained it to someone a while ago but basiclly strings without the quotes its always gonna be positive
#if ("%2"="Enchantment granting flight") {#var song_1 {Flight}} |
|
|
|
|
|