|
Yokito Newbie
Joined: 20 Jan 2006 Posts: 5
|
Posted: Sun Mar 05, 2006 3:16 am
Help with comparing strings. |
Here's the trigger pattern.
(*) says 'I suggest you travel to (*).'
Then this is to compare the area he puts.
#if (%2="Valley of the Elves") {valley} {}
#if (%2="Sewer") {sewer} {}
#if (%2="New Ofcol") {newofcol} {}
#if (%2="Ultima") {ultima} {}
#if (%2="Crystal Tokyo EX") {ct} {}
#if (%2="The Labyrinth") {lab} {}
#if (%2="High Tower of Sorcery") {htos} {}
#if (%2="Gnome Village") {gnome} {}
the true's are aliases to walk there.
For some reason, it executes them all if the area isnt recognized, and sometimes even if it is, any ideas? |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Sun Mar 05, 2006 3:35 am |
#if ("%2"="Valley of the Elves") {valley}
Delimeters are your friends. Those quotes inform zMud that you want to compare then entire contents of %2 with the other string instead of having something evaluate like this:
Code: |
Valley of the Elves="Valley of the Elves" First bunch of words meaningless
Elves="Valley of the Elves" Not true becomes 0, end of expression final step
Valley of the 0 Expression is non-null and non-zero, therefore true |
Also the false portion of the #IF command is optional. If you are not going to do anything there you should leave it out for faster processing time. |
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
|
|