Im also curious about this. All I can think of is look in the newObjs of the update packet, then compare an objects position to player position to find the closest one.
I am trying to automate the process of placing a bunch of items in a single vault by using the Invswap packet. Also is there a way to get the ObjectTypes for all the items in a vault you are standing over.
This is an example of a succesful Invswap packet that I hooked onto and printed in the console:
359 is the ObjectId of the vault I placed the item in. That is the only value I am having trouble finding.Code:INVSWAP(78) Packet Instance Time => 50684 Position => { X=37.31911, Y=70.5954 } SlotObject1 => { ObjectId=353, SlotId=4, ObjectType=2593 } SlotObject2 => { ObjectId=359, SlotId=0, ObjectType=-1 } Send => True Id => 78
Im also curious about this. All I can think of is look in the newObjs of the update packet, then compare an objects position to player position to find the closest one.
You need to parse the statdata in update/newtick. Make a GameObject dictionary, just like the flash client does, and every update/newtick parse statdata for the id. Then just loop objects, look for vault object type, find closest one, then check the items.
My Vouches
Having an issue with RotMG? Check for the solution here.
Need Realm items? Come to RealmStock!
Accepting PayPal - Bitcoin - Giftcards
Selling ST Sets, Class Top Sets, Life Pots, and much more!
Find it here: MPGH Sales Thread
DonJuan13 (01-28-2017)
Keep in mind that you have to wait 550 milliseconds after switching each item or the server will not let you.
Take a look at the LootHelper plugin for k-relay (you can find the source on ****** easily). You can see how it finds the items in bags, which is the same way you would for vault chests, and you can see how it creates the packet for grabbing that item (which you could reverse for putting something in a vault).
DonJuan13 (01-30-2017)
@059 So I've gotten it mostly working. The only problem is that if I move all the items to the vault slots, then try to move them back the client disconnects. I think it has something to do with the ObjectId's not being updated.
A successful Invswap packet looks something like this:
Then if I try to swap it back with another Invswap packet the ObjectType seems to not be updating for the vault dataCode:Made: INVSWAP(78) Packet Instance Time => 1360522 Position => { X=37.48363, Y=70.27171 } SlotObject1 => { ObjectId=353, SlotId=4, ObjectType=2592 } SlotObject2 => { ObjectId=359, SlotId=0, ObjectType=-1 } Send => True Id => 78
Any clues as to why the ObjectType isn't being updated? Do I have to wait for an Update/Newtick Packet? Thanks for any adviceCode:Made: INVSWAP(78) Packet Instance Time => 1367834 Position => { X=37.48363, Y=70.27171 } SlotObject1 => { ObjectId=353, SlotId=4, ObjectType=-1 } SlotObject2 => { ObjectId=359, SlotId=0, ObjectType=-1 } Send => True Id => 78
Yes, wait for newtick. In my bot I have it set up like this:
on update:
- add/remove new objects, then parse their statdata
on newtick:
- parse all object statdata
- run the logic for looting (note there's a 500ms speed limit on looting items)
This way, the objects' inventories will be updated before you do anything.
My Vouches
Having an issue with RotMG? Check for the solution here.
Need Realm items? Come to RealmStock!
Accepting PayPal - Bitcoin - Giftcards
Selling ST Sets, Class Top Sets, Life Pots, and much more!
Find it here: MPGH Sales Thread
DonJuan13 (01-30-2017)
@059 Thanks for your help so far. Sorry for bombarding you with such simple questions.
It mostly works now, but disconnects after about 16-24 Inventory swaps. My guess is that the way I am implementing it, I don't wait for a newtick/update packet before trying to send another packet. However, I do have it wait at least 500ms. You can view my source code here if that helps any?
On another note, what are the "Drops" from the UpdatePacket? Is it just an array of ObjectId's of items that have left the current FoV? Is that what I would use to remove old objects from my dictionary of objects?
Sorry again for all the questions. Cheers.
[Edit] On further thought I now think this is because I am using the same client.Time which is not getting the most recent time and is just using the time from the original packet sent.
Last edited by DonJuan13; 01-30-2017 at 11:28 AM.