POL has no direct function to list all of the items on the server and trying to do the set of functions to list everything would likely freeze your server for a while. The best thing you can do is write something that reads items.txt directly.
If you only need to know about the items in the "physical world" reading items.txt is probably the most efficient way to get a count of a specific item. If the item you are counting is equipable you will also need to parse pcequip.txt and npcequip.txt. However if you also want to know if that item exists in bank boxes, backpacks, pouches, bags, crates, barrels, chests, and any other storage area you will also need to parse the storage.txt file as well.
Yukiko wrote: Tue Jul 17, 2018 11:33 am
Yes but when you get my PM you will see you also have to parse the "equip" files as well, pcequip.txt and npcequip.txt.
i just reply , but in my pol in the data file don't match a gold coins (0x0eed)
you will have trouble reading the StorageAreas containers in the plural, ie all areas created to create virtual containers.
in the StorageAreas module there is no function to list these containers.
if you have created some system that when creating a StorageAreas it registers this same name in a datafile it would be possible, to sweep all the containers.
or look for the item that has the virtual container and look for this container in it.
example
a character has a StorageArea container
a boat (new), the old is a normal item, has a StorageArea
The guild pillar has a StorageArea.
taking this problem you just have to look for all the accounts look in their backpacks and then look for the whole map.
If this is a new shard you could have an Create and Destroy script for gold coins. Every time a gold coin is created it would add the amount created to a Global Property and when they are destroyed it would subtract the amount from the Global Property. This would only work for a server that is new.
As far as an existing server I think searching the world data files is the only way to get an accurate count but you will have to write a script to do it.