Triggers matching on color not working

Posted by Norry on Wed 20 Dec 2006 03:38 AM — 6 posts, 20,428 views.

#0
I have a bunch of triggers that color various channels and they are no longer working on 3.84. I think I've narrowed it down to the color matching. If I try to match on a foreground color, the trigger will not go off. Matching on the background color works fine, however (with foreground set to "any").

Example trigger that doesn't work:

<triggers>
  <trigger
   back_colour="8"
   bold="y"
   custom_colour="15"
   enabled="y"
   group="color"
   match="^\w+ (chat|chats) \'.*$"
   match_back_colour="y"
   match_bold="y"
   match_inverse="y"
   match_italic="y"
   match_text_colour="y"
   regexp="y"
   sequence="100"
   text_colour="14"
  >
  </trigger>
</triggers>
Australia Forum Administrator #1
That seemed to work for me. Remember that the colour testing applies to the first matching character, so that the cyan-on-black would have to be the very first character on the line.

Also, you are testing for a match on bold. There was a bug in version 3.83 where it turned boolean attributes on when loading world files, so maybe you are not testing for what you think you are.
#2
I did upgrade to 3.83 and things worked ok, but the upgrade to 3.84 broke the triggers. I changed the color matching, trying various combinations, including any-on-black, and playing with the checkboxes. The only way I got the trigger to match at all was either not checking for color, or using the any-on-black match.

It's supposed to be bold cyan on black so I should be matching on the right thing. Even using the greyed out check on the bold choice (bold/not bold) wouldn't work.

I even tried making a few new triggers and the same thing happened. I didn't try on a new, empty world, however.
Australia Forum Administrator #3
I tested it by going into Game -> Test Trigger, and entering this:


(blank line)
\1B[36m\1B[40m\1B[1mNick chats 'hi there


Now they are the code for cyan text, black background, and bold.

If I go into Display -> Text Attributes -> Line Info, I get this (with the trigger disabled):


Line 872 (872), Friday, December 22, 4:55:37 PM
 Flags = End para: YES, Note: no, User input: no, Log: YES, Bookmark: no
 Length = 20, last space = 14
 Text = "Nick chats 'hi there"

1 style run

1: Offset = 0, Length = 20, Text = "Nick chats 'hi there"
 No action.
 Flags = Hilite: YES, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour ANSI  : 6 (Cyan)
 Background colour ANSI  : 0 (Black)

20 columns in 1 style run

------ (end line information) ------


You can see from that that the text is indeed Cyan on Black, with bold (Hilite) set.

You may want to investigate if the line shows up like that in Text Attributes.
Australia Forum Administrator #4
Quote:

I didn't try on a new, empty world, however.


That shouldn't make any difference, unless you have another trigger that fires first.
#5
Heh, I tried testing the triggers a bunch of times. Any triggers that matched on color (to prevent spoofing) were not going off at all. So something, somewhere, got corrupted I guess. Here's the result I got from pasting in your example:

Line 2 (2), Friday, December 22, 5:48:25 PM
 Flags = End para: YES, Note: no, User input: no, Log: YES, Bookmark: no
 Length = 20, last space = 14
 Text = "Nick chats 'hi there"

1 style run

1: Offset = 0, Length = 20, Text = "Nick chats 'hi there"
 No action.
 Flags = Hilite: YES, Underline: no, Blink: no, Inverse: no, Changed: no
 Foreground colour RGB   : R=0, G=254, B=254
 Background colour RGB   : R=0, G=0, B=0

20 columns in 1 style run

------ (end line information) ------


However, on another world (that I didn't open with 3.83) where the color triggers still work, the same text got me this:

Line 20 (20), Friday, December 22, 5:49:56 PM
 Flags = End para: YES, Note: no, User input: no, Log: YES, Bookmark: no
 Length = 20, last space = 14
 Text = "Nick chats 'hi there"

1 style run

1: Offset = 0, Length = 20, Text = "Nick chats 'hi there"
 No action.
 Flags = Hilite: no, Underline: no, Blink: no, Inverse: no, Changed: YES
 Custom colour: 14 (Chat)

20 columns in 1 style run

------ (end line information) ------


So the second one set the trigger off, but the first one didn't. Funny thing was, even newly made triggers wouldn't work either. I guess it was fallout from the bug in 3.83. Anyway, making a new world and copying everything back in fixed the problem.

EDIT: Ok, things were working until I logged on my mud. The color triggers were broken again. *sigh* But only on this world. So I played with settings then realized the non-broken worlds did not have "Use custom color 16 as default" checked. I unchecked it on the broken world, and voila, matching on color works again.