I've looked around and I couldn't find the item count, I found the item stack count though...
Does anyone know how to get the count?
I've looked around and I couldn't find the item count, I found the item stack count though...
Does anyone know how to get the count?
"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - Martin Golding
"I cried a little earlier when I had to poop" - Sku
stackcount returns the max count that a stack has not the current =\
He meant make a counter that increases by 1 for each object with the same name in your bags. When you finally parse through all objects, it will tell you how many you have.
Each object represents one stack so counting the objects will give me how much stacks I've got in my inventory...
I want to know how much I've got in one stack (e.g. 17 bright baubles or something like that).
Or MySQL-based:Code:struct { int id, int num } itemstack; for <all objects> { increase itemstackvector where id == object_item_id }
Code:CREATE TABLE itemstacks (ID INT UNIQUE PRIMARY KEY, num INT); _for <all objects>: INSERT INTO itemstacks (ID, num) VALUES (object_item_id,object_item_count) ON DUPLICATE KEY UPDATE num=num+object_item_count;
it isn't what I ment...
I want something like GetItemCount
Atleast try the code people give you...
The ITEM_FIELD_STACK_COUNT descriptor does not contain the "maximum stack amount" as you say, it contains the current number of items in that stack for that item in the list. If you would just have done a quick dump you would have seen this.
Lets say I have 3 stacks of Silverleaf in my bags, last stack is only 17 (so I have 57 Silverleaf) A dump could look like this:
Item Silverleaf found, stackcount: 20
Item Silverleaf found, stackcount: 20
Item Silverleaf found, stackcount: 17
Item Swifthistle found, stackcount: 14
Now, just iterate through the list and add the stackcount of each Silverleaf object to a counter, voila "getItemCount"
"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - Martin Golding
"I cried a little earlier when I had to poop" - Sku
I wouldn't have say that is the maximum stack without checking it before...
Maybe I've the wrong address for it and if so I'm sorry for bothering you.
Code:ITEM_FIELD_STACK_COUNT = 0x20
"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - Martin Golding
"I cried a little earlier when I had to poop" - Sku
I've got mine straight from wowx but I'll try your
The descriptor value you use will depend on whether your enum is pre or post multiplication, and whether your enums are generated using inheritance.
Keep that in mind at all times and be consistent.
I use wowx frameworks so it uses inheritance and multiplication...
The sticky should be multiple by 4 right?
Last edited by Nesox; 12-28-2008 at 06:07 PM.
Thanks...![]()