egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Colors

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
Branden
Halfop


Joined: 04 Aug 2007
Posts: 61

PostPosted: Sun Oct 21, 2007 4:07 pm    Post subject: Colors Reply with quote

Hi there everyone. Smile

I'm wondering, how can I add color to the output of a script?

I have the shoutcast script, and want it show certain things in color.

Is this possible?

Please help.
Thanks,
Branden
Back to top
View user's profile Send private message
nml375
Revered One


Joined: 04 Aug 2006
Posts: 2857

PostPosted: Sun Oct 21, 2007 4:27 pm    Post subject: Reply with quote

To add mIRC-style colors, you need to prefix the text with a control-character followed by two comma-separated integers to specify text and background color. You also need to terminate the text with another control-character.

Both control-characters are known as "Ctrl-C", and may be generated using the escape-sequence "\003", or by directly injecting the character if your editor supports it.
_________________
NML_375, idling at #eggdrop@IrcNET
Back to top
View user's profile Send private message
Branden
Halfop


Joined: 04 Aug 2007
Posts: 61

PostPosted: Sun Oct 21, 2007 4:44 pm    Post subject: Reply with quote

Uhm...
I'm a noob...
HUH?!?! lol
sorry..

Can you show me an example?
Back to top
View user's profile Send private message
iamdeath
Master


Joined: 11 Feb 2005
Posts: 323
Location: *HeLL*

PostPosted: Sun Oct 21, 2007 8:09 pm    Post subject: Reply with quote

TEXT DECORATION

It's also possible to decorate your text a little bit.
you can use special codes to underline your text for exmaple. Besides underlining you can also make it bold and give it a color. You use these codes by just putting them between the pieces of text you want decorated.

The code for underlining is \037, the code for bold is \002 and the code for colors is \003 which is followed by the number of the color. The newest versions of mIRC have a nice pop-up box that shows up when you type CTRL+K to make a color. The numbers inside the colors are the same numbers to use here in the color code.

You start and end the places where you want your decoration to start and stop with the same code you started the text decoration with.

For example "Hello \002$nick\002, welcome in $chan." would result in only "$nick" being in bold or "Hello \002\0034$nick\003\002, welcome in \037$chan\037." would result in "$nick" being in bold and in the color red
and "$chan" underlined. Note that when the end of the color decoration is defined only the code itself needs to be specified and not the number of the color, if you specify the number of the color again it would just make the text switch to that color again and not show any difference.

Another Example for color is:

Code:
puthelp "PRIVMSG $nick :\0034Hi, my name is nothing.\003"


That will become like this:

Hi, my name is nothing.

For a list of colors, go to your mIRC and type CTRL + K

Thanks
iamdeath
_________________
|AmDeAtH @ Undernet


Death is only the *Beginning*...
Back to top
View user's profile Send private message Visit poster's website
Alchera
Revered One


Joined: 11 Aug 2003
Posts: 3344
Location: Ballarat Victoria, Australia

PostPosted: Sun Oct 21, 2007 11:26 pm    Post subject: Reply with quote

Colour and formatting codes
_________________
Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber