Fang Xianfu GURU

Joined: 26 Jan 2004 Posts: 5155 Location: United Kingdom
|
Posted: Sat Sep 22, 2007 3:01 pm |
What's the value of the @tar variable? A string list?
If that's the case, a simple = won't work, because @a isn't a matching string list.
The =~ operator tries to match what's before it with a pattern that's after it. The pattern should be a normal zScript trigger pattern. You could try (@a =~ "{@tar}") - I don't have zMUD installed on this computer, so I can't check if that'll properly expand @tar. You might also try (@a =~ %concat("{",@tar,"}")), which should definitely work.
There's also a function designed for this purpose - %ismember. You could use #if %ismember(@a,@tar) if you wanted, too.
Also, why are you using @a at all? In this script, you could just use %1 instead and it'd be faster than constantly reading the value of the variable. If you just use it as a dummy variable, you can probably remove it - if you use it for other things, it might be best to give it a more descriptive name. |
|