[Home] [Downloads] [Search] [Help/forum]

Gammon Forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Bug reports
. . -> [Subject]  Bold and non-bold white match on the same colour?
Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?

Bold and non-bold white match on the same colour?

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page


Posted by Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Tue 05 Oct 2004 05:49 PM (UTC)
Message
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?

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
[Go to top] top

Posted by Flannel   USA  (1,230 posts)  [Biography] bio
Date Reply #1 on Tue 05 Oct 2004 11:56 PM (UTC)
Message
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?

~Flannel

Messiah of Rose
Eternity's Trials.

Clones are people two.
[Go to top] top

Posted by Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Reply #2 on Wed 06 Oct 2004 12:25 AM (UTC)
Message
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.

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
[Go to top] top

Posted by Nick Gammon   Australia  (21,675 posts)  [Biography] bio   Forum Administrator
Date Reply #3 on Wed 06 Oct 2004 07:03 AM (UTC)
Message
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).


- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Reply #4 on Wed 06 Oct 2004 01:07 PM (UTC)
Message
OK, this is in a plugin, I used this to test:

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

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
[Go to top] top

Posted by Nick Gammon   Australia  (21,675 posts)  [Biography] bio   Forum Administrator
Date Reply #5 on Thu 07 Oct 2004 07:17 AM (UTC)

Amended on Thu 07 Oct 2004 07:19 AM (UTC) by Nick Gammon

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


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.




- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Poromenos   Greece  (1,037 posts)  [Biography] bio
Date Reply #6 on Thu 07 Oct 2004 10:48 AM (UTC)
Message
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 :)

Vidi, Vici, Veni.
http://porocrom.poromenos.org/ Read it!
[Go to top] top

Posted by Nick Gammon   Australia  (21,675 posts)  [Biography] bio   Forum Administrator
Date Reply #7 on Thu 07 Oct 2004 10:00 PM (UTC)
Message
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.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


4,464 views.

It is now over 60 days since the last post. This thread is closed.     [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

Quick links: MUSHclient. MUSHclient help. Forum shortcuts. Posting templates. Lua modules. Lua documentation.

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.

[Home]


Written by Nick Gammon - 5K   profile for Nick Gammon on Stack Exchange, a network of free, community-driven Q&A sites   Marriage equality

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( https://gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Hosted at FutureQuest]