This is based off of the same premise of my other rainbow script.
What it does: Automatically changes the color of text that you type into a smooth rainbow.
To use: Copy the script to the clipboard, press alt+r in mIRC, File->New, Edit->Paste. Right-click in a channel to enable/disable it and change whether the rainbow colors will be the foreground or background colors. Unforunately, numbers can obviously cause some problems, so if the text contains any numbers it won't modify it. If you don't like that, remove ' && ($1- isalpha)' from line 10.
on *:LOAD:{
set %RainbowTextOn 0
set %RainTxtStatus Enable
set %RainTxtColK Background
set %RainTxtColH 0
halt
}
on *:INPUT:*:{
if (/* !iswm $1) && (%RainbowTextOn == 1) && ($1- isalpha) {
set %RainTxtCols 4,7,8,9,11,12,6
var %RainTxtK = $replace($1-,$chr(32),~)
var %k = $r(1,7), %l = 1
while (%l <= $len(%RainTxtK)) {
if (%k > 7) {
var %k = 1
continue
}
elseif ($mid(%RainTxtK,%l,1) == ~) {
inc %l
var %RainTxt = $+(%RainTxt,~)
continue
}
else {
var %RainTxtCol = $gettok(%RainTxtCols,%k,44)
$iif(%RainTxtColH == 0,set -u0 %RainTxt $+(%RainTxt,,%RainTxtCol,$mid(%RainTxtK,%l,1)), $&
set -u0 %RainTxt $+(%RainTxt,,1,$chr(44),%RainTxtCol,$mid(%RainTxtK,%l,1)))
inc %l
inc %k
}
}
msg $target $replace(%RainTxt,~,$chr(32))
halt
}
}
menu channel {
-
Rainbow Text
.%RainTxtStatus:{
$iif(%RainTxtStatus == Enable,set %RainbowTextOn 1,set %RainbowTextOn 0)
$iif(%RainTxtStatus == Enable,set %RainTxtStatus Disable,set %RainTxtStatus Enable)
halt
}
.Use %RainTxtColK Colors:{
$iif(%RainTxtColK == Foreground,set %RainTxtColH 0,set %RainTxtColH 1)
$iif(%RainTxtColK == Foreground,set %RainTxtColK Background,set %RainTxtColK Foreground)
halt
}
-
}
alias rainbow {
var %a = 01 03 05 07 09 12 14
return $regsubex($1-,/([^ ])/g,$+($chr(3),$gettok(%a,$iif($calc(\\n % $numtok(%a,32)),$v1,$numtok(%a,32)),32),\\1))
}
sry for double posting but hawkee\'s comment system removes slashes, because in php \n would be a new line, but I don\'t see why he would need to remove slashes but anyways, repost \'escaping\' my slashes