May 16, 2024, 01:54:08 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


ANSI colors

Started by JoaoAfonso, July 16, 2008, 07:42:24 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

JoaoAfonso

Good evening.

Don't know to whom this information might be useful, but anyway, as I finally figured it out, I will post it here.

I am making a game server (text based game), and players connect to the game using telnet. To have more advantages while playing, players can use other clients rather than the telnet console which comes with every Windows OS. Those clients usually support ANSI colors, and in this way, if I want the server to send colored strings to clients, I should add before each string the following codes (color - code):

Black            CHR$(27)+"[0;30m"
Blue             CHR$(27)+"[0;34m"
Green            CHR$(27)+"[0;32m"
Cyan             CHR$(27)+"[0;36m"
Red              CHR$(27)+"[0;31m"
Purple           CHR$(27)+"[0;35m"
Brown            CHR$(27)+"[0;33m"
Gray             CHR$(27)+"[0;37m"
Dark Gray        CHR$(27)+"[1;30m"
Light Blue       CHR$(27)+"[1;34m"
Light Green      CHR$(27)+"[1;32m"
Light Cyan       CHR$(27)+"[1;36m"
Light Red        CHR$(27)+"[1;31m"
Light Purple     CHR$(27)+"[1;35m"
Yellow           CHR$(27)+"[1;33m"
White            CHR$(27)+"[1;37m"
JoÃÆ'ƒÂÃ,£o Afonso
Viriato
-----------------
Iberia MUD
www.iberiamud.com
iberiamud.com:5900

JoaoAfonso

Tested with telnet windows client itself, and colors also work.
JoÃÆ'ƒÂÃ,£o Afonso
Viriato
-----------------
Iberia MUD
www.iberiamud.com
iberiamud.com:5900