• Welcome to Valhalla Legends Archive.
 
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Archn

#1
Sorry if this was the wrong forum.  :-[  What is the correct place for this?  I just wanted some help with 0x0F as far as if  it could interpret color codes.

There actually is a proxy already in place, and that's why the interaction is already successful (I have successfully created a working bugfree hangman game from the D2 client itself).  But the proxy itself only filters the packets.  So I was just asking since obviously there is color in the chat portion itself, like Red, Green, Light Blue, White, etc. But that for the most part you can only have 1 color per line of text, if there would be a way to have multiple colors.  Like in 0x05 (EID_TALK), it will display white with yellow brackets, on the same line.

So I'm guessing there's not a way to change that without actually patching the D2 client itself?  While keeping in mind that there is a proxy which filters packets.

I can spoof any packets I want, I just can't figure out a way to spoof a packet that writes to the chat screen with multiple color codes.  But if color codes don't exist, and the client itself only understands the color based on the EventId, then color is a waste of my time, I guess.  It's just I'm working on this game called "Rush Hour" (If you google Rush Hour Game, you'll see the game I'm talking about), and it would be much easier to identify the cars, if I could have them in color.  The straight 1 color part of it looks great so far.  I have everything except the park_movecar(int car,int direction) part written.
#2
Quote from: Andy on May 06, 2008, 08:51 PM
Oooookay.... If you're writing a bot yourself, you have to do the color code system yourself, too. The ÿc system is a proprietary syntax started in D2 profiles and implemented in many bots; it's not some form of prewritten standard. If you want color codes, you have to write color codes.

I'm sorry I must have completely forgot my manners.

I am writing a program that works within the D2 window itself which runs interaction between the client and the user.

I.E. I write /joke into the console and it writes "Why did the chicken cross the road".. etc...

And I am talking about BNCS not D2GS, so can I use the color codes here?  And what Chat Event would work best for this?
#3
Hi.  I am trying to get color to display when I receive SID_CHATEVENT..

I understand that certain events display certain colors when you receive them.

Here is the code I have, with help from Leo-X.


void Chat::WriteChat(const char szData[], ... )
{
BYTE Event=0x13;
BYTE Flags=0x00;
BYTE Ping=0x2F;
const char szUser[]="Game On";
char *szText = NewString( 4096 );
va_list arguments;
va_start( arguments, szData );
vsprintf_s( szText, 4096, szData, arguments );
va_end( arguments );

int iUserLen = (int)strlen( szUser ) + 1;
int iTextLen = (int)strlen( szText ) + 1;
int iLen = iUserLen + iTextLen + 24;
unsigned char* szBuffer = new unsigned char[iLen];

DWORD dwPos = 0;

szBuffer[dwPos++] = 0xFF;
szBuffer[dwPos++] = 0x0F; //SID_CHATEVENT
szBuffer[dwPos++] = 0x00 + iLen;
szBuffer[dwPos++] = 0x00 + ( iLen >> 8 );

szBuffer[dwPos++] = 0x00 + Event;
szBuffer[dwPos++] = 0x00;
szBuffer[dwPos++] = 0x00;
szBuffer[dwPos++] = 0x00;

szBuffer[dwPos++] = 0x00 + Flags;
szBuffer[dwPos++] = 0x00;
szBuffer[dwPos++] = 0x00;
szBuffer[dwPos++] = 0x00;

szBuffer[dwPos++] = 0x00 + Ping;
szBuffer[dwPos++] = 0x00;
szBuffer[dwPos++] = 0x00;
szBuffer[dwPos++] = 0x00;

szBuffer[dwPos++] = 0x00 + 0x0D;
szBuffer[dwPos++] = 0x00 + 0xF0;
szBuffer[dwPos++] = 0x00 + 0xAD;
szBuffer[dwPos++] = 0x00 + 0xBA;

szBuffer[dwPos++] = 0x00 + 0x0D;
szBuffer[dwPos++] = 0x00 + 0xF0;
szBuffer[dwPos++] = 0x00 + 0xAD;
szBuffer[dwPos++] = 0x00 + 0xBA;

if( stricmp( szUser, "" ) != 0 && szUser != NULL )
{
for( int i = 0; i < iUserLen; i++ )
{
szBuffer[dwPos++] = szUser[i];
}
}

if( stricmp( szText, "" ) != 0 && szText != NULL )
{
for( int i = 0; i < iTextLen; i++ )
{
szBuffer[dwPos++] = szText[i];
}
}

RecvPacket( (void*) szBuffer, dwPos );

delete[] szBuffer;
DeleteString( szText );
}


And the Events are:


    [0x01] EID_SHOWUSER: User in channel
    [0x02] EID_JOIN: User joined channel
    [0x03] EID_LEAVE: User left channel
    [0x04] EID_WHISPER: Recieved whisper
    [0x05] EID_TALK: Chat text
    [0x06] EID_BROADCAST: Server broadcast
    [0x07] EID_CHANNEL: Channel information
    [0x09] EID_USERFLAGS: Flags update
    [0x0A] EID_WHISPERSENT: Sent whisper
    [0x0D] EID_CHANNELFULL: Channel full
    [0x0E] EID_CHANNELDOESNOTEXIST: Channel doesn't exist
    [0x0F] EID_CHANNELRESTRICTED: Channel is restricted
    [0x12] EID_INFO: Information
    [0x13] EID_ERROR: Error message
    [0x17] EID_EMOTE: Emote


Now the line that says Event=0x13 controls the color.. Like 13 would be red. And 12 is a light blue.  Now I want to be able to do something more than just WriteChat("Hi there");

I'd like to do something like WriteChat("ÿc1Hi ÿc2there");

What chat event allows color and would not display something like <On> before every message I send like

<On> Hi there

I think it said On for some weird reason.. maybe based on the ping?  When I did emote, it was in gray with *'s around it but it still said On in front.

Or is color completely blocked from this packet?

I guess the bottom line is, is it possible to use a colorcode?  I think when I tried on on 0x12, it made the text not display at all.

If you can help I appreciate it.. P.S. this is my first post to vL.

If anyone wants to help me on a cool project let me know.