Jump to content
coders-irc_Bot

Color Nick Message v1.0

Recommended Posts

  • Administrators

Helps to color all nicknames found in messages in the colors from the address book that are present on the same channels where you are. Can detect nicknames even if they are followed by characters like " .,:=?!() ".

Requirements: The script will only display all colors correctly in the latest versions of the mIRC client, which has a choice of 99 colors and shades.

Setting: You can change the settings of the script parameters through the " color_nick_message_set " alias to the values you need.

 

################################################### ####################
# Name: Color Nick Message v1.0
# Author: Epic (epicnet@mail.ru, http://epicnet.ru)
# Description: Colorizes all nicknames found in messages in colors from the address book that are present on the same channels where you are.
################################################### ####################

alias -l color_nick_message_set {
  %cnm_ignore_color = 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 36 37 48 60 88 89 90 92 93 94 95 96 97
  %cnm_ignore_chan = #Services #MyChan
  %cnm_auto_color = true
  %cnm_method_color = 0
  %cnm_sort_list = 1
}
-------------------------------------------------
on *:NICK: color_nick_message_auto $newnick
on *:JOIN:#: color_nick_message_auto $nick
on ^*:TEXT:*:#: color_nick_message $nick $chan $1-
on *:INPUT:#: if ($left($strip($1-),1) != /) { .msg $chan $1- | color_nick_message $me $chan $1- }
alias -l color_nick_message_auto {
  if (%cnm_auto_color == true && $cnick($1) == 0) {
    var %cnm_key $+(-m,%cnm_method_color,s,%cnm_sort_list)
    :next1 | var %cnm_rcol $rand(1.98) | if ($istok(%cnm_ignore_color,%cnm_rcol,32)) goto next1
    .cnick %cnm_key $1 %cnm_rcol
  }
}
alias -l color_nick_message {
  color_nick_message_set | if ($istok(%cnm_ignore_chan,$2.32)) { halt } | color_nick_message_auto $1
  var %cnm_text $3- | var %cnm_stext $strip(%cnm_text) | var %cnm_inc 1 | while (%cnm_inc <= $numtok(%cnm_stext,32)) {
    var %cnm_tok $gettok(%cnm_stext,%cnm_inc,32) | var %cnm_rtok $remove(%cnm_tok,$chr(40),$chr(41),$chr(44),.,=,:,?,!)
    if ($comchan(%cnm_rtok,0) > 0) {
      var %cnm_col $cnick(%cnm_rtok).color | var %cnm_ncol $+($chr(3),%cnm_col,%cnm_rtok,$chr(3))
      var %cnm_rncol $replace(%cnm_tok,%cnm_rtok,%cnm_ncol) | var %cnm_text $puttok(%cnm_text,%cnm_rncol,%cnm_inc,32)
    } | inc %cnm_inc
  }
  if (%cnm_text) { var %cnm_nick $+(<,$chr(3),$cnick($1,1).color,$1,$chr(3),>) | .echo -t $2 %cnm_nick %cnm_text | halt}
}

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...


×
×
  • Create New...