EXAMPLE:
Code:
Local $interaction = DllStructGetData($aItemStruct,'Interaction')
...fetches the value for the Iteration as defined when the struct was created. If we read through the struct...
Code:
long id;long agentId;byte unknown1[4];ptr bag;ptr modstruct;long modstructsize;ptr customized;byte unknown2[4];byte type;byte unknown3;short extraId;short value;byte unknown4[2];short interaction;long modelId;ptr modString;byte unknown5[4];ptr NameString;byte unknown6[15];byte quantity;byte equipped;byte unknown7[1];byte slot
...and count the byte offset for each data type as described

, the "Iteration" value is found in offset 40. This means that if we had a POINTER to the item instead of a struct, we can call...
Code:
Local $interaction = MemoryRead($aItemPtr + 40,'short')
...to get the same value. This is fine, and it works.
THE PROBLEM:
I'm trying to programatically figure out the offset (and type) based on the above Struct string, but its not working for ModelID. According to the above method, ModelID is directly after Interaction, meaning an offset of 42, right?
Well its actually 44, and I don't know where the extra 2 bytes have come from - if we added another "byte unknown[2]" in there, then the DllStruct itself would be wrong.
Thanks for reading, any help or explanation on this one would be appreciated!