Project

General

Profile

[Deprecated] [Script] Simple script to locally color channel nicks on outgoing messages

Added by Per Amundsen almost 7 years ago

See Options -> Nick Colors -> Color nicks in messages.

Uses color "4", change it to 0-99 as needed.

on *:INPUT:#:{
  if (/* iswm $1) {
    return
  }

  var %text $1-, %s 0
  while (%s < $numtok(%text, 32)) {
    inc %s
    var %nick $gettok(%text, %s, 32)
    if ($nick(#, %nick)) {
      %text = $reptok(%text, %nick, $+($chr(3),4,%nick,$chr(3)), 32)
    }
  }

  echo -t $active $replace($prefixuser, $ $+ pnick, $me) %text
  .msg $active $1-
  halt
}

Replies (1)

RE: [Script] Simple script to locally color channel nicks on outgoing messages - Added by Per Amundsen over 6 years ago

To use the nick color instead:

on *:INPUT:#:{
  if (/* iswm $1) {
    return
  }

  var %text $1-, %s 0
  while (%s < $numtok(%text, 32)) {
    inc %s
    var %nick $gettok(%text, %s, 32)
    if ($nick(#, %nick).rgbcolor) {
      %text = $reptok(%text, %nick, $+($chr(4),$nick(#, %nick).rgbcolor,%nick,$chr(3)), 32)
    }
    else if ($nick(#, %nick).color) {
      %text = $reptok(%text, %nick, $+($chr(3),$nick(#, %nick).color,%nick,$chr(3)), 32)
    }    
  }

  echo -t $active $replace($prefixuser, $ $+ pnick, $me) %text
  .msg $active $1-
  halt
}
    (1-1/1)