Bug with Color Triggers

Post Reply
Jor'Mox
Posts: 1142
Joined: Wed Apr 03, 2013 2:19 am

Bug with Color Triggers

Post 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).

Jor'Mox
Posts: 1142
Joined: Wed Apr 03, 2013 2:19 am

Re: Bug with Color Triggers

Post 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.

User avatar
Vadi
Posts: 5035
Joined: Sat Mar 14, 2009 3:13 pm

Re: Bug with Color Triggers

Post 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?

Jor'Mox
Posts: 1142
Joined: Wed Apr 03, 2013 2:19 am

Re: Bug with Color Triggers

Post 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.

Tagon
Posts: 24
Joined: Thu Sep 19, 2013 8:38 pm

Re: Bug with Color Triggers

Post 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)

Jor'Mox
Posts: 1142
Joined: Wed Apr 03, 2013 2:19 am

Re: Bug with Color Triggers

Post 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.

User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

Re: Bug with Color Triggers

Post 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

User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

Re: Bug with Color Triggers

Post 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

Jor'Mox
Posts: 1142
Joined: Wed Apr 03, 2013 2:19 am

Re: Bug with Color Triggers

Post 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.

Post Reply