mIRC Nickname Colour Codes

By Henco on May 28, 2011

Screenshots

This is a fairly quick script I made, which assigns each person in the channel a random colour for their nick.
Obviously due to mIRC's limited colour range, there will always be conflicts.. but at least it gives you some indication, and it is easier to find nicks if you're scrolling up.

Just to explain a couple of things.. firstly, I've made it exclude colours 1 and 2, as these are particularly dark, so would not work on my black mIRC background. You should change this as appropriate for whatever colour background you have.
Secondly, I have made it so it does not activate the script when you are highlighted, because mIRC highlights WILL NOT WORK simultaneously with the script.

Finally, remember that this script uses variables, so if you like to keep a clean variable list then this isn't for you. I'm sure there's a better way to do it, but I did this more for personal use. If anyone wishes to have some input in making this better, feel free to do so in the comments.

Hope it works well for you..

EDIT 26/10/2011: Updated so the channel name still lights up on new messages in the tree etc. (Thanks to GrimReaper for the fix!)

on ^*:TEXT:*:#: {
  if (!%nickcolour. [ $+ [ $nick ] ]) {
    while ( !%nickcolour. [ $+ [ $nick ] ] || %nickcolour. [ $+ [ $nick ] ] == 1 || %nickcolour. [ $+ [ $nick ] ] == 2 ) {
      set %nickcolour. [ $+ [ $nick ] ] $rand(0,15)
    }
  } 
  if ($me !isin $1-) {
    haltdef
    echo -t $chan $+(<, $+ %nickcolour. [ $+ [ $nick ] ] $+ ,$iif($regex($nick(#,$nick).pnick,/([~&@%\+])/),$regml(1)),$nick,,>) $1-
    window -g1 $chan
    halt
  }
}
on ^*:ACTION:*:#: {
  if (!%nickcolour. [ $+ [ $nick ] ]) {
    while ( !%nickcolour. [ $+ [ $nick ] ] || %nickcolour. [ $+ [ $nick ] ] == 1 || %nickcolour. [ $+ [ $nick ] ] == 2 ) {
      set %nickcolour. [ $+ [ $nick ] ] $rand(0,15)
    }
  } 
  if ($me !isin $1-) {
    haltdef
    echo -t $chan $+($chr(42),$chr(0160), $+ %nickcolour. [ $+ [ $nick ] ] $+ ,$iif($regex($nick(#,$nick).pnick,/([~&@%\+])/),$regml(1)),$nick,, ) $1-
    window -g1 $chan
    halt
  }
}

Comments

Sign in to comment.
jm9k   -  Apr 11, 2013

This works well. Thanks.

 Respond  
Jethro   -  May 28, 2011

This is a tad boring to assign a nickname with a random colour. It'd be interesting to have different colours at random every time someone sends a message. This is just my two bits worth. Last but not least, though, this only works for $chan.

Incidentally, you can use an alias for the routine and have the text and action call from it. This saves you a repeated routine.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.