I am trying to make a tell trigger and I don't want it to match on grey, but if i turn bold on it matches neither on white nor gray, while if I turn it off it matches on both. Bug?
Bold and non-bold white match on the same colour?
Posted by Poromenos on Tue 05 Oct 2004 05:49 PM — 8 posts, 26,514 views.
Poromenos, you sure you have it "on" and not greyed?
And, are you sure youre using the right grey? (whether thats bold black, or normal white)
While we're on this subject, can we get a "Default" option for both?
And, are you sure youre using the right grey? (whether thats bold black, or normal white)
While we're on this subject, can we get a "Default" option for both?
Yes, it's on (match_bold="y") and I want to match on bold white, but it matches on gray, so it's quite wrong... Looks like a bug.
I can't reproduce that.
If I set it to match on bold white, and send this with Shift+Ctrl+F12:
blah \1B[1m\1B[37m room \1B[0m blah
(matching the word "room")
This matches - bold white. It also doesn't match "room" in non-bold white (ie. gray).
If I set it to match on bold white, and send this with Shift+Ctrl+F12:
blah \1B[1m\1B[37m room \1B[0m blah
(matching the word "room")
This matches - bold white. It also doesn't match "room" in non-bold white (ie. gray).
OK, this is in a plugin, I used this to test:
The trigger is:
With match_bold="n":
The first tell is bold white, yet it matches on both.
With match_bold="y":
The first one is the bold one, yet it only matches the second one. I can't explain this erratic behaviour...
\1B[1m\1B[37mSomeone tells you 'list'
\1B[0m\1B[37mSomeone tells you 'list'
The trigger is:
<trigger
enabled="y"
ignore_case="y"
keep_evaluating="n"
match="([A-Za-z]+) tells you \'list\'$"
match_bold="n"
match_text_colour="y"
regexp="y"
script="sbTellList"
sequence="100"
text_colour="15"
other_text_colour="black"
other_back_colour="black"
>
</trigger>
With match_bold="n":
Someone tells you 'list'
TRACE: Matched trigger "([A-Za-z]+) tells you \'list\'$"
TRACE: Executing trigger script "sbTellList"
Someone tells you 'list'
TRACE: Matched trigger "([A-Za-z]+) tells you \'list\'$"
TRACE: Executing trigger script "sbTellList"
The first tell is bold white, yet it matches on both.
With match_bold="y":
Someone tells you 'list'
Someone tells you 'list'
TRACE: Matched trigger "([A-Za-z]+) tells you \'list\'$"
TRACE: Executing trigger script "sbTellList"
The first one is the bold one, yet it only matches the second one. I can't explain this erratic behaviour...
It works for me, it isn't a bug nor is it erratic. :)
Here is my output (I removed the script call and changed it to colour the line, to better see what it was doing).
Note how it correctly matches the bold line. However the trigger is this:
Not only do you need:
match_bold="y"
but also:
bold="y"
Taken together they mean this:
This is how we get the tri-state checkbox. You clearly can't have three values (checked, unchecked and gray) in a simple yes/no value.
If match_bold = "y" then it tests the bold attribute. If it is testing the bold attribute it compares it to the value in the "bold" = "x" line, where "x" is Y or N.
Here is my output (I removed the script call and changed it to colour the line, to better see what it was doing).
Someone tells you 'list'
TRACE: Matched trigger "([A-Za-z]+) tells you \'list\'$"
Someone tells you 'list'
Note how it correctly matches the bold line. However the trigger is this:
<triggers>
<trigger
bold="y"
custom_colour="2"
enabled="y"
ignore_case="y"
match="([A-Za-z]+) tells you \'list\'$"
match_bold="y"
match_text_colour="y"
regexp="y"
sequence="100"
text_colour="15"
>
</trigger>
</triggers>
Not only do you need:
match_bold="y"
but also:
bold="y"
Taken together they mean this:
- match_bold - is the bold attribute to be tested?
- bold - what value are we testing for?
This is how we get the tri-state checkbox. You clearly can't have three values (checked, unchecked and gray) in a simple yes/no value.
If match_bold = "y" then it tests the bold attribute. If it is testing the bold attribute it compares it to the value in the "bold" = "x" line, where "x" is Y or N.
Oh, great! It works, thank god. I got a lot of abuses of this one, I thought that it was "y" for checked, "n" for unchecked and if the entire line didn't exist it was grayed. Thanks Nick :)
If the line does not exist it takes a default value - that is, "n" for flags, "" for strings, and 0 for numbers. Although in some cases it has other defaults (eg. the number of lines in your output buffer does not default to zero if you omit that line).
In fact, the script function GetDefaultValue tells you what the defaults are for various options.
In fact, the script function GetDefaultValue tells you what the defaults are for various options.