Page 1 of 1

Bug with Color Triggers

Posted: Sat Sep 21, 2013 2:53 am
by Jor'Mox
If you set a color trigger, then change the type to something else, and back to a color trigger, it leaves the color looking like what you had set, but it is ignored. Also, if you have text in the pattern line before you change the type to a color trigger, it breaks the trigger (has a bug and can't be activated).

Re: Bug with Color Triggers

Posted: Sat Sep 21, 2013 3:05 am
by Jor'Mox
Also, color triggers don't respect order in AND triggers, so having a substring for the first pattern, and a color for the second matches exactly the same as if you reversed them.

Re: Bug with Color Triggers

Posted: Sat Sep 21, 2013 7:17 am
by Vadi
I'm not sure about the order. Why shouldn't the reverse work? Technically, text and colour appear at once on a letter. Do you mean the colour is far later after the text?

Re: Bug with Color Triggers

Posted: Sat Sep 21, 2013 1:33 pm
by Jor'Mox
As far as I can tell, it will match any line containing both the color and the substring in it at any point. So if I wanted to look for a <red>apple, it would match that, but it would also match a <green>apple and a <red>pepper.
If I put the substring first, I would expect that, since it would match to the end of the substring and then look for the color I wanted. But it still does that if I put color first, which I wouldn't expect, since the first instance of the color I'm looking for is after the text I want it to match with.

Re: Bug with Color Triggers

Posted: Sat Sep 21, 2013 6:50 pm
by Tagon
I think the problem is that the solution requires both AND and OR to completely work.

(Apple AND Red) OR (Pepper AND Green)

Re: Bug with Color Triggers

Posted: Sat Sep 21, 2013 6:54 pm
by Jor'Mox
No, for what I'm talking about, I'm only trying to match one substring and one color, not multiple different strings and colors in combination.

Re: Bug with Color Triggers

Posted: Wed Sep 25, 2013 7:58 am
by Heiko
Jor'Mox wrote:Also, color triggers don't respect order in AND triggers, so having a substring for the first pattern, and a color for the second matches exactly the same as if you reversed them.
No, that's not correct. For a detailed explanation of the MSM have a look here: http://mudlet.sourceforge.net/wordpress ... 1576046486

Re: Bug with Color Triggers

Posted: Wed Sep 25, 2013 8:06 am
by Heiko
Jor'Mox wrote:As far as I can tell, it will match any line containing both the color and the substring in it at any point. So if I wanted to look for a <red>apple, it would match that, but it would also match a <green>apple and a <red>pepper.
If I put the substring first, I would expect that, since it would match to the end of the substring and then look for the color I wanted. But it still does that if I put color first, which I wouldn't expect, since the first instance of the color I'm looking for is after the text I want it to match with.
The MSM matches all conditions both subsequently and greedily against the current line. Consequently, the order in your particular setup is irrelevant, but this doesn't mean that the order is irrelevant in general :) The MSM is not the best tool for your particular problem, but if you need to formulate such a condition in the context of a more complex AND trigger you'll need more complex Lua conditions (-> isAnsiFgColor()) to formulate your problem adequately.

The simplest way to only match "apple" written in red color you'll want to use an "apple" filter trigger with a child trigger testing for color red. See this example: http://mudlet.sourceforge.net/wordpress ... 1333981091

Re: Bug with Color Triggers

Posted: Wed Sep 25, 2013 1:19 pm
by Jor'Mox
I see what you mean about the order issue. Irritating that it doesn't work the way I would expect, but it is at least working as designed. The other issues are, on the other hand, definitely bugs.