Results 1 to 8 of 8

Thread: Getting Mall category of arbitrary items

  1. #1
    Senior Member
    Join Date
    Apr 2018
    Posts
    319

    Default Getting Mall category of arbitrary items

    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Ē).

  2. #2
    Senior Member ckb's Avatar
    Join Date
    Mar 2006
    Posts
    921

    Default

    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
    	};

  3. #3
    Senior Member
    Join Date
    Apr 2018
    Posts
    319

    Default

    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 by Saklad5; 02-13-2019 at 06:49 PM.

  4. #4

    Default

    You might be the first person to care about that. So no, the information does not exist anywhere.

  5. #5
    Senior Member Crowther's Avatar
    Join Date
    Nov 2006
    Posts
    1,487

    Default

    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.
    Originally Posted by Saklad5 View Post
    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.

  6. #6
    Senior Member ckb's Avatar
    Join Date
    Mar 2006
    Posts
    921

    Default

    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.
    Originally Posted by Saklad5 View Post
    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.

  7. #7
    Senior Member
    Join Date
    Apr 2018
    Posts
    319

    Default

    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.
    Originally Posted by Crowther View Post
    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 by Saklad5; 02-15-2019 at 09:13 PM.

  8. #8
    Senior Member
    Join Date
    Apr 2018
    Posts
    319

    Default

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •