Hi all,

as the title reveals, I need some help with my packet structures or if I'm mistaken a poke in the right direction.
Basically what I need is an autohealer using potions, I kinda got the feelin' to use the hotkey packet although I can't get it to work properly.

Is this the correct packet or do I need to send an ItemUseOn packet and read the backpacks for potions ?

Here's my code sofar;

[code=cpp]
BYTE LongToByte(DWORD dwValue, int nCount) {
BYTE ret;
ret = (dwValue >> ((nCount-1)*8)) & 0xFF;
return ret;
}

int drinkPotion(int potion)
{
HMODULE library = LoadLibrary("packet.dll");
int (__stdcall *sendpacket)(unsigned int, unsigned char *);

unsigned char packet[13];
packet[0] = 0x0D;
packet[1] = 0x00;
packet[2] = 0x84;
packet[3] = 0xFF;
packet[4] = 0xFF;
packet[5] = 0x00;
packet[6] = 0x00;
packet[7] = 0x00;
packet[8] = LongToByte(potion, 1);
packet[9] = LongToByte(potion, 2);
packet[10] = 0x10;
packet[11] = LongToByte(player.id, 1);
packet[12] = LongToByte(player.id, 2);

if(!library) return FALSE;
*(FARPROC *)&sendpacket = GetProcAddress(library, "SendPacket");

if(!player.online) {
FreeLibrary(library);
return FALSE;
}

sendpacket(pID, (unsigned char *)packet);
FreeLibrary(library);
return TRUE;
}[/code]