color text rainbow color

By AnDyWong on Jan 07, 2009

color text like rainbow..
ie.. /say $rainbow()
or

on :input::{
if (/* !iswm $1) { msg $target $rainbow($1-) | haltdef }
}

Alias rainbow {
  var %rbo 1 , %rb 2 , %txa 
  var %ct $replace($1-,$chr(32),Š) , %rt 1 , %rb $r(2,14)
  while (%rbo < $CALC($len(%ct) + 1 )) {
    if (%rb > 15) %rb = 2
    %txa = %txa $+ $( $+ %rb) $+ $mid(%ct,%rbo,1)
    inc %rbo
    inc %rb
  }
  return $replace(%txa,Š,$chr(32))
}

Comments

Sign in to comment.
Gummo   -  Jan 05, 2010

Eh.

$regsubex($1-,/(\S)/g,$+(,$iif($calc(\n % 7),$gettok(04 07 08 09 11 13,$v1,32),06),$iif(\1 == $chr(44),$v2 $+ 1),\1))

That gives it a black background where there's a comma, you might want to put ctrl+bctrl+b instead or something.

 Respond  
Korvin   -  Jan 21, 2009

napa, thats not rainbow. this is:

f5 {
  var %q = 1, %y = 1,%h = $replace($editbox($active),$chr(32),Š), %w = $len(%h), %r = 08 07 04 05 13 06 10 11 12 02 09 03
  while (%q <= %w) {
    if (%y > $numtok(%r,32)) { var %y = 1 }
    var %k = $mid(%h,%q,1)
    var %t = $+(%t,$chr(03),$gettok(%r,%y,32),$chr(31),%k,$chr(31)) 
    inc %q
    if ($mid(%h,%q,1) = Š) { var %t = $+(%t,Š) | inc %q }
    inc %y
  }
  editbox -n /msg $active $+($chr(2),$replace(%t,Š,$chr(32)))
}
 Respond  
napalm`   -  Jan 21, 2009

Good call napa.

Mine was for reference only. :)

 Respond  
napa182   -  Jan 21, 2009

this works fine for numbers and letters for me.

$regsubex($1-,/(\w|\W)/g,$+($chr(2),$chr(3),$r(2,15),$chr(2),\1))
 Respond  
Korvin   -  Jan 20, 2009

also that (%rbo < $CALC($len(%ct) + 1 )) is not needed. simply: (%rbo <= $len(%ct))

 Respond  
Korvin   -  Jan 20, 2009

napalm, your script wont work for numbers xD
f4 { editbox -n /msg $active 1,1 $+ $regsubex($editbox($active),//g,$+($chr(03),$r(0,1),$r(2,9))) }

typw words in the editbox, then use f4 as an enter key. iwin... technically this isnt rainbow btw.

 Respond  
AnDyWong   -  Jan 11, 2009

yeah i'm a fool naplam, hehe.. but thanks 4da code you give.

 Respond  
PuNkTuReD   -  Jan 08, 2009

hahahaha niice napalm owned him in one line hahahahahaha

 Respond  
napalm`   -  Jan 08, 2009
alias rb say $regsubex($$1-,/(.)/g,$+(,$r(2,15),,\1))

/rb sit down fool

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.