Project

General

Profile

[Script] Full-Pallette Random Nick Color Script 1.2

Added by c0n flux over 8 years ago

Hackjob Full-Pallette Random Nick Color Script

Script http://pastebin.com/raw.php?i=jywnKQ7J
Screenshots http://i.imgur.com/oEVyKXW.png http://i.imgur.com/LlnomOY.png


Features:
  • Generates random nick colors for any nick not assigned a custom color
  • Uses random full-palette colors for nicks in both MSG and ACTION
  • Uses assigned colors for nicks that have them
  • Adjusts colors based on light or dark backgrounds
  • NEW: Set your own custom colors to be used for nicks
  • NEW: Color generation efficiency improvements
  • NEW: Properly handles buffer playback from bouncers like ZNC
Wants:
  • A good way to avoid lookalike colors for different nicks

Replies (24)

RE: [Script] Full-Pallette Random Nick Color Script 1.2 - Added by Mr. BS over 8 years ago

Here are some observations after some time using it.

  1. Add -w2 flag to /echo, in case user is using emoticons/image tags.
  2. Support custom colors for own user nickname using On Input event and a little modification when checking if internal nick colors in enabled.
  3. In some network nicks can have multiple prefix (for instance Rizon), resulting in &@nick. To fix it you should get first prefix and append to nick, example: $left($nick(#,$nick,a,r).pnick,1) $+ $nick.
  4. Support for consecutive                    spaces could be implemented without much effort using $msgx, /var, /echox and /rawx in case of On Input.
  5. A new option to user select if hsl/rgb colors will surround only nick/pnick or whole $prefixuser. Example: <nick> VS <nick>.
  6. Now that /cline also has support for rgb colors, this could be implemented as optional.
  7. Add support to timestamp with space, important if nickcolumn is enabled. Maybe only way is replacing space by $chr(160)?
  8. Option to disable script in specific channels, useful for VERY high traffic channels (read XDCC), it can slowdown a bit the client.
  9. Support for "Color entire line" new AdiIRC feature introduced in version 2.3, example provided by kr0n:
    $regsubex($chr(3) $+ asd $+ $chr(3) $+ 6asd $+ $chr(15) $+ asd, /(\cc[^0-9]|\co)/g, $chr(3) $+ $chr(61442) $+ FF0000 $+ $strip(\1))
  10. Support for "ignore timestamp for consecutive messages from the same nick", also a new AdiIRC feature in version 2.3.

None of suggestions above are crucial, the script is almost perfect in current code. I implemented some of that changes for my own amusement. Just passed here to say thank you for this awesome color algorithm. Can't live without this feature anymore!

RE: [Script] Full-Pallette Random Nick Color Script 1.2 - Added by Per Amundsen over 8 years ago

Mr. Pereba wrote:

  1. In some network nicks can have multiple prefix (for instance Rizon), resulting in &@nick. To fix it you should get first prefix and append to nick, example: $left($nick(#,$nick,a,r).pnick,1) $+ $nick.

I added $nick().cnick for this

RE: [Script] Full-Pallette Random Nick Color Script 1.2 - Added by Mr. BS over 8 years ago

Oh missed that, good to know ;)

RE: [Script] Full-Pallette Random Nick Color Script 1.2 - Added by Mr. BS almost 8 years ago

Fork

Since author has not updated this script for a long time, I made a little fork to implemented all the nine suggestions from my previous post above and plus more changes listed bellow.

  1. Fixed on load error when creating the hastable (doesn't need to load after to make it).
  2. Implemented support for spaced timestamp and prefix user.
  3. Full support for consecutive spaces in message/action to send and receive.
  4. New Menu to disable script completely without unloading it.
  5. New Menu to disable script in specific channels.
  6. New menu to force Dark/Bright color or set to Auto (default as original script).
  7. Removed savereload command from On Options event because reset command already is calling it.
  8. Increase hashtable purge limit from 500 to 1000, no special reason.
  9. Reset hashtable rcolors on saving options only if bg color changed, this fixes saves hash table on exit.
  10. Tiny bonus, replace tab char by space char, making them "visible" in messages. (Example, when copy/paste a line from dcc transfers panel).

Script is almost the same, not edited the most important that is the random color algorithm, I just improved it in overall a bit.

Report bugs, I'm sure there is few one. Only feature I decided to not implement for now is the "Ignore timestamp for consecutive messages", in case someone request it I'll think about.

Again, thank you to the original author for this awesome script.

RE: [Script] Full-Pallette Random Nick Color Script 1.2 - Added by Christopher Milner almost 8 years ago

Found a bug:

If you have "Color entire line" option in Nick Colors options category, or via the Command -> RGB Random Nick Colors -> Color Entire Message submenu, then the first word will not display as an emote image (if it is valid as being one).

Image showing what happens: http://i.imgur.com/1kwl6EX.jpg

grtNOOT should show as the image that appears after it (the pingu image)

RE: [Script] Full-Pallette Random Nick Color Script 1.2 - Added by Mr. BS almost 8 years ago

Thanks for the report, fixed in version 0.1.1 attached to previous post.

  • v0.1.1 - Fixed emote as first word in messages.

Small change.

  • v0.1.2 - Make local /action to use standard emote color for timestamp and message.

RE: [Script] Full-Pallette Random Nick Color Script 1.2 - Added by Mr. BS almost 8 years ago

More small changes, my apologies.

  • v0.1.3 - Removed unneeded echo flags for your own message.
    -r - Apply strip colors/bold/italic/underline options. << AdiIRC by default only apply this option for incoming messages.
    -l - Apply highlight options. << very annoying triggering a highlight in case you send your own nick.
    -m - This echo should be treated as a normal message. << The color in tree/switchbar to indicate of a new message, in this case will do nothing since target window already is the active one.
    -f - Apply flash options. << Also doesn't makes sense to flash for your own message.
    -b - Apply beep options. << Same case.
  • v0.1.4 - On toggle On|Off script, make it update nicklist colors only if this option is enabled, since it may hang slightly if user is connected to a lot networks/channels.
  • v0.1.5 - Changed "Color entire line" priority to follow user custom highlights color.

RE: [Script] Full-Pallette Random Nick Color Script 1.2 - Added by Christopher Milner almost 8 years ago

I actually liked the actions (of myself and other users) being coloured all the same (as in your 0.1.1 version) instead of just the username being the unique colour. Is there anyway that you can make this an option?

RE: [Script] Full-Pallette Random Nick Color Script 1.2 - Added by Mr. BS almost 8 years ago

Alright, added action color as an option.

  • v0.1.6 - New option to color entire emote messages (disabled by default).

RE: [Script] Full-Pallette Random Nick Color Script 1.2 - Added by Christopher Milner almost 8 years ago

one bug i have noticed is that the color entire emote message setting is not being saved, so each time I load up Adiirc I have to keep on resetting it

RE: [Script] Full-Pallette Random Nick Color Script 1.2 - Added by Mr. BS almost 8 years ago

Check if new version fixes this issue, found another problem.

  • v0.1.7 - Fix action message sending as regular message remotelly.

RE: [Script] Full-Pallette Random Nick Color Script 1.2 - Added by Mr. BS almost 8 years ago

  • v0.1.8 - Fix ctrl+enter (send commands as normal message).

RE: [Script] Full-Pallette Random Nick Color Script 1.2 - Added by Mr. BS almost 8 years ago

  • v0.1.9
    - Added support for PM messages;
    - Added support for tips messages if enabled in Options ➜ Tips ➜ Channel/Private tips ➜ Message;
    - Added support for $status and $nick variables in message prefix;
    - Minor fixes.

RE: [Script] Full-Pallette Random Nick Color Script 1.2 - Added by Christopher Milner over 7 years ago

Nick list is not being coloured in the most recent beta (7/7/16 release date)

RE: [Script] Full-Pallette Random Nick Color Script 1.2 - Added by Per Amundsen over 7 years ago

Nicklist issue was fixed in 2.4 Beta Build (2016/07/12)

What about making a new thread with the fork? Just learned some users don't read past the first post.

RE: [Script] Full-Pallette Random Nick Color Script 1.2 - Added by Christopher Milner almost 7 years ago

Just now, my nicklist colors seem to be different from the chat colors.... sometimes by a small shade, othertimes by quite a bit.

RE: [Script] Full-Pallette Random Nick Color Script 1.2 - Added by Christopher Milner over 6 years ago

Quick Request, not sure as to how easy to implement though...

TwitchTV allows the user to set a custom colour for their username... what is the easiest way to use this colour for their username/message instead of autogenerating one for them?

The raw message is as follows though (so that it would help you)

@badges=;color=;display-name=Etesian1;emotes=;id=46e112f7-2e7e-405f-bd39-5fbff65b1d75;mod=0;room-id=22379976;sent-ts=1502331536170;subscriber=0;tmi-sent-ts=1502331554669;turbo=0;user-id=87096635;user-type=;user-name=etesian1 : PRIVMSG #pjdicesare :night

@badges=subscriber/6,bits/1000;color=#8F0000;display-name=Templar15;emotes=;id=a234acbe-8b9a-4e64-9dbe-3e1bcf7f98cd;mod=0;room-id=22379976;sent-ts=1502331637561;subscriber=1;tmi-sent-ts=1502331636720;turbo=0;user-id=20911855;user-type=;user-name=templar15 : PRIVMSG #pjdicesare :no, but keep going

As you can see, the colour is given as HEX, so how easy is it to drag that value instead of the autogenerating?

RE: [Script] Full-Pallette Random Nick Color Script 1.2 - Added by Per Amundsen over 6 years ago

It's relativity easy since the "rgb color" format in AdiIRC uses hex as well, all ircv3 tags can be received from the $msgtags identifier, example:

; Listen for incoming text events
on ^*:TEXT:*:*:{
  ; if $msgtags contains the "color tag" 
  if ($msgtags(color)) {

    ; Print the message using the "color tag" color
    ; Uses $replace to remove the hash tag
    echo -tlmb $target $+(<,$chr(4),$replace($msgtags(color),$chr(35),),$nick,$chr(3),>:) $1-

    ; Halt AdiIRC's default text output
    halt
  }  
}

RE: [Script] Full-Pallette Random Nick Color Script 1.2 - Added by Christopher Milner over 6 years ago

I am going to have to claim ignorance as to where the best place to put this bit of code would be into the 0.1.9 script....

RE: [Script] Full-Pallette Random Nick Color Script 1.2 - Added by Christopher Milner over 6 years ago

Ok, i got it working.. now to find out how to get the Nicklist to update with said color....

RE: [Script] Full-Pallette Random Nick Color Script 1.2 - Added by Per Amundsen over 6 years ago

You could try /cline -b, but I don't think I have added something to convert hex into decimal or rgb yet.

RE: [Script] Full-Pallette Random Nick Color Script 1.2 - Added by Christopher Milner over 6 years ago

Just having a method of being able to use the value that is stored in the rcustomcolor file would be handy.

IIRC it is saved as just as

Name
FFFFFF

Chances are it is already there, but I am just being a dumb idiot (and an idiot I am sometimes), and I am trying to go around this all the wrong way

RE: [Script] Full-Pallette Random Nick Color Script 1.2 - Added by Christopher Milner over 6 years ago

I know that I have to edit the following section to read the values from rcolorscustom, I am just trying to work out which parts to do it (bonus marks available for checking to see if the value is present, if not default to existing method)

on me:*:join:#:{
  ; If enabled continue
  if (%rcolors_nicklist) {
    .timer 1 3 clinergb #
  }
}

on *:JOIN:#:{
  ; If enabled continue
  if (%rcolors_nicklist) {
    cline -b $hexcolor($iif(%rcolors_nicklistbg == 1, $getDarkColor($nick), $getBrightColor($nick))) $nick
    }
}
; credits @ http://forums.mirc.com/ubbthreads.php/topics/153480/HEX_=%3E_RGB?
alias hex2rgb {
  $iif($isid,return,echo -a) $+($base($left($1,2),16,10),$chr(44),$base($mid($1,3,2),16,10),$chr(44),$base($right($1,2),16,10))
}

alias -l clinergb {
  if ($istok(%rcolors_blacklist,$network $+ . $+ $1,32)) {
    var %rcolors_disabled 1
  }
  var %n $nick($1,0)
  while (%n) {
    cline $iif(%rcolors_nicklist && %rcolors_disabled != 1,-b $hexcolor($iif(%rcolors_nicklistbg == 1, $getDarkColor($nick($1,%n)), $getBrightColor($nick($1,%n)))), -r) $1 $nick($1,%n)
    dec %n
  }
}

As you can tell, i have already fixed the colors to use the $hexcolor variable (which means that in theory no longer need the hex2rgb function)

    (1-24/24)