Zmulan
06-21-2010, 19:12
So we got some nice ppl here with nice knowledge in programming ;)
atm, im making an auto looter.
When I'm trying to open a body I need to convert the position into bytes, im not really sure how i split for example the x coordinate of a waypoint (lets say 33200)
The packet looks like this, (opening body)
packetBuffer[0] = 0x01;
packetBuffer[1] = 0x00;
packetBuffer(2) = 0x82;
packetBuffer[3] = LongToByte(x, 1) //<- is from VB, how to do something similar in C#?
packetBuffer[4] = LongToByte(x, 2)
packetBuffer[5] = LongToByte(y, 1)
packetBuffer[6] = LongToByte(y, 2)
packetBuffer[7] = z
packetBuffer[8] = LongToByte(CorpseID, 1)
packetBuffer[9] = LongToByte(CorpseID, 2)
packetBuffer[10] = LongToByte(StackPos, 1) //stack pos
packetBuffer[11] = LongToByte(BackPacks, 1) //bp pos
I tried something like this, but since im not sure exactly how it work, it didnt turn out very well ;<
buffer[3] = Convert.ToByte(x & 0xFF);
buffer[4] = Convert.ToByte(x >> 8 & 0xFF);
buffer[5] = Convert.ToByte(y >> 16 & 0xFF);
buffer[6] = Convert.ToByte(y >> 24 & 0xFF);
any kind of help appreciated
edit: found out by myself,
but how do i determine the stackpos of the corpse? ;<
the program is sending the right packet (i recorded it with wpe), but still the body doesnt open! If i resend it manually with wpe its opening.
What could be wrong?
do i need to update the containers or something?
atm, im making an auto looter.
When I'm trying to open a body I need to convert the position into bytes, im not really sure how i split for example the x coordinate of a waypoint (lets say 33200)
The packet looks like this, (opening body)
packetBuffer[0] = 0x01;
packetBuffer[1] = 0x00;
packetBuffer(2) = 0x82;
packetBuffer[3] = LongToByte(x, 1) //<- is from VB, how to do something similar in C#?
packetBuffer[4] = LongToByte(x, 2)
packetBuffer[5] = LongToByte(y, 1)
packetBuffer[6] = LongToByte(y, 2)
packetBuffer[7] = z
packetBuffer[8] = LongToByte(CorpseID, 1)
packetBuffer[9] = LongToByte(CorpseID, 2)
packetBuffer[10] = LongToByte(StackPos, 1) //stack pos
packetBuffer[11] = LongToByte(BackPacks, 1) //bp pos
I tried something like this, but since im not sure exactly how it work, it didnt turn out very well ;<
buffer[3] = Convert.ToByte(x & 0xFF);
buffer[4] = Convert.ToByte(x >> 8 & 0xFF);
buffer[5] = Convert.ToByte(y >> 16 & 0xFF);
buffer[6] = Convert.ToByte(y >> 24 & 0xFF);
any kind of help appreciated
edit: found out by myself,
but how do i determine the stackpos of the corpse? ;<
the program is sending the right packet (i recorded it with wpe), but still the body doesnt open! If i resend it manually with wpe its opening.
What could be wrong?
do i need to update the containers or something?