I've always had some problems with what Fizban says here:
www.tbamud.com/forum/2-general/1674-trig...-mob-command-example
Fizban wrote: To not make all substrings pass as true, and only those that are an actual abbreviation the following workaround is necessary:
Code:
set orb 'orb
if %cmd.mudcommand% == look && %orb.contains('%arg%)%
I totally agree with him, I just have problems implementing it. It seems easy enough but it takes me a lot of poking and prodding to make it work. And even after all that poking and prodding, I never seem to understand how I actually made it work anyway.
But now things are getting worse for me. I'm thinking of changing my trigger from ifs to switches. Is there a way of, okay, just thinking about this makes me so dizzy I can't describe it! But here's an example:
Code:
switch %arg%
case orb
do_whatever
break
default
do_whatever_else
break
done
Is there a way to make that "%orb.contains('%arg%)%" in a switch situation? Yes, I realize that I could do it like so:
Code:
case orb
case o
case or
do_whatever
break
but that's just silly, isn't it? And it really only works because orb is such a short word. So what I guess I'm looking for is (if possible), the syntax to compare an abbreviation to the required word.