Alright, so i have decided to mess around with a proxy and try to make myself an autominer. I have gotten as far as to dropping the items. I am not sure what the problem with it is, weather its the packet structure or the Item ids itself.
EDIT: Totally forgot to mention its for a 5065 binary server.
This is in my PacketHandler, everytime i pick something up, or mine an ore i Add the item to a dictionary, then i check to see if There are more than 19 items, if their are i call my drop method(Obviously).
I created an arraylist containing all the ID that i would like to drop.
Then i loop through every value in the dictionary. If any of them are contained in the list, it sends the drop packet.
And this is my packet, its a lil sketchy, i have NO idea if it correct.
Any help would be appreciated, i have been going at this all day.
EDIT: Totally forgot to mention its for a 5065 binary server.
This is in my PacketHandler, everytime i pick something up, or mine an ore i Add the item to a dictionary, then i check to see if There are more than 19 items, if their are i call my drop method(Obviously).
PHP Code:
C.MyChar.Inventory.Add(I.UID, I);
if (C.MyChar.BotOn == true)
{
if (C.MyChar.Inventory.Count >= 20)
C.MyChar.Drop(I, C.MyChar);
}
break;
}
PHP Code:
public static ArrayList OresToDrop = new ArrayList()
{
(uint)1072010, (uint)1072011, (uint)1072012, (uint)1072013, (uint)1072014,
(uint)1072015, (uint)1072016, (uint)1072017, (uint)1072018, (uint)1072019,
(uint)1072020, (uint)1072021, (uint)1072022, (uint)1072023, (uint)1072024,
(uint)1072025, (uint)1072026, (uint)1072027, (uint)1072028, (uint)1072029,
(uint)1072040, (uint)1072041, (uint)1072042, (uint)1072043, (uint)1072044,
(uint)1072045, (uint)1072046, (uint)1072047, (uint)1072048, (uint)1072049
};
PHP Code:
public void Drop(Struct.ItemInfo D, MyCharacter C)
{
foreach (KeyValuePair<uint, Struct.ItemInfo> Item in C.Inventory)
{
if (OresToDrop.Contains(Item.Value))
{
MyClient.SendToServer(Packets.DropItem(D, C).Get);
Thread.Sleep(1000);
}
}
}
PHP Code:
public static COPacket DropItem(Struct.ItemInfo I, MyCharacter Char)
{
Random Rand = new Random();
byte[] Packet = new byte[28];
COPacket P = new COPacket(Packet);
P.WriteInt16((ushort)(Packet.Length -8));
P.WriteInt16((ushort)(1009));
P.WriteInt32(I.UID);
P.WriteInt16((ushort)(Char.Loc.X - Rand.Next(4) + Rand.Next(4)));
P.WriteInt16((ushort)(Char.Loc.Y - Rand.Next(4) + Rand.Next(4)));
P.WriteInt32(3);
P.WriteInt32((uint)Environment.TickCount);
P.WriteString("TQServer");
return P;
}