| View previous topic :: View next topic |
| Author |
Message |
Branden Halfop
Joined: 04 Aug 2007 Posts: 61
|
Posted: Sun Oct 21, 2007 4:07 pm Post subject: Colors |
|
|
Hi there everyone.
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 |
|
 |
nml375 Revered One
Joined: 04 Aug 2006 Posts: 2857
|
Posted: Sun Oct 21, 2007 4:27 pm Post subject: |
|
|
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 |
|
 |
Branden Halfop
Joined: 04 Aug 2007 Posts: 61
|
Posted: Sun Oct 21, 2007 4:44 pm Post subject: |
|
|
Uhm...
I'm a noob...
HUH?!?! lol
sorry..
Can you show me an example? |
|
| Back to top |
|
 |
iamdeath Master

Joined: 11 Feb 2005 Posts: 323 Location: *HeLL*
|
Posted: Sun Oct 21, 2007 8:09 pm Post subject: |
|
|
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 |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
|
| Back to top |
|
 |
|