Project

General

Profile

[Script] Grey out messages from offline nicks

Added by Per Amundsen 22 days ago

When a nick quit irc or parts/gets kicked from a channel, all matched messages are colored grey using color 15.

If they rejoin, the color is reset to the "normal" color.

Lines with rgbcolors is currently not taken into account, if the original line color was a "color entire line" highlight color/nick color, the color is lost.

on *:KICK:*:{
  colornickchannel $nick # 15
}

on *:JOIN:*:{
  colornickchannel $nick # $color(normal)
}

on *:PART:*:{
  colornickchannel $nick # 15
}

on *:QUIT:{
  colornick $nick 15
}

alias -l colornick {
  ; $1 = nick
  ; $2 = color

  var %s = 0
  while (%s < $window(*, 0)) {
    inc %s
    if ($window(*, %s).type == channel) {
      colornickchannel $1 $window(*, %s) $2
    }
  }
}

alias -l colornickchannel {
  ; $1 = nick
  ; $2 = channel
  ; $3 = color

  var %l = 0, %c = $line($2, 0), %p = $strip($replace($prefixuser, $ $+ pnick, $1))
  while (%l < %c) {
    inc %l

    if (%p isin $strip($line($2, %l)) {
      cline -t $3 $2 %l
    }
  }
}