• Welcome to Valhalla Legends Archive.
 

Parsing the colors

Started by Networks, May 04, 2004, 08:58 AM

Previous topic - Next topic

Eli_1

#45
Quote from: Myndfyre on May 05, 2004, 09:18 PM
Why not just parse the damn thing and rather than using AddChat, make a modified function such as AddC that doesn't append a NewLine to it.  Then when you're done parsing colors, append a NewLine.
That's what the AddText function I posted is.  :D
Quote from: Myndfyre on May 05, 2004, 09:18 PM
You don't need to *replicate* the UTF-8 bug as it is shown in the Blizzard clients -- I suspect that if color lives longer than to the end of the line, people will be happier.
Amen.

Blaze

Can someone please give me an example on how you can "Filter" the colors out?
Quote
Mitosis: Haha, Im great arent I!
hismajesty[yL]: No

Eric

#47
Quote from: Kk)Blaze(kK on May 07, 2004, 09:19 PM
Can someone please give me an example on how you can "Filter" the colors out?

If InStr(Message, "Á") <> 0 Then Exit Sub

hismajesty

LoRd, wouldn't that filter out the entire line? Not just the color codes? I think he wants to filter out _just_ the colors in which case he should use replace them with null strings. I helped him on aim.

Newby

#49
Quote from: hismajesty on May 07, 2004, 09:46 PM
LoRd, wouldn't that filter out the entire line? Not just the color codes? I think he wants to filter out _just_ the colors in which case he should use replace them with null strings. I helped him on aim.
Remove each Á and the corresponding letter after it? o_O
- Newby

Quote[17:32:45] * xar sets mode: -oooooooooo algorithm ban chris cipher newby stdio TehUser tnarongi|away vursed warz
[17:32:54] * xar sets mode: +o newby
[17:32:58] <xar> new rule
[17:33:02] <xar> me and newby rule all

Quote<TehUser> Man, I can't get Xorg to work properly.  This sucks.
<torque> you should probably kill yourself
<TehUser> I think I will.  Thanks, torque.

Blaze

Quote
Mitosis: Haha, Im great arent I!
hismajesty[yL]: No

Eric

Quote from: hismajesty on May 07, 2004, 09:46 PM
LoRd, wouldn't that filter out the entire line? Not just the color codes? I think he wants to filter out _just_ the colors in which case he should use replace them with null strings. I helped him on aim.
Usally, messages containing color codes contain nothing more than pointless spam.

Fr0z3N

Quote from: LoRd[nK] on May 07, 2004, 11:24 PM
Quote from: hismajesty on May 07, 2004, 09:46 PM
LoRd, wouldn't that filter out the entire line? Not just the color codes? I think he wants to filter out _just_ the colors in which case he should use replace them with null strings. I helped him on aim.
Usally, messages containing color codes contain nothing more than pointless spam.

I'd have to agree there.

hismajesty

Quote from: LoRd[nK] on May 07, 2004, 11:24 PM
Quote from: hismajesty on May 07, 2004, 09:46 PM
LoRd, wouldn't that filter out the entire line? Not just the color codes? I think he wants to filter out _just_ the colors in which case he should use replace them with null strings. I helped him on aim.
Usally, messages containing color codes contain nothing more than pointless spam.

So you're going on a 'usually,' it may be just me but I'd rather only filter the color codes instead of the entire line just  in case something isn't pointless.

Eli_1

Make everyone happy and leave color options in your bot settings.  :P

Color settings:
(0)Show colors.
(  )Remove color codes from messages.
(  )Do not show messages containing colors.

Blaze

That is a good idea eli!
Quote
Mitosis: Haha, Im great arent I!
hismajesty[yL]: No

Skywing

Quote from: LoRd[nK] on May 07, 2004, 09:30 PM
Quote from: Kk)Blaze(kK on May 07, 2004, 09:19 PM
Can someone please give me an example on how you can "Filter" the colors out?

If InStr(Message, "Á") <> 0 Then Exit Sub
I don't think that will get all messages.  There are other redundant encodings besides that...

hismajesty

#57
Quote from: Blaze on May 07, 2004, 09:19 PM
Can someone please give me an example on how you can "Filter" the colors out?

Public Function RidColors(ByVal message As String) As String
Dim i As Integer, check() As String, fill As String

fill = "ÁQ, ÁY, ÁZ, ÁV, ÁR, ÁT, ÁS, ÁW, ÁD, ÁG, ÁU"
check() = Split(fill, ", ")

For i = 0 To UBound(check())
   message = Replace(message, check(i), vbNullString)
Next i
RidColors = message
End Function



Edit: In your events that you want to filter out messages call it like so:

RidColors(message)

Networks

Just curious but when sending: ÁQ Hi Hello
Should it be coloring just "hi" or the whole sentence?

Eric

Quote from: Networks on May 10, 2004, 08:58 AM
Just curious but when sending: ÁQ Hi Hello
Should it be coloring just "hi" or the whole sentence?

The whole line providing that you don't have another color code somewhere else on that same line.

|