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).
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; }
I created an arraylist containing all the ID that i would like to drop.
I'm on my phone now so I have no access to the correct packet structure right now; however, I noticed a couple of stuff.
OresToDrop.Contains(Item.Value)
Item.Value is the ItemInfo struct instance however you should be checking for item IDs so it should be something like OresToDrop.Contains(Item.Value.ID)
I'm not sure if it's called ID but it's NOT UID.
Second, DropItem(D, C) should be DropItem(Item.Value, C)
Third, in the packet struct replace TQServer with TQClient.
Also you should remove the "- R a n d . N e x t ( 4 ) + R a n d . N e x t ( 4 )" part.
I also noticed the packet structure you have is off a private server because of the random part, probably it's wrong anyway. I'll send the correct struct tomorrow.
I'm on my phone now so I have no access to the correct packet structure right now; however, I noticed a couple of stuff.
OresToDrop.Contains(Item.Value)
Item.Value is the ItemInfo struct instance however you should be checking for item IDs so it should be something like OresToDrop.Contains(Item.Value.ID)
I'm not sure if it's called ID but it's NOT UID.
Second, DropItem(D, C) should be DropItem(Item.Value, C)
Third, in the packet struct replace TQServer with TQClient.
Also you should remove the "- R a n d . N e x t ( 4 ) + R a n d . N e x t ( 4 )" part.
I also noticed the packet structure you have is off a private server because of the random part, probably it's wrong anyway. I'll send the correct struct tomorrow.
Thanks so much. Yes that would be great if you could help me when you get access to your PC. I will try some of the things you mentioned, thanks.
I have been recording the id of the same item that i am dropping and picking up and i noticed that sometimes it will be WAY different like its 18072342 and after, say 4 times, it will be like 342765.
This is the way I'm reading the values
I realized that i had the length wrong on my packet so i added the 4 bytes, but it didn't make a difference. So i decided to dump the packet being sent from my command and also the packet(on the same item) being sent from the client seconds later. I noticed that the timestamp was WAYY different (unless i did this wrong).
Could this be why my packet isn't working?
Here is both of the packets without the Auth stamp on the end.
They don't actually send the Item ID, just the Unique ID.
The ID field is used as a union for the coordinates.
I can't explain how your timestamps are madly different, I think I discovered the same thing, soon as I added coordinates though, dropping started to work.
They don't actually send the Item ID, just the Unique ID.
The ID field is used as a union for the coordinates.
I can't explain how your timestamps are madly different, I think I discovered the same thing, soon as I added coordinates though, dropping started to work.
They do send the Item ID, unless its just a VERY weird coincidence where it just so happens to be the same as the ItemID every time.
I'm assuming the server would reject the packet if since the time stamps are soo different? Could that be why its not working? Any way to fix how the problem? I'm trying the jump packet to see if the time stamps are corrected on there.
EDIT:
Here are the results of my Jump packet stamp test.
They do send the Item ID, unless its just a VERY weird coincidence where it just so happens to be the same as the ItemID every time.
Quote:
Originally Posted by StarBucks
I have been recording the id of the same item that i am dropping and picking up and i noticed that sometimes it will be WAY different like its 18072342 and after, say 4 times, it will be like 342765.
Why say that then? It's just a VERY weird coincidence that I can drop item's yet you can't?
They don't check timestamps on an item drop either.
Jeez, you try to help someone here, you get it thrown back in your face.
well looks like you just have the wrong type to be honest. In the logged packets you have it's 0x3F2, in your structure (1009) is 0x3F1.
Also timestamps are checked (now anyways) haydz, not sure if they have to be accurate but if ya dont send one earned yourself a free trip to botjail.
so try type 1010, (not what it is right now but yeah.) currently Item info is 3f0 3f1 is drop.
May have been 3f2 back when your pserver was made.
I have the correct packet type, I decided to try messing with the General packet for jump just to see if the timestamp was actually the reason, it was.
Do you have anyway that i could fix the problem with my timestamp?
[StructLayout(LayoutKind.Explicit)] public struct DwordUnion { [FieldOffset(0)] public uint Value; [FieldOffset(0)] public ushort Low; [FieldOffset(2)] public ushort High; } [StructLayout(LayoutKind.Sequential)] public unsafe struct ItemUsagePacket {
public Header Header; public uint UID; public DwordUnion dwParam; public ItemPacketSub ID; public uint TimeStamp; public uint dwExtraInfo; public fixed sbyte TQPadding[8]; public static ItemUsagePacket Create() { ItemUsagePacket Packet = new ItemUsagePacket { Header = new Header { Size = 24, Type = 1009 }, TimeStamp = (uint)Environment.TickCount }; PacketBuilder.EncodePadding(Packet.TQPadding, "TQClient"); return Packet; } public static ItemUsagePacket Drop(uint UID) { ItemUsagePacket Packet = Create(); Packet.UID = UID; Packet.ID = ItemPacketSub.DropItem;
Seems to work just peachy for me. I'm not sure what is the problem in your code.
EDIT: I noticed the first post, you're writing "TQServer" at the end when it should be "TQClient" because you're sending it to server, perhaps this is the reason it's not working?
Ok, these packets are IDENTICAL except the timestamp(of course). Yet the one im sending from the proxy doesn't work. Can anyone explain to me why this doesn't work? Do i need to send something to the client?
public static COPacket DropItem(Struct.ItemInfo I, uint X, uint Y) { Random Rand = new Random(); byte[] Packet = new byte[0x20]; COPacket P = new COPacket(Packet); P.WriteInt16((ushort)(Packet.Length - 8)); P.WriteInt16((ushort)(0x3F1)); P.WriteInt32(I.UID); P.WriteInt16((ushort)X); P.WriteInt16((ushort)Y); P.WriteInt32(0x03); P.WriteInt32((uint)Environment.TickCount); P.Move(4); P.WriteString("TQClient"); return P; }
EDIT: So, apparently my X and Y cords were backwards so it freakin works now. Now I gotta see if i can get the jump packet to work. I'm freakin stupid.
[Release] Item dropping (for events/gm command) 01/16/2010 - CO2 PServer Guides & Releases - 10 Replies So I was bored and figured I might finish my random event code for 1.0 and in the process realized just how much better alot of what I had could be written so I'm in the process of re-writing it all to use voids, switch and all that good stuff.
During that, for my random drop event I decided to write a little command/void to handle dropping items. This can be used however you wish. Maybe you want a gm command to drop x number of db's in twin city, a random event or anything else you want...
[SEARCH]GM Command for item dropping 08/16/2009 - Dekaron Private Server - 11 Replies I have an own Dekaron private Server(Only4Fun) and a few questions
What is the GM Command to drop an item i chosed?
If i type /GM callmonster 101 (Spider larva) the there is no monster spawning. Why?
Pls help me
Greets Ghosthunter
PS: I have a List with the commands but the most one are not working. I type them and then nothing happens
editing item file for msg at dropping items 07/12/2006 - Conquer Online 2 - 7 Replies Hi, i read about a programm that edits the item dat which changes their priority so it gives you a message , if you wanna drop it (just like meteors have).
i tried to search for that thread but wanst able to find it :/