Highdude

lol mike

Oct 27th, 2015
163
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.56 KB | None | 0 0
  1. ;my attempt at auto colored nicks
  2. ; 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)
  3. ; Added
  4. ;FIXED BY HIGHDUDE
  5. on 1:LOAD:/echo xchat nick colors by mike v0.2
  6.  
  7. ;;this might be a much better way to go about this
  8.  
  9. on *:text:*:#:{
  10.  
  11. if ($cnick($nick).color == $color(default)) {
  12. ;stupid fix for zncs playback buffer
  13. if ($nick != ***) {
  14. var %nlength = $len($nick)
  15. var %e = 1
  16. var %sumofnick = 0
  17. ;loops over every letter in the nick
  18. while (%e <= %nlength) {
  19. ; this just adds each asc value to eachother.
  20. %sumofnick = $asc($mid($nick,%e,1)) + %sumofnick
  21. inc %e
  22. }
  23. ;this generates the color to use...
  24. ;we dont use colors black(1), white(16), dark blue(2), yellow(8)
  25. var %color = $gettok(3.4.5.6.7.9.10.11.12.13.14.15,$calc(%sumofnick % 12),46)
  26. .cnick -m1 $nick %color *
  27.  
  28.  
  29. ; original code keeping for reference
  30. ;.cnick $nick $gettok(%colors,$calc(%cu rrentcolor),32)
  31. ;if (%currentcolor == $gettok(%colors,0,32)) {
  32. ; set %currentcolor 1
  33. ;}
  34. ;else {
  35. ; set %currentcolor $calc(%currentcolor + 1)
  36. ;}
  37.  
  38. }
  39.  
  40. }
  41. }
  42.  
  43. ;we dont want our nick color list to get out of control so we nuke it each time we start mirc
  44. on 1:START:{
  45. ;turn cnick on then loop over old cnick list and remove all entries.
  46. .cnick on
  47. while ($cnick(0)) { .cnick -r 1 }
  48. .cnick -m1 $me 4 *
  49. }
  50.  
  51. ;sets nick colors for new ppl who join the channel
  52. on *:join:#: {
  53. var %nlength = $len($nick)
  54. var %e = 1
  55. var %sumofnick = 0
  56. ;loops over every letter in the nick
  57. while (%e <= %nlength) {
  58. ; this just adds each asc value to eachother.
  59. %sumofnick = $asc($mid($nick,%e,1)) + %sumofnick
  60. inc %e
  61. }
  62. ;this generates the color to use...
  63. ;we dont use colors black(1), white(16), dark blue(2), yellow(8)
  64. var %color = $gettok(3.4.5.6.7.9.10.11.12.13.14.15,$calc(%sumofnick % 12),46)
  65. .cnick -m1 $nick %color *
  66. }
  67.  
  68.  
  69. ;need to update the nick color on nick changes
  70. on *:NICK:{
  71. var %nlength = $len($newnick)
  72. var %e = 1
  73. var %sumofnick = 0
  74. ;loops over every letter in the nick
  75. while (%e <= %nlength) {
  76. ; this just adds each asc value to eachother.
  77. %sumofnick = $asc($mid($newnick,%e,1)) + %sumofnick
  78. inc %e
  79. }
  80. ;this generates the color to use...
  81. ;we dont use colors black(1), white(16), dark blue(2), yellow(8)
  82. var %color = $gettok(3.4.5.6.7.9.10.11.12.13.14.15,$calc(%sumofnick % 12),46)
  83. .cnick -m1 $newnick %color *
  84.  
  85. }
Advertisement
Add Comment
Please, Sign In to add comment