Getting Mall category of arbitrary items

Saklad5

Member
When making a large number of mall searches (like a modified copy of PriceAdvisor), the best bet seems to be the undocumented mall_prices() function. This function accepts a category of item in the Mall as a raw string, then iterates through every page in the category rather than making any searches. This allows you to get 10 items per server hit.

Is there a way to see the category that an item belongs to? If there isn’t, the only way to consistently find an item without making a server hit for each search is to use mall_prices(“allitems”).
 

ckb

Minion
Staff member
Not sure how you would get this from Mafia, but from StoreManager.java:

Code:
	public static final String[] CATEGORY_VALUES =
	{
		"allitems",	// All Categories
		// Consumables
		"food",		// Food and Beverages
		"booze",	// Booze
		"othercon",	// Other Consumables
		// Equipment
		"weapons",	// Weapons
		"hats",		// Hats
		"shirts",	// Shirts
		"container",	// Back Items
		"pants",	// Pants
		"acc",		// Accessories
		"offhand",	// Off-hand Items
		"famequip",	// Familiar Equipment
		// Usable
		"combat",	// Combat Items
		"potions",	// Potions
		"hprestore",	// HP Restorers
		"mprestore",	// MP Restorers
		"familiars",	// Familiars
		// Miscellaneous
		"mrstore",	// Mr. Store Items
		"unlockers",	// Content Unlockers
		"new",		// New Stuff
	};
 

Saklad5

Member
I already pulled all of that from the source code of the webpage. My concern is that a lot of items don’t cleanly fall into a given category. Are items that act as accessories guaranteed to be under “acc”, even if they are also Mr. Store Items or unlock content?

And what about content that doesn’t fall into any category? What category do tiskets fall under, if any? If my script ends up searching a category that doesn’t contain the item it is looking for at the moment, it could go into an endless loop of countless server hits.
 
Last edited:

Crowther

Active member
If my script ends up searching a category that doesn’t contain the item it is looking for at the moment, it could go into an endless loop of countless server hits.
Then I suggest you be much more careful about how you write your scripts. Also, server hits is only a proxy for server load, in some cases it might not be very accurate. Over my time on KoL, I've seen the account of multiple mall bots go disabled without warning. I'd suggest you be very careful.
 

ckb

Minion
Staff member
If my script ends up searching a category that doesn’t contain the item it is looking for at the moment, it could go into an endless loop of countless server hits.

If you use mall_prices("catagory") only once, then mall_price(item) will not to a server hit if historical_age(item) < 1.0
(I think, or something like that).

Either way, using these functions I would think you could intelligently write a script to do mall searches without infinite server hits.
 

Saklad5

Member
Then I suggest you be much more careful about how you write your scripts. Also, server hits is only a proxy for server load, in some cases it might not be very accurate. Over my time on KoL, I've seen the account of multiple mall bots go disabled without warning. I'd suggest you be very careful.
My current strategy is a combination of historical_age and mall_prices: I use mall_prices(“allitems”) if the price is too old, and since that updates the price of all items, it won’t run again for quite a while. If I used any specific category, the scenario I’ve outlined above could occur. It probably wouldn’t be an infinite loop, but it would still be very bad.

I can’t really justify that approach for scripts searching less than like 700 items, of course, and that means it isn’t particularly helpful.
 
Last edited:

Saklad5

Member
I don’t see this being particularly difficult to track, and it would make it much easier to optimize mall searches. For instance, the mall_prices() function introduced in r18937 could search for each item specified or search by category, depending on which approach took fewer server hits. At the moment, it just does individual searches for everything, no matter how many items you specify.
 
Top