• Welcome to Valhalla Legends Archive.
 

Coloring Battle.net text

Started by Luxer, July 29, 2004, 01:30 PM

Previous topic - Next topic

Luxer

How do I color my battle.net text? I am using the chat gateway, if that means anything..
I asked in Blizzard Tech Support, and all they said was to us ascii characters.

ChR0NiC

#1
Quote from: Luxer on July 29, 2004, 01:30 PM
How do I color my battle.net text? I am using the chat gateway, if that means anything..
I asked in Blizzard Tech Support, and all they said was to us ascii characters.

You gotta use the "Á" letter to initiate the colors then follow it by another letter to specify the color. This is what I have discovered with colors.

"Y" = Red
"U", "P", "T", "U", "V = Light Blue
"S", "Z = Yellow
"V", "R" = Green
"Z" = Magenta
"X", "W" = White
"Q" = Grey (whisper color)


So for example I would type on BNET, (not client).
Quote
ÁYSup ÁUNiGGa

Hope this helps.

Edit: btw this has nothing to do with Bot Development, so it should probably go in the "General" category.

tA-Kane

If you're meaning on a local client that you're developing, you need to do it yourself. Using the "color codes" as other people put it isn't going to work.

I know you're writing your bot with REALbasic, so here's help.

Create an EditField, make sure its Styled property is set to true. I do not beleive its modifiable at runtime, so you should set it in the REALbasic IDE.

After that, here's a simple way of adding text in various colors:Sub AddColoredText(Field As EditField, Text As String, TextColor As Color)
 Field.SelStart = Len(Field.Text)'set the location to the end of the field
 Field.SelTextColor = TextColor'set text color
 Field.SelText = Text'set text
End Sub
Macintosh programmer and enthusiast.
Battle.net Bot Programming: http://www.bash.org/?240059
I can write programs. Can you right them?

http://www.clan-mac.com
http://www.eve-online.com

Luxer

When would color codes work?

ChR0NiC


MyndFyre

Quote from: ChR0NiC on August 01, 2004, 01:10 PM
Quote from: Luxer on August 01, 2004, 11:08 AM
When would color codes work?

WTF? All the time...

No Chr0nic, they wouldn't work all of the time.  As I recall, REALBasic is a Mac equivalent of Visual Basic.

As I recall, the "color codes" information is actually a bug with the way Windows handles UTF-8 encoding.  Thus, color codes would NOT work on a Mac.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

K

Quote from: Myndfyre on August 01, 2004, 02:44 PM
Quote from: ChR0NiC on August 01, 2004, 01:10 PM
Quote from: Luxer on August 01, 2004, 11:08 AM
When would color codes work?

WTF? All the time...

No Chr0nic, they wouldn't work all of the time.  As I recall, REALBasic is a Mac equivalent of Visual Basic.

As I recall, the "color codes" information is actually a bug with the way Windows handles UTF-8 encoding.  Thus, color codes would NOT work on a Mac.

I believe it's a problem with Blizzard's UTF-8 implementation.

ChR0NiC

Quote from: K on August 01, 2004, 02:55 PM
I believe it's a problem with Blizzard's UTF-8 implementation.

Yeah that's what I was thinking, I thought it was a problem in the client, not the OS's event handlers.

Kp

K & Chr0nic are correct.  Blizzard wrote their own implementation of a UTF8 decoder for their games, rather than use the one supplied by the operating system.  As is fairly obvious, the Blizzard one has some bugs.  Thus, it's quite likely the bug will work on a Mac, since I suspect they compiled the same broken code for both Windows and Mac targets.
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

tA-Kane

They probably do work on Blizzard's Mac clients, I don't know... I've never checked. But I do know that they don't work in REALbasic.
Macintosh programmer and enthusiast.
Battle.net Bot Programming: http://www.bash.org/?240059
I can write programs. Can you right them?

http://www.clan-mac.com
http://www.eve-online.com

MyndFyre

Quote from: Kp on August 01, 2004, 04:08 PM
K & Chr0nic are correct.  Blizzard wrote their own implementation of a UTF8 decoder for their games, rather than use the one supplied by the operating system.  As is fairly obvious, the Blizzard one has some bugs.  Thus, it's quite likely the bug will work on a Mac, since I suspect they compiled the same broken code for both Windows and Mac targets.

I stand corrected; I haven't looked into the color codes information much, but I'm relatively certain that I once read that it was a Windows issue.  I could be mistaken though (I'm saying that I read that, not that the information that I read was correct :-P).
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Kp

Quote from: Myndfyre on August 02, 2004, 02:48 AM
Quote from: Kp on August 01, 2004, 04:08 PMK & Chr0nic are correct.  Blizzard wrote their own implementation of a UTF8 decoder for their games, rather than use the one supplied by the operating system.  As is fairly obvious, the Blizzard one has some bugs.  Thus, it's quite likely the bug will work on a Mac, since I suspect they compiled the same broken code for both Windows and Mac targets.
I stand corrected; I haven't looked into the color codes information much, but I'm relatively certain that I once read that it was a Windows issue.  I could be mistaken though (I'm saying that I read that, not that the information that I read was correct :-P).

You might've read someone speculating that the issue only affected clients written for use on Windows.  Bear in mind that my comment about the bug working on Macs is just speculation based on Blizzard's past practices and that I know the issue lies in Blizzard's code, rather than in some system library.
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

Fleet-

I havn't looked hard, but I havn't seen any coding posted public for this yet...so I've decided to release mine for all you beginners. Its simple and quick.



'##################
'##  At the end of your addChat sub put
'##################
If InStr(.Text, "Á") > 0 Then CheckColors

'##################

Private Sub CheckColors()
Dim sOne As String, iOne As Long

With Form1.RTB
Do Until InStr(.Text, "Á") = 0
 iOne = InStr(.Text, "Á"): .SelStart = iOne: .SelLength = 1: sOne = .SelText: .SelStart = iOne - 1: .SelLength = Len(.Text)
 
 Select Case sOne
   Case "R": .SelColor = vbGreen
   Case "P": .SelColor = vbWhite
   Case "S": .SelColor = vbYellow
   Case "T": .SelColor = vbCyan
   Case "Q": .SelColor = &H808080
   Case "V": .SelColor = vbCyan
   Case "U": .SelColor = vbCyan
   Case "Y": .SelColor = vbRed
 End Select
 .SelStart = iOne - 1: .SelLength = 2: .SelText = ""
Loop
End With


End Sub

'###############

Enjoy. This is my own coding, I figured this out myself. So if you use it credit would be appreciated, thanks.

Banana fanna fo fanna

Quick optimization might run checkcolors only on new text added

Fleet-

I'm not sure if that was a suggestion...or what. But it does only run when text is added.