Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;my attempt at auto colored nicks
- ; Updated 08/01/13: Only set nick colors in chat(-m1 option 0 = both) and not userlist anymore(seemed to slow mirc down too much)
- ; Added
- ;FIXED BY HIGHDUDE
- on 1:LOAD:/echo xchat nick colors by mike v0.2
- ;;this might be a much better way to go about this
- on *:text:*:#:{
- if ($cnick($nick).color == $color(default)) {
- ;stupid fix for zncs playback buffer
- if ($nick != ***) {
- var %nlength = $len($nick)
- var %e = 1
- var %sumofnick = 0
- ;loops over every letter in the nick
- while (%e <= %nlength) {
- ; this just adds each asc value to eachother.
- %sumofnick = $asc($mid($nick,%e,1)) + %sumofnick
- inc %e
- }
- ;this generates the color to use...
- ;we dont use colors black(1), white(16), dark blue(2), yellow(8)
- var %color = $gettok(3.4.5.6.7.9.10.11.12.13.14.15,$calc(%sumofnick % 12),46)
- .cnick -m1 $nick %color *
- ; original code keeping for reference
- ;.cnick $nick $gettok(%colors,$calc(%cu rrentcolor),32)
- ;if (%currentcolor == $gettok(%colors,0,32)) {
- ; set %currentcolor 1
- ;}
- ;else {
- ; set %currentcolor $calc(%currentcolor + 1)
- ;}
- }
- }
- }
- ;we dont want our nick color list to get out of control so we nuke it each time we start mirc
- on 1:START:{
- ;turn cnick on then loop over old cnick list and remove all entries.
- .cnick on
- while ($cnick(0)) { .cnick -r 1 }
- .cnick -m1 $me 4 *
- }
- ;sets nick colors for new ppl who join the channel
- on *:join:#: {
- var %nlength = $len($nick)
- var %e = 1
- var %sumofnick = 0
- ;loops over every letter in the nick
- while (%e <= %nlength) {
- ; this just adds each asc value to eachother.
- %sumofnick = $asc($mid($nick,%e,1)) + %sumofnick
- inc %e
- }
- ;this generates the color to use...
- ;we dont use colors black(1), white(16), dark blue(2), yellow(8)
- var %color = $gettok(3.4.5.6.7.9.10.11.12.13.14.15,$calc(%sumofnick % 12),46)
- .cnick -m1 $nick %color *
- }
- ;need to update the nick color on nick changes
- on *:NICK:{
- var %nlength = $len($newnick)
- var %e = 1
- var %sumofnick = 0
- ;loops over every letter in the nick
- while (%e <= %nlength) {
- ; this just adds each asc value to eachother.
- %sumofnick = $asc($mid($newnick,%e,1)) + %sumofnick
- inc %e
- }
- ;this generates the color to use...
- ;we dont use colors black(1), white(16), dark blue(2), yellow(8)
- var %color = $gettok(3.4.5.6.7.9.10.11.12.13.14.15,$calc(%sumofnick % 12),46)
- .cnick -m1 $newnick %color *
- }
Advertisement
Add Comment
Please, Sign In to add comment