coloured text..
Posted by ph4ze
Wednesday, April 05, 2006
Description: makes multicolour text

on *:input:*: {
  if ($1 == c) {
    /set %a 2
    while ($ [ $+ [ %a ] ]) {
      /set %text %text $colors($ [ $+ [ %a ] ])
      /unset %return
      /inc %a
    }
    //say %text
    /unset %a
    /unset %text
    halt
  }
}

alias ctrig {
  if ($1 == 1) {
    set %trig 1
    echo random colour text had been turned on!
  }
  else {
    set %trig 0
    echo random colour text had been turned off!
  }
}

alias colors {
  /set %b 1
  while (%b <= $len($1)) {
    var %f = 1 2 3 5 6 10 12 14
    var %rand = $gettok(%f,$rand(1,$gettok(%f,0,32)),32)
    /set %return %return $+ [^K] $+ %rand $+ $right($left($1,%b),1)
    /inc %b
  }
  return %return
}
regsubex
Posted by mackhil
Saturday, June 24, 2006 06:40pm PDT
Using regsubex (mIRC 6.17+) is a better solution here for the colors alias. The code is much shorter, can handle spaces and also generates double digit colors.

alias colors return $replace($regsubex($replace($1,$chr(32),$chr(1)),/(.)/g,$+([^K],$base($r(0,15),10,10,2),\t)),$chr(1),$chr(32))
Subject line
Posted by HellRaz0r
Tuesday, September 12, 2006 11:27pm PDT
you dont need all that even, just $regsubex(some text here,/(.)/g,[^K] $+ $r(1,15) $+ \t)
Submit a comment
Oops! You need to login or register before you can post a comment!

ebaum's world