Page 1 of 1

How do I only count items with a certain quality?

Posted: Mon Nov 04, 2024 6:55 am
by Yemto
Pretty much what the title says. I noticed that when I use get_item_count It does not factor in quality, so when I want to try and count all uncommon pipe, I get all pipes in the inventory, not just the uncommon one.

Re: How do I only count items with a certain quality?

Posted: Mon Nov 04, 2024 12:04 pm
by LCStark
What are you using the `get_item_count()` on? `LuaInventory` defines `get_item_count()` with a parameter `item::ItemWithQualityID?`, so you can easily filter by quality:
11-04-2024, 13-07-37.png
11-04-2024, 13-07-37.png (155.8 KiB) Viewed 163 times

Re: How do I only count items with a certain quality?

Posted: Mon Nov 04, 2024 2:25 pm
by Yemto
I did it directly on LuaPlayer. When I changed it so I get the inventory before calling get_item_count then it works like it should. Thank you so much