|
Maximus Wanderer
Joined: 21 May 2001 Posts: 59 Location: USA
|
Posted: Wed Mar 05, 2003 6:48 pm
Equality of string variables |
I feel really stupid for forgetting this, as I had it working at one time, but here's the problem:
Room names on my MUD appear in a unique color. So, I have a trigger with the pattern ^(*).
I then set the Line Color porperty and the trigger fires just fine on all room names. Now, the problem comes in what actually happens inside that trigger. I have a variable RoomName that has the name of an important room. What I want to do is test whether the room name sent from the MUD matches RoomName. Currently I have:
#IF (@RoomName = %1) {#SAY Yes} {#SAY No}
Problem is, this always returns true, even if @RoomName and %1 are obviously not equivalent strings (I've had it output both upon triggering to make sure it was testing the right things).
How od I do this porperly?
-Maximus |
|
|
|
Maximus Wanderer
Joined: 21 May 2001 Posts: 59 Location: USA
|
Posted: Wed Mar 05, 2003 6:55 pm |
Hmm, okay, so I just tried this:
#IF (%eval(%1) =~ %eval(@RoomName)) {yada} {yada}
...and it works. But is this the best solution? I don't remember having to do this.
-Maximus |
|
|
|
Kjata GURU
Joined: 10 Oct 2000 Posts: 4379 Location: USA
|
Posted: Wed Mar 05, 2003 9:02 pm |
Surround the %1 with double quotes:
#IF (@RoomName = "%1") {#SAY Yes} {#SAY No}
Kjata |
|
|
|
|
|