IRC colors

don'tdoit

Active Member
[00:13] <Amadeus> isxIRC strips all color, bold, and underline codes from incoming messages
Amadeus, stripping incoming stuff is fine, but can we get support to send color messages out? (If it exists, i can't figure it out.)

Reason I'm asking is I have an irc script that connects to a private IRC server. I want him to be able to relay chat information from VG to some channels but i want the text to be a similar color to in game text.

i did this back in the eq1 days with mq2 and mq2telnet along with a custom written perl script and it worked awesomely. I already have the isxirc relay script going, but it's all just black text.
 

Amadeus

The Maestro
Staff member
ISXIRC does not strip anything on sending data to the server. Actually, when sending data to the server, it just uses the winsock send() function.

So, something else is up. Are you sure you're sending color codes properly that your server recognizes?

What commands are you using exactly. Seeing what you're doing would be helpful.
 

don'tdoit

Active Member
Well my script is only sending this right now:

Code:
IRCUser[${MyNick}].Channel[${MyChan1}]:Say["${Text}"]
and that's working fine, coming thru as black as expected.

What I was trying to do was something like this:

Code:
IRCUser[${MyNick}].Channel[${MyChan1}]:Say["\x0310 hello world"]

or

IRCUser[${MyNick}].PM[${MyChan1},"\x0310 hello world"]

or

IRCUser[${MyNick}].SendRaw["PRIVMSG ${MyChan1} \x0310 hello world"]
I don't have the exact results since I'm at work and can't test again, but I can get you exacts tonight. Basically no color comes thru (and some tests no text at all showed up in the channel).

As a comparison, here's a snippet of my perl code that does send color:

Code:
use Net::IRC;

...blah blah, lotso stuff here...

		} else {
			$irc_chan = $irc_chan1;
			$colorline = "\x031 $line";
		}

		$irc_conn->privmsg( $irc_chan, $colorline );
 

Amadeus

The Maestro
Staff member
I don't know what to tell you. Like I said, both of those messages use the winsock send() function which just sends bytes through the socket with no modification at all.

You could look up send() on msdn.com and see if they have anything there that would lead you to believe that I should make some sort of concession for escape characters; however, I think they're pretty standard.

However, what you're typing DOES go through innerspace. You might want to ask lax if IS would modify those escape codes ...show it to him. If I get time I'll test it myself to see if IS does modify it before it's sent.
 

don'tdoit

Active Member
I'm not positive, but I do think it has something to do with escape codes.

You can see some really interesting stuff if you change the number of slashes before the x0310. Sometimes there's no output, sometimes the output is just a (black text) \x0310, or x0310, and sometimes the x changes to a totally different character (a, f, etc, etc) while the 0310 stays the same.

I'll get with Lax and have him look at this thread to get his input as well.

Thanks for looking into it...
 

Lax

LavishSoft/InnerSpace Guru
Just talked to him in IRC, the only thing LavishScript would do to it is in fact with the escape character. \\x is required to do a \x literal.

IRCUser[${MyNick}].Channel[${MyChan1}]:Say["\\x0310 hello world"]
should produce literally "\x0310 hello world"

I guarantee that the same thing done like this:
UIElement[output@console]:Echo["\\x0310 hello world"]
done an infinite number of times, will produce that literal sequence in the console every time, and this even eliminates any potential complaint about using a command (echo) versus using an object method.
 

don'tdoit

Active Member
Playing with it right now. If I use an even number of slashes (\), then I get the literal output in my mIRC client:
Code:
IRCUser[${MyNick}]:PM[${MyChan3},"\\x031 hi"]

produces:
[16:22] <dont2> \x031 hi

IRCUser[${MyNick}]:PM[${MyChan3},"\\\\x031 hi"]

produces:
[16:22] <dont2> \\x031 hi
If I use an odd number of slashes, results are odd:
Code:
1 slash:
IRCUser[${MyNick}]:PM[${MyChan3},"\x031 hi"]

produces no output.

3 slashes:
IRCUser[${MyNick}]:PM[${MyChan3},"\\\x031 hi"]

produces:
[16:26] <dont2> \1 hi

5 slashes:
IRCUser[${MyNick}]:PM[${MyChan3},"\\\\\x031 hi"]

produces:
[16:27] <dont2> \\
The more you go, the more the result changes with unexpected results (\\\\n031). If you use a different color code (x0310, x0314, etc) you get different results as well in all ranges of odd numbers. Except 1 slash, which always produces no result.
 
Top Bottom