Project

General

Profile

[script] AdiIRC Random Nick Colors port to mIRC

Added by Mr. BS over 5 years ago

A simple snippet demonstrating how random nick colors feature are determined on AdiIRC and Hexchat. The idea is basically to turn each nick char into ASCII value, they are summed, then divided (using modulo operator) by total mIRC colors palette (16).

Here is a good article with more details.

Example: pereba = 112 + 101 + 114 + 101 + 98 + 97 = 623 % 16 = 15.

Screenshot:

Script:

on ^*:TEXT:*:#: {
  echo -trlmbf # $+(<, $chr(3), $calc(($left($regsubex($nick,/(.)/g,$asc(\1) $chr(32) $chr(43)),-3)) % 16), $nick($chan, $nick).pnick, $chr(3), >) $1-
  halt
}

Thanks kr0n for explaining how it works.

Sharing is caring.