Project

General

Profile

Full-Pallette Random Nick Color Script fork v0.1.9.ini

Mr. BS, 06/09/2016 02:55 PM

 
1
; https://dev.adiirc.com/boards/5/topics/308
2

    
3
; Hackjob full-palette Random Nick Color script for AdiIRC
4
; Generate consistent but random, full-palette colors for nicks & set custom colors as you please
5
;
6
; Version 1.2 - Fork v0.1.9 by Pereba
7
;
8
;
9
; *Now allows storage of custom colors!
10
;		Usage: /setCustomColor <Nick> <Hex Color Code> - Example: /setCustomColor JohnDoe F854A7
11
;				/delCustomColor <Nick> - Example: /delCustomColor JohnDoe
12
;
13
; *Colors are now calculated once and stored as needed for both random and custom colors
14
;	This decreases CPU time (especially on bouncer playback) for each line displayed
15
; 	Custom colors persist between sessions (stored as rcolorscustom in your AdiIRC folder)
16
;
17
; *Buffer playback from bouncers is now properly supported without mangling output
18
;
19
; **NOTE: The built-in "Use Random Nick Colors" (Options -> Nick Colors) must be disabled for this script to work 
20
; **NOTE: Any nick colors set in the AdiIRC options menu override random or custom colors set by this script
21
;
22
; Thanks to pereba for the original inspiration script and kr0n for troubleshooting help, as well as 
23
; introducing me to hashtables :)
24
;
25
; For any of the output strings, if you don't want to show usermodes, you can replace $nick($chan, $nick).pnick
26
;  with just plain $nick
27
;
28
; If you're curious, $chr(61442) is a special AdiIRC character that interprets the following string as a hex 
29
; color code and allows for colorizing text
30
;
31
; If the script is acting weird for you, consider updating to the latest release or beta of AdiIRC; 
32
; some of this code relies on features or bufixes in later versions
33
;
34
; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
35
;
36
; This is the initialization section, it handles actions to take when the script is loaded for 
37
; the first time or reloaded, 
38
;
39
;
40
; whenever the script is loaded for the first time or reloaded, call /savereload, 
41
; which saves the rcolors and rcolorscustom hashtables to disk, clears them from memory, 
42
; then reloads them--this also handles reloading them from disk when AdiIRC first starts
43
;
44
on *:LOAD:savereload
45
on *:START:{
46
  hadd -m rcolors 0bgcolor $color(34)
47
  savereload
48
}
49
;
50
; save & overwrite the rcolors & rcolorscustom hashtables to disk on exit
51
;
52
on *:Exit:{
53
hsave -o rcolors rcolors
54
hsave -o rcolorscustom rcolorscustom
55
}
56
; dump all cached colors when the options screen is loaded; this ensures no stale colors are used
57
; if the background color is changed, since they might not be easy enough to see
58
on *:OPTIONS:{
59
  if ($hget(rcolors,0bgcolor) != $color(34)) {
60
    reset
61
  }
62
  if ($readini($adiircini,n,NickColors,NickColorsEntireLine) == True) {
63
    set -e %rcolors_ColorEntireLine True
64
  }
65
  else {
66
    unset %rcolors_ColorEntireLine
67
  }
68
  
69
  ; Sync tips config  
70
  set %rcolors_UseTips $readini($adiircini,n,Tips,UseTips)
71
  set %rcolors_Chan $gettok($readini($adiircini,n,Tips,Tips),1,166)
72
  set %rcolors_PM $gettok($readini($adiircini,n,Tips,Tips),11,166)
73
  set %rcolors_TipTimes $readini($adiircini,n,Tips,TipTimes)
74
  set %rcolors_ExcludeTips $readini($adiircini,n,Tips,ExcludeTips)
75
  set %rcolors_FocusedTips $readini($adiircini,n,Tips,FocusedTips)
76
}
77

    
78
;
79
; This section responds to normal in-channel text events
80
;
81
on &^*:TEXT:*:#,?:{
82
;
83
; Stop here if user turned off script
84
;
85
if (%rcolors_disabled) return
86
;
87
; Disable script on blacklisted networks/channels
88
;
89
if ($network $+ . $+ # isin %rcolors_blacklist) return
90
;
91
  ; Display Tip if enabled
92
  if (%rcolors_UseTips && !$istok(%rcolors_ExcludeTips,$target,166)) {
93
    if (%rcolors_FocusedTips && !$appactive) var %focusApproved 1
94
    if (!%rcolors_FocusedTips ) var %focusApproved 0    
95
    if (%rcolors_PM && %focusApproved && $target !ischan) noop $tip(msg. $+ $wid,$adilang(PrivateMessage) $network,$replace($adilang(0Says1),{0},$nick,{1},$1-),%rcolors_TipTimes,,,,$wid)
96
    if (%rcolors_Chan && %focusApproved && $target ischan) noop $tip(msg. $+ $wid,$adilang(ChannelMessage) $network,$replace($adilang(0On1Says2),{0},$nick,{1},#,{2},$1-),%rcolors_TipTimes,,,,$wid)
97
  }
98
;
99
; Check if message is ZNC buffer playback and use values accordingly
100
; ZNC buffer playback has different message content than a normal message and needs different handling
101
;
102
  var %time $spacefix($asctime($iif($msgstamp, $v1, $ctime), $timestampfmt))
103
  var %pnick $iif($target ischan,$iif($nick(#,$nick).cnick,$v1,$nick),$target)
104
  
105
  var %linecolor $chr(3) $+ $chr(61442) $+ $getcolor
106
  var %prefixuser $replace($prefixuser,$!pnick,%pnick,$!status,$nick(#,$nick).cmode,$!nick,$nick,$chr(32),$chr(160))
107
  var %msg $msgx
108
  ; check if message triggered a highlight to use respective color in echo
109
  var %h $highlight($iif($1- !isnum,$v1))
110

    
111
  ; Color entire prefixuser or just the nick? follow user preference:
112
  if (%rcolors_ColorEntirePrefixUser) {
113
    var %prefixuser %linecolor $+ $regsubex(%prefixuser,$patLine,%linecolor) $+ $chr(3)
114
  }
115
  else {
116
    var %prefixuser $replace($prefixuser,$!pnick,%linecolor $+ %pnick $+ $chr(3),$!status,$nick(#,$nick).cmode,$!nick,%linecolor $+ $nick $+ $chr(3),$chr(32),$chr(160))
117
  }
118

    
119
  ; If Options -> Nick Colors -> Color entire line is enabled:
120
  if (%rcolors_ColorEntireLine && !%h) {
121
    %prefixuser = %prefixuser $+ %linecolor
122
    %msg = $regsubex(%msg,$patLine,%linecolor)
123
    if (%rcolors_ColorTimestamp) { %time = %linecolor $+ $regsubex(%time,$patLine,%linecolor) $+ $chr(3) }
124
  }
125
    
126
  %msg = %time %prefixuser %msg
127
  echox -vrlmbfw2 $target %msg
128
  halt
129
}
130
;
131
; This section handles ACTIONs, like /me or /emote commands
132
; Mostly the same as PRIVMSG but with the output string adjusted to properly display these types of messages
133
;
134
on &^*:ACTION:*:#,?:{
135
  ;
136
  ; Stop here if user turned off script
137
  ;
138
  if (%rcolors_disabled) return
139
  ;
140
  ; Display Tip if enabled
141
  if (%rcolors_UseTips && !$istok(%rcolors_ExcludeTips,$target,166)) {
142
    if (%rcolors_FocusedTips && !$appactive) var %focusApproved 1
143
    if (!%rcolors_FocusedTips ) var %focusApproved 0  
144
    if (%rcolors_PM && $target !ischan) $tip(msg. $+ $wid,$adilang(Private) $adilang(Action) $network,$nick $+ : $1-,%rcolors_TipTimes,,,,$wid)
145
    if (%rcolors_Chan && $target ischan) $tip(msg. $+ $wid,$adilang(PrivateMessage) $network,$replace($adilang(0Says1),{0},$nick,{1},$1-),%rcolors_TipTimes,,,,$wid)
146
  }
147
  var %time $spacefix($asctime($iif($msgstamp, $v1, $ctime), $timestampfmt))
148
  var %pnick $iif($target ischan,$iif($nick(#,$nick).cnick,$v1,$nick),$target)
149
  var %linecolor $chr(3) $+ $chr(61442) $+ $getcolor
150
  var %msg $msgx
151
  ; check if message triggered a highlight to use respective color in echo
152
  var %h $highlight($iif($1- !isnum,$v1))
153
  
154
  ; Color just the nick or entire prefixuser? follow user preference:
155
  var %prefixbase $replace($prefixemote,$!pnick,%linecolor $+ %pnick $+ $chr(3),$!status,$nick(#,$nick).cmode,$!nick,%linecolor $+ $nick $+ $chr(3),$chr(32),$chr(160)), %prefixuser %prefixbase
156
  if (%rcolors_ColorEntirePrefixUser) {
157
    %prefixuser = %linecolor $+ $replace($prefixemote,$!pnick,%pnick,$!status,$nick(#,$nick).cmode,$!nick,$nick,$chr(32),$chr(160)) $+ $chr(3)
158

    
159
    ; Color only pnick if Color Entire Line is diabled for emotes
160
    if (!%rcolors_ColorEntireLine || !%rcolors_ColorEmote) {
161
      %prefixuser = %prefixbase
162
    }
163
  }
164

    
165
  ; If Options -> Nick Colors -> Color entire line is enabled:
166
  if (%rcolors_ColorEntireLine && !%h) {
167
    %prefixuser = %prefixuser $+ %linecolor
168
    %msg = $regsubex(%msg,$patLine,%linecolor)
169
    if (%rcolors_ColorTimestamp) { %time = %linecolor $+ $regsubex(%time,$patLine,%linecolor) $+ $chr(3) }
170
  }
171
  
172
  var %msgx %time %prefixuser $+ $iif(!%rcolors_ColorEmote,$chr(3)) %msg
173
 
174
  ;build the echo string
175
  echox -vrlmbfw2c action $target %msgx
176
  halt 
177
}
178

    
179
;
180
; User own text
181
;
182
on *:INPUT:#,?: {
183
  ;
184
  ; Stop here if user turned off script
185
  ;
186
  if (%rcolors_disabled) return
187
  
188
  noop $regex(e,$1,/^(?:(\/{1,4})(me\b|action\b)?)?/i) 
189
  if ( ($regml(e,0) != 1) || ($ctrlenter) ) && ($status == connected) {
190
    var %time $spacefix($asctime($iif($msgstamp, $v1, $ctime), $timestampfmt))
191
    var %pnick $iif($target ischan,$iif($nick(#,$nick).cnick,$v1,$nick),$me)
192
    var %linecolor $chr(3) $+ $chr(61442) $+ $getcolor
193
    var %msgxraw $replacex($iif($regml(e,1) && !$ctrlenter, $iif($len($v1) > 1,$($mid($msgx,$calc($len($1) +2)),2),$mid($msgx,$calc($len($1) +2))), $msgx),$chr(9),$chr(160))
194
    var %msg %msgxraw
195
    
196
    ; Color just the nick or entire prefixuser? follow user preference:
197
    var %prefixbase $replace($iif($regml(e,2) && !$ctrlenter,$prefixemote,$prefixuser),$!pnick,%linecolor $+ %pnick $+ $chr(3),$!status,$nick(#,$nick).cmode,$!nick,%linecolor $+ $nick $+ $chr(3),$chr(32),$chr(160)), %prefixuser %prefixbase
198
    if (%rcolors_ColorEntirePrefixUser) {
199
      %prefixuser = %linecolor $+ $regsubex(%prefixbase,$patLine,%linecolor) $+ $chr(3)
200
      
201
      ; Color only pnick if Color Entire Line is diabled for emotes
202
      if (($regml(e,2)) && (!%rcolors_ColorEntireLine || !%rcolors_ColorEmote)) {
203
        %prefixuser = %prefixbase
204
      }
205
    }
206

    
207
    ; If Options -> Nick Colors -> Color entire line is enabled: (except /action msg)
208
    if (%rcolors_ColorEntireLine) {
209
      if ($regml(e,2) && !%rcolors_ColorEmote) {
210
      }
211
      else {
212
        %prefixuser = $iif(%rcolors_ColorEmote,%linecolor) $+ %prefixuser $+ %linecolor
213
        %msg = $regsubex(new,%msgxraw,$patLine,%linecolor)
214
        if (%rcolors_ColorTimestamp) { %time = %linecolor $+ $regsubex(t,%time,$patLine,%linecolor) $+ $chr(3) }
215
      }
216
    }
217

    
218
    ; Action VS regular message
219
    if ($regml(e,2) && !$ctrlenter) {
220
      var %msgx %time %prefixuser $+ $iif(!%rcolors_ColorEmote,$chr(3)) %msg, %text PRIVMSG $target : $+ $chr(1) $+ ACTION %msgxraw $+ $chr(1)
221
      echox -vw2c action $target %msgx
222
    }
223
    else {
224
      var %msgx %time %prefixuser %msg, %text PRIVMSG $target : $+ %msgxraw
225
      echox -vw2c own $target %msgx
226
    }
227
    .rawx %text
228
    halt
229
  }
230
}
231

    
232
;
233
; Coloring nicklist
234
;
235
on me:*:join:#:{
236
  ; If enabled continue
237
  if (%rcolors_nicklist) {
238
    .timer 1 3 clinergb #
239
  }
240
}
241

    
242
on *:JOIN:#:{
243
  ; If enabled continue
244
  if (%rcolors_nicklist) {
245
    cline -b $rgb( [ $hex2rgb($iif(%rcolors_nicklistbg == 1, $getDarkColor($nick), $getBrightColor($nick))) ] ) $nick
246
  }
247
}
248
; credits @ http://forums.mirc.com/ubbthreads.php/topics/153480/HEX_=%3E_RGB?
249
alias hex2rgb {
250
  $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))
251
}
252

    
253
alias -l clinergb {
254
  if ($istok(%rcolors_blacklist,$network $+ . $+ $1,32)) {
255
    var %rcolors_disabled 1
256
  }
257
  var %n $nick($1,0)
258
  while (%n) {
259
    cline $iif(%rcolors_nicklist && %rcolors_disabled != 1,-b $rgb( [ $hex2rgb($iif(%rcolors_nicklistbg == 1, $getDarkColor($nick($1,%n)), $getBrightColor($nick($1,%n)))) ] ), -r) $1 $nick($1,%n)
260
    dec %n
261
  }
262
}
263

    
264
alias -l resetNicklist {
265
  tokenize 32 $regsubex($str(x,$chan(0)),/x/g,\n $chr(32))
266
  clinergb $chan($*)
267
}
268

    
269
; credits Kin @ GeekShed
270
alias -l patLine return /\co|(\cc(?!\d(?:\d(?:,\d\d?)?)?))/gu
271

    
272
alias -l spacefix {
273
  return $replacex($1,$chr(32),$chr(160))
274
}
275

    
276
alias -l getcolor {
277
; Initialize %color as neutral grey in case we end up with nothing else to return
278
  var %color = 888888
279
; Check if nick has a custom color set in AdiIRC options; if it does, return that color
280
  if ($nick(#, $nick).color > 1) {
281
    var %color = $getHexOfColor($nick(#, $nick).color))
282
    return %color
283
}
284
; Check if nick has a script-custom color; if it does, return that color
285
  else if ($hget(rcolorscustom, $nick)) {
286
    var %color = $hget(rcolorscustom, $nick)
287
    return %color
288
    }
289
; Check if nick has a cached color, if it does, return that color
290
  else if ($hget(rcolors, $nick)) {
291
    var %color = $hget(rcolors, $nick)
292
    return %color
293
  }
294
; If no cached or custom colors are found, roll for a new color and add it to the cache
295
  else {
296
    var %color $iif(%rcolors_bg == 1, $getDarkColor, $getBrightColor)
297
    hadd -m rcolors $nick %color
298
    return %color
299
  }
300
; If something fails, return %color as originally set to 888888
301
  return %color
302
}
303

    
304
;
305
;
306
;
307
; This is the alias for generating bright colors
308
;
309
alias -l getBrightColor {
310
;
311
; Generate a unique seed number by calculating the MD5 hash of a nick, interpreting the last 8 characters as a hex number, then converting that to decimal
312
;
313
  ;;;var %nickSeedNum = $base($right($md5($nick),8),16,10)
314
  var %nickSeedNum = $base($right($md5($iif($1,$1,$nick)),8),16,10)
315
;
316
; Multiply by a high prime number, then take the modulus of a prime number < 255 to get 3 values for R,G,B color; this induces a bit more variety in the colors, and
317
; for whatever reason (I'm not a mathematician) tends to "favor" returning numbers close to 255 (brighter colors)
318
;
319
  var %dec1 = $calc((%nickSeedNum * 7793) % 251)
320
  var %dec2 = $calc((%nickSeedNum * 5153)  % 241)
321
  var %dec3 = $calc((%nickSeedNum * 3623) % 239)
322
;
323
; Take the average of the RGB values 
324
;
325
  var %decaverage = $calc((%dec1 + %dec2 + %dec3)/3)
326
;
327
; Generate colors until you get one that is "bright" (average RGB value > 128)
328
; If you find these colors are too dark or bright, you can adjust the %decaverage <= 128
329
;
330
  while (%decaverage <= 128) {
331
    var %dec1 = $calc((%dec1 * 7793) % 251)
332
    var %dec2 = $calc((%dec2 * 5153) % 241)
333
    var %dec3 = $calc((%dec3 * 3623) % 239)
334
    var %decaverage = $calc((%dec1 + %dec2 + %dec3)/3)
335
  }
336
;
337
; call $RGBToHex to turn the RGB Value into a hex color code and return that code
338
;
339
  var %brightColorReturn = $RGBToHex(%dec1,%dec2,%dec3)
340
  return %brightColorReturn
341
}
342
;
343
; This is the alias for generating dark colors
344
; It's the same as $getBrightColor but looks for colors that are "dark", or have
345
; average RGB value < 128 - Again you can tweak the %decaverage <= 128 if they're too dark or bright
346
;
347
alias -l getDarkColor {
348
  ;var %nickSeedNum = $base($right($md5($nick),8),16,10)
349
  var %nickSeedNum = $base($right($md5($iif($1,$1,$nick)),8),16,10)
350
  var %dec1 = $calc((%nickSeedNum * 7793) % 113)
351
  var %dec2 = $calc((%nickSeedNum * 5153) % 127)
352
  var %dec3 = $calc((%nickSeedNum * 3623) % 131)
353
  var %decaverage = $calc((%dec1 + %dec2 + %dec3)/3)
354

    
355
  while (%decaverage >= 128) {
356
    var %dec1 = $calc((%dec1 * 7793) % 113)
357
    var %dec2 = $calc((%dec2 * 5153) % 127)
358
    var %dec3 = $calc((%dec3 * 3623) % 131)
359
    var %decaverage = $calc((%dec1 + %dec2 + %dec3)/3)
360
  }
361
  var %darkColorReturn = $RGBToHex(%dec1,%dec2,%dec3)
362
  return %darkColorReturn
363
}
364
;
365
; This is the alias for converting RGB values to Hex, used here for getting hex strings to put 
366
; after $chr(61442) - see top if you're not sure what this character is
367
;
368
; it takes in 3 numbers from 0-255, converts them to hex numbers, 
369
; then returns them as a single string, EG $RGBToHex(255,255,255) or "White" returns FFFFFF
370
;
371
alias -l RGBToHex {
372
  var %RtoHex = $base($1,10,16,2)
373
  var %GtoHex = $base($2,10,16,2)
374
  var %BtoHex = $base($3,10,16,2)
375
  var %HexCodeReturn = %RToHex $+ %GToHex $+ %BToHex
376
  return %HexCodeReturn
377
}
378
;
379
; This is the alias for determining if your background is bright
380
;
381
; Average RGB of 100 seems to work well for determining if background is light or dark,
382
; but if you find the script is using colors that aren't showing well you might want to 
383
; adjust this
384
;
385
alias -l isBackgroundBright {
386
;
387
; get the backgound color
388
;
389
  var %bgRGB = $rgb($iif($1,$color(27),$color(34)))
390
;
391
; strip out the commas and replace them with the + sign
392
;
393
  var %bgRGB = $replace(%bgRGB,$chr(44),$chr(43))
394
;
395
; evaluate the string from above
396
;
397
  var %bgRGBAverage = $calc((%bgRGB)/3)
398
;
399
; check if the average RGB value of the background is > 100; 
400
; return 1 if it is (bright) or 0 if it isn't (dark)
401
;
402
  if (%bgRGBAverage >= 100) { 
403
    return 1
404
  }
405
  else return 0
406
}
407

    
408
;
409
; This is the alias that gets the hex value of numbered config colors 
410
; https://dev.adiirc.com/projects/adiirc/wiki/Extra_Colors
411
;
412
; It is used in this script only to keep nicks with custom colors set using 
413
; those colors instead of picking random colors
414
;
415
alias -l getHexOfColor {
416
;
417
; get the specified color's R,G,B value
418
  var %colorToGet = $rgb($color($1))
419
;
420
; tokenize the string returned above with commas ($chr(44)) as delimiter; pass those values into the $RGBToHex alias and return the value
421
  tokenize 44 %colorToGet
422
  return $RGBToHex($1,$2,$3)
423
}
424
;
425
; This is the alias for setting custom nick colors, it takes a Nick and a hex color code as arguments
426
; EXAMPLE /setCustomColor JohnDoe f854a7
427
;
428
alias setCustomColor {
429
; typing just /setcustomcolor returns rudimentary help
430
; otherwise write the nick+color to hash table rcolorscustom and save to disk
431
   $iif($1, /echo -at $+($chr(61442),$2) Set this color for nick $1, /echo -at Usage: /setCustomColor <Nick> <Hex Color Code> Example: /setCustomColor JohnDoe F854A7)
432
   
433
   hadd -m rcolorscustom $1 $2
434
   hsave -o rcolorscustom rcolorscustom
435
}
436
;
437
; This is the alias for deleting custom nick colors, it takes only a nick as an argument
438
; EXAMPLE /delCustomColor JohnDoe
439
alias delCustomColor {
440
; typing just /delcustomcolor returns rudimentary help
441
; otherwise remove nick+color from hash table rcolorscustom and save to disk
442
   $iif($1, echo -at Trying to remove custom color for $1, /echo -at Usage: /delCustomColor  <Nick> Example: /delCustomColor JohnDoe)
443
   hdel rcolorscustom $1
444
   hsave -o rcolorscustom rcolorscustom
445
}
446
;
447
; This is the alias for clearing all cached random colors
448
; It empties the rcolors hashtable, then saves the empty table back to the disk
449
; It is generally used in this script for ensuring that colors adjust accordingly to background color changes
450
;
451
alias -l reset {
452
; Remove all cached colors
453
  if ($hget(rcolors)) {
454
    .hdel -w rcolors *
455
	savereload
456
  }  
457
; Check if background is light or dark and set %rcolors_bg accordingly
458
  ;;;set %rcolors_bg $isBackgroundBright
459
  set %rcolors_bg $iif($var(%rcolors_forcestyle,1).value != $null,$v1,$isBackgroundBright)
460
  rcolors_resetnicklist
461
}
462
alias -l rcolors_resetnicklist {
463
  set %rcolors_nicklistbg $iif($var(%rcolors_nickliststyle,1).value != $null,$v1,$isBackgroundBright(nicklist))
464
}
465
;
466
; This is the alias for saving & reloading cached & custom colors to disk. It is primarily used on first run, or when
467
; settings are changed and need to be stored
468
; 
469

    
470
alias savereload {
471
; check if the rcolors hashtable exists, if it does, save it to disk, purge all entries from memory and reload it.
472
; it also checks if the hashtable is too large (more than 1000 entries) and purges it if that's the case
473
; if the hashtable is purged, colors will be recalculated and entered the next time a person speaks
474
	if ($hget(rcolors)) {
475
		if ($hget(rcolors,0).item > 1000) {
476
			.hdel -w rcolors *
477
		}
478
		hsave -o rcolors rcolors
479
		.hdel -w rcolors *
480
		hload rcolors rcolors
481
	}
482
    else { 
483
		hmake rcolors 100
484
	}
485
; same as above, but with rcolorscustom
486
; rcolorscustom will also never be auto-cleared  
487
   if ($hget(rcolorscustom)) {
488
	hsave -o rcolorscustom rcolorscustom
489
	.hdel -w rcolorscustom *
490
	hload rcolorscustom rcolorscustom
491
	}
492
            else { 
493
            hmake rcolorscustom 100
494
            }
495
                      
496
}
497

    
498
menu channel {
499
  RGB Random Nick Colors
500
  .Disable in #
501
  ..$iif($network $+ . $+ # isin %rcolors_blacklist,$style(1)) Yes:set %rcolors_blacklist $addtok(%rcolors_blacklist,$network $+ . $+ #,32) | clinergb #
502
  ..$iif($network $+ . $+ # !isin %rcolors_blacklist,$style(1)) No:set %rcolors_blacklist $deltok(%rcolors_blacklist,1,$network $+ . $+ #) | clinergb #
503
}
504

    
505
menu menubar {
506
  RGB Random Nick Colors
507
  .$iif(!%rcolors_disabled,$style(1)) Enabled:$iif(%rcolors_disabled,unset %rcolors_disabled,set %rcolors_disabled 1) | $iif(%rcolors_nicklist,scid -a resetNicklist)
508
  .-
509
  .Color messages style
510
  ..$iif(%rcolors_forcestyle == $null,$style(1)) Auto:unset %rcolors_forcestyle | reset
511
  ..$iif(%rcolors_forcestyle == 0,$style(1)) Bright:set %rcolors_forcestyle 0 | reset
512
  ..$iif(%rcolors_forcestyle == 1,$style(1)) Dark:set %rcolors_forcestyle 1 | reset
513
  .Color entire prefix user
514
  ..$iif(%rcolors_ColorEntirePrefixUser,$style(1)) Yes:set %rcolors_ColorEntirePrefixUser True
515
  ..$iif(%rcolors_ColorEntirePrefixUser != True,$style(1)) No:unset %rcolors_ColorEntirePrefixUser
516
  .Color entire message
517
  ..$iif(%rcolors_ColorEntireLine,$style(1)) Yes:.setconfig NickColors NickColorsEntireLine True | set %rcolors_ColorEntireLine True
518
  ..$iif(%rcolors_ColorEntireLine != True,$style(1)) No:.setconfig NickColors NickColorsEntireLine False | unset %rcolors_ColorEntireLine False
519
  .└ Including emote message
520
  ..$iif(%rcolors_ColorEmote,$style(1)) Yes:set %rcolors_ColorEmote True
521
  ..$iif(%rcolors_ColorEmote != True,$style(1)) No:unset %rcolors_ColorEmote
522
  .└ Including timestamp
523
  ..$iif(%rcolors_ColorTimestamp,$style(1)) Yes:set %rcolors_ColorTimestamp True
524
  ..$iif(%rcolors_ColorTimestamp != True,$style(1)) No:unset %rcolors_ColorTimestamp
525
  .-
526
  .$iif(%rcolors_nicklist,$style(1)) Enable nicklist colors:$iif(%rcolors_nicklist,unset %rcolors_nicklist,set %rcolors_nicklist True) | scid -a resetNicklist
527
  .Color nicklist style
528
  ..$iif(%rcolors_nickliststyle == $null,$style(1)) Auto:unset %rcolors_nickliststyle | rcolors_resetnicklist | scid -a resetNicklist
529
  ..$iif(%rcolors_nickliststyle == 0,$style(1)) Bright:set %rcolors_nickliststyle 0 | rcolors_resetnicklist | scid -a resetNicklist
530
  ..$iif(%rcolors_nickliststyle == 1,$style(1)) Dark:set %rcolors_nickliststyle 1 | rcolors_resetnicklist | scid -a resetNicklist
531
}