Author Topic: Rainbow Text script?  (Read 8616 times)

Lauranator

  • Newbie
  • *
  • Posts: 14
Rainbow Text script?
« on: June 17, 2008, 09:54:39 PM »
Anyone have or know where I can find a script to make rainbow text  in icechat?  I have one for mirc, but yeh, it wont work in icechat and i dont know enough about script writing (yet) to make my own.  Or if someone can somehow convert the one I have for mirc to icechat script, that'd  be cool too.  Just let me know and I'll post the mirc script here.

Thx.   :-)

Lauranator

  • Newbie
  • *
  • Posts: 14
Re: Rainbow Text script?
« Reply #1 on: June 22, 2008, 09:30:18 AM »
Nobody knows about rainbow text scripts, eh?  OH well.   I'll keep looking around.

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Rainbow Text script?
« Reply #2 on: June 22, 2008, 11:12:19 AM »
This was extracted from the CScript script, which had this built in, with a few small changes.
It will not color text that are commands, and if you wish to bypass colors, simply start your text with a "." .The colors that are randomly selected are specified in the clrs Array.

Code: [Select]
Function OutText(OutgoingText)   
Dim i, Data
Data=Split(OutGoingText," ")

clrs = Array(1,2,3,4,5,6,7,9,10,12,13,14,16,17,18,19,20,21,22,23,24)

if Left(OutGoingText,1) <> "/" and Left(OutGoingText,1) <> "." then
  for i =lbound(Data) to ubound(Data) 
     TextColor = clrs(Int((UBound(clrs) * Rnd)))
     Data(i) = "" & TextColor & Data(i)
  next

end if

OutText = Join(Data, " ")   

End Function

The IceChat God

Lauranator

  • Newbie
  • *
  • Posts: 14
Re: Rainbow Text script?
« Reply #3 on: June 24, 2008, 11:16:37 PM »
Ok thx Snerf, this works.  I had to change the . to a , tho to bypass the colors bcos for some reason the .  just didnt work.

One thing tho, how can I edit this to make each letter a diff color rather than each word?

Would it be editing this line?:   Data(i) = "" & TextColor & Data(i)

Or am I totally off here?

Thx.


Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: Rainbow Text script?
« Reply #4 on: June 25, 2008, 07:38:28 AM »
I made a function that does this a while ago, and here it is combined with an OUTTEXT function:
Code: [Select]
Function OUTTEXT(OutGoingText)

If Left(OutGoingText,1) = "." or Left(OutGoingText,1) = "/" then
  OUTTEXT = OutGoingText
Else
  OUTTEXT = RandomColors(OutGoingText)
End If

End Function


Function RandomColors(Text)
NewText = ""
For i = 0 to Len(Text)
  NewColor = GetIdentifier("$rnd(1,72)")
  Character = Mid(Text,i+1,1)
  If IsNumeric(Character) then
    Character = Character
  Else
    Character = "" & NewColor & Character
  End If

  If NewText = "" then
    NewText = Character
  Else
    NewText = NewText & Character
  End If
Next
RandomColors = NewText
End Function

To bypass the RandomColors function start the line with a '.'

Fixed, thanks HackBenjami
« Last Edit: June 26, 2008, 07:51:15 AM by Morio »
"I don't know what World War 3 will be fought with, but I know World War 4 with be fought with sticks and stones." - Albert Einstein

HackBenjamin

  • Newbie
  • *
  • Posts: 35
Re: Rainbow Text script?
« Reply #5 on: June 25, 2008, 02:15:46 PM »
Code: [Select]
Function OUTTEXT(OutGoingText)

If Left(OutGoingText,1) = "." or Left(OutGoingText,1) = "/" then
  OUTTEXT = OutGoingText
Else
  OUTTEXT = RandomColors(OutGoingText)
End If

End Function


Function RandomColors(Text)
NewText = ""
For i = 0 to Len(Text)
  NewColor = GetIdentifier("$rnd(1,72)")
  Character = Mid(Text,i+1,1)
  If IsNumeric(Character) then
    Character = Character
  Else
    Character = "" & NewColor & Character
  End If

  If NewText = "" then
    NewText = Character
  Else
    NewText = NewText & Character
  End If
Next
RandomColors = NewText
End Function
[/color]

You had an extra "then" after your first "Else".