mIRC Home    About    Download    Register    News    Help

Print Thread
Control Highlights feedback from scripts #255277 04/10/15 11:52 AM
Joined: Mar 2008
Posts: 87
B
BhaaL Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Mar 2008
Posts: 87
As of mIRC 7.43, the only highlight-related script identifiers are related to whether highlighting is enabled or not, and which words are added to the highlight list.

There is no way of finding out if a channel is in a highlight state (or particularly, which one; such as Message or Highlight), and there is also no way of re/setting that state.

My current use case looks like this:
I'm on a channel with certain chatty bots that should not trigger a highlight, regardless of whats going on. But as soon as someone else talks, I want the switchbar light up as usual. Note this assumes "Always highlight on message" is on.
Ignoring the bots is not an option, since they still tend to convey information at times (which is handled by other scripts etc.); but the channel constantly being highlighted in red makes it a bit cumbersome to filter out actual activity from the bot-related ones.

Suggestion 1: on HIGHLIGHT
Code:
on ^*:HIGHLIGHT:#: {
  ; don't highlight on channel messages from OperServ
  if ($nick == OperServ) { haltdef }
}

haltdef acts similar to the other events and allows the highlighting to be skipped. This does not clear the highlight state, but simply prevents it from changing as result of the current highlight.
This event might benefit from a message filter too (like on TEXT), but technically I don't need that for my specific use case.

Suggestion 2: extend /ignore
Code:
/ignore -h OperServ!services@my.personal.network

-h specifies that highlights from the given nick/address should be ignored.

Suggestion 3: $chan(N/channel).highlight or $chan(N/channel).hlstatus; along with /highlight channel new-status (or something similar)
Code:
on *:TEXT:*:#: {
  ; .highlight might return "none", "message" or "highlight", depending on highlight type
  if ($chan($chan).highlight == none) {
    ; /highlight changes the current highlight type
    /highlight $chan none
  }
}

This one is a bit more cumbersome to use, although it was my original suggestion. Adding an identifier to retrieve the current highlight status probably makes sense, but using it like without knowing which happens first (the text event being triggered, or the highlight state being set) might lead to odd behavior. Also, using $chan for retrieval but /highlight for changing it feels a bit off, since both are related to the highlight state of a channel.

Your thoughts?

Re: Control Highlights feedback from scripts [Re: BhaaL] #255278 04/10/15 01:11 PM
Joined: Jan 2004
Posts: 1,277
L
Loki12583 Online
Hoopy frood
Online
Hoopy frood
L
Joined: Jan 2004
Posts: 1,277
$window(#).sbcolor and /window -gN # can be used to get and set highlight state

Re: Control Highlights feedback from scripts [Re: Loki12583] #255290 05/10/15 04:12 PM
Joined: Mar 2008
Posts: 87
B
BhaaL Offline OP
Babel fish
OP Offline
Babel fish
B
Joined: Mar 2008
Posts: 87
Wow, looks like I missed the obvious. Only looked at channel related commands, but not window related ones. Thanks! smile

Edit: Hm, that leaves me with the problem of keeping track of channel state, since on TEXT is too late (sbcolor has already changed to message by then) - but at least something I can work with

Last edited by BhaaL; 05/10/15 04:27 PM. Reason: follow-up note