Author Topic: Color script (4 colors maximum)  (Read 5601 times)

Roseedargent

  • Guest
Color script (4 colors maximum)
« on: September 12, 2011, 03:17:33 PM »
Hello,

I would like a script which color each message in four colors maximum, but i don't see how to do it.

It would be like this example

Can someone help me please ?

Thanks.
« Last Edit: September 12, 2011, 03:27:31 PM by Roseedargent »

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Color script (4 colors maximum)
« Reply #1 on: September 12, 2011, 04:36:10 PM »
So you want to set 4 colors, and then divide the colors across the message, so it fades from one to another?

Would have to see how long the message is, and then divide it into 4 pieces, and add the color code to each piece.

Are you wanting to run this for yourself, when you type it?  For instance, using your own command , like:

/colorize This is a test message to colorize ??
« Last Edit: September 12, 2011, 04:37:44 PM by Snerf »
The IceChat God

Roseedargent

  • Guest
Re: Color script (4 colors maximum)
« Reply #2 on: September 12, 2011, 05:41:50 PM »
I want the colors to be set equally and automatically for whichever text i type without having to use a command, to be able to bypass colors if my text starts with "!" or if i use commands, and that others can also see the colors.

I hope it's possible to have a script like this in icechat ^^

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Color script (4 colors maximum)
« Reply #3 on: September 12, 2011, 08:52:23 PM »
Of course it is possible.

Here is a start, works pretty good. Paste this into the IceChat Editor and save it as an ICE file (IceChat 5 Script style), not the default ICS file.

You set the colors by setting the color number values, at the beginning of the script. Currenty they are 2,6,12 and 33. Just change those numbers. Starting the text with ! disables it. It also wont work if your text is less then 4 characters long.

Code: [Select]
dim color(3)

color(0)=2
color(1)=6
color(2)=12
color(3)=33

Function OUTTEXT(OutgoingText)
if len(outgoingtext) > 3 AND left(outgoingtext,1) <> "!" AND left(outgoingtext,1) <> "/" then
    x = len(outgoingtext)
    y = int(x / 4)

    newout = ""
    count = 0
    for z = 1 to x step y
        newout = newout & "" & color(count) & mid(outgoingtext, z, y)
        if count < 3 then count = count + 1
    next

    OutGoingText = newout & ""

end if

OutText = OutGoingText
End Function

The IceChat God

Roseedargent

  • Guest
Re: Color script (4 colors maximum)
« Reply #4 on: September 14, 2011, 01:53:27 PM »
When i type numbers in my messages, they aren't posted or just partially.

I prefer to avoid this, so i will use the default color like before.

But thanks for your help ^^

Roseedargent

  • Guest
Re: Color script (4 colors maximum)
« Reply #5 on: September 14, 2011, 03:09:16 PM »
It's the numbers which aren't posted well, not the text.
« Last Edit: September 14, 2011, 03:12:03 PM by Roseedargent »

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Color script (4 colors maximum)
« Reply #6 on: September 14, 2011, 07:51:07 PM »
This is because the color codes are getting mixed with the numbers. If you use color codes that are 2 characters long for all of them, you wont have a problem.
The IceChat God

Roseedargent

  • Guest
Re: Color script (4 colors maximum)
« Reply #7 on: September 16, 2011, 12:02:33 PM »
Thanks, it works ^^

I would also like to know where to add ctrl+b if i want to have bold text and if it's possible to have my text with a white background.

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Color script (4 colors maximum)
« Reply #8 on: September 16, 2011, 06:47:26 PM »
Just add in the codes where you want them.
The IceChat God

Roseedargent

  • Guest
Re: Color script (4 colors maximum)
« Reply #9 on: September 17, 2011, 10:34:27 AM »
Code: [Select]
OutGoingText = "" & newout & ""
I have found where to add ctrl+b.

Code: [Select]
color(0)=14,0
color(1)=13,0
color(2)=13,0
color(3)=14,0

But if i modify this part, i get these error messages.

[15:42:18] -- Script Engine Error:1025:Fin d'instruction attendue: Line #2 -- color(0)=14,0
[15:42:18]  ->> ERROR:modScriptFunctions:Colors.ice:Function:LoadScriptFile: Error Number:1025 : Fin d'instruction attendue

How can i make it right please ?

Thanks.

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: Color script (4 colors maximum)
« Reply #10 on: September 17, 2011, 01:48:48 PM »
You would need to add the color(0) values in quotes.

color(0) = "14,0"
color(1) = "13,0"
color(2) = "12,0"
color(3) = "04,0"

You can add the 04 in there easier now as well, and use single digit color codes with a 0 in front of it.
The IceChat God

Roseedargent

  • Guest
Re: Color script (4 colors maximum)
« Reply #11 on: September 17, 2011, 03:59:36 PM »
There is a little error in your example. It also needs two characters for the background color in order to have numbers posted correctly ^^'

But thanks, it works fine ^^
« Last Edit: September 17, 2011, 04:18:47 PM by Roseedargent »