Mall price: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>PhilmASTErpLus
A bit of information about untradeable items.
imported>Slyz
mall-price() does only one mall search per item per session
Line 15: Line 15:
}}|
}}|


function_description=Returns the current mall price of the given item, ignoring the first five items listed to compensate for stores with limits and min-priced sales. This function runs a new check each time it is called, so if you call this function and then purchase some of {{pspan|shop_for}} in the mall, calling this function again will return the new price of the item, again ignoring the first five.|
function_description=Returns the current mall price of the given item, ignoring the first five items listed to compensate for stores with limits and min-priced sales. To prevent abuse, this will only perform an actual Mall search once per item per session; subsequent calls for the same item will return a cached value. The cache will be updated after attempts to purchase the item (even unsuccessful ones), but not in any other conditions.|


needscode=yes|
needscode=yes|

Revision as of 14:06, 24 May 2011

needs(code_samples);

Function Syntax

int mall_price(item shop_for )

  • shop_for is the item to inquire on the mall price of

Returns the current mall price of the given item, ignoring the first five items listed to compensate for stores with limits and min-priced sales. To prevent abuse, this will only perform an actual Mall search once per item per session; subsequent calls for the same item will return a cached value. The cache will be updated after attempts to purchase the item (even unsuccessful ones), but not in any other conditions.

CLI Equivalent

The CLI command "searchmall" also returns current mall prices.

See Also

historical_price() | buy() | retrieve_item()

Special

Items not listed in the mall will return 0 (untradeable items will return 0 without any server requests). When not logged in, this function returns -1.