Help - Search - Members - Calendar
Full Version: Zmud Help
Achaea's Forums > Off-Topic > Tech Support > Client Help
Mado
Ok so what I'm trying to do is colour certain lines of text so that I can see when my Targeted person eats something.

At the minute I use %1 eats a %1 and this is kind of sucky because iot shows when anyone eats a herb and not just my spicific target.
I had thought of putting in @target eats a %1 but doesnt work either.
Anyone can help?
Jonathin
QUOTE (Mado @ Mar 19 2009, 11:56 AM) *
Ok so what I'm trying to do is colour certain lines of text so that I can see when my Targeted person eats something.

At the minute I use %1 eats a %1 and this is kind of sucky because iot shows when anyone eats a herb and not just my spicific target.
I had thought of putting in @target eats a %1 but doesnt work either.
Anyone can help?


First, that pattern that you have will match to "Jonathin eats a Jonathin".
Second, you should never use a variable in a trigger pattern. You also shouldn't use %1-%99 in the pattern either.

Do this:

#regex {(\w+) eats a (.*)\.$) {#cw (high,purple)}}

you'll still see everyone eating, but it'll actually work. <--learn RegEx, it's so much better than zScript anyway.
Dramata
QUOTE (Mado @ Mar 19 2009, 05:59 PM) *
I had thought of putting in @target eats a %1 but doesnt work either.
Anyone can help?


Try using: ^{@target} eats a (%w)
if you want to use whatever is eaten in your script

If not... use ^{@target} eats a %w

P.S. this is no regex but zScript. I'm not good enough to tell you what it would be in regex.

QUOTE (Jonathin @ Mar 19 2009, 05:59 PM) *
Second, you should never use a variable in a trigger pattern. You also shouldn't use %1-%99 in the pattern either.


Why not!?!?! I use it everywhere!
Jonathin
Because, (\w+)(\d+)(\w+) the
first wildcard = %1
second wildcard = %2
third wildcard = %3
Sena
I can't think of any reason not to use variables in the trigger pattern.

#REGEX {^@target eats a [\w ]+\.$} {#CW red}

#REGEX {^(\w+) eats a [\w ]+\.$} {#IF (%1=@target) {#CW red}}

Both of those should do what you want.
Jonathin
It works, but it's buggy. In zMUD at least.
Sena
I've been using variables in trigger patterns since 2006, and I've never once had a problem with it. From what I've heard, if the trigger does stop working, deleting and recreating the trigger will fix it, or even just changing it for a second then changing it back.
Trevize
QUOTE (Sena @ Mar 20 2009, 02:20 PM) *
I've been using variables in trigger patterns since 2006, and I've never once had a problem with it. From what I've heard, if the trigger does stop working, deleting and recreating the trigger will fix it, or even just changing it for a second then changing it back.

That is correct. I've had it happen a lot and just change it, save it, and change it back to get it to work. I never did figure out why, and some people seem to have it happen more often than not, some never it all.
Jonathin
It's because zMud is buggy itself. smile.gif
Anywho, there's something I've been wondering since this post.

Is there a way to make @target = Jonathin, or jonathin?

Like, not case-sensitive?
Sena
QUOTE (Jonathin @ Apr 12 2009, 10:26 AM) *
It's because zMud is buggy itself. smile.gif
Anywho, there's something I've been wondering since this post.

Is there a way to make @target = Jonathin, or jonathin?

Like, not case-sensitive?

If you mean in the trigger pattern, triggers aren't case sensitive by default. In scripts, you can use %lower to remove all capitalisation. For example, #IF (%lower(@target)=jonathin)

Or you can use %lower when setting the variable, and not have to worry about adding it to a dozen triggers.
Jonathin
Thanks. When I use @target in the pattern, it's always case sensitive.
Sena
Strange, none of my triggers are case sensitive, variables or not, unless I check the case sensitive box or use the case option.

#TRIGGER {^You mAy drINK another HEALTH or Mana ELIXir.$} {#SAY test} works for me, for example. Replacing "or Mana" in the trigger line for that with a variable @test, with a value of "or Mana" still works as well.
Jonathin
Hmm, I'll try again. Thanks.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.