Mall price

From Kolmafia
Revision as of 05:30, 23 April 2009 by imported>Bale (New page: int mall_price( item it ) Returns the current mall price of the given item. Specifically it returns the price of the 5th item that would be purchased. Hopefully this will skip ove...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

int mall_price( item it )

Returns the current mall price of the given item. Specifically it returns the price of the 5th item that would be purchased. Hopefully this will skip over limit 1 items and give you useful data. If items are purchased mall_price is automatically increased to the price of the new 5th item.

For example, if there are 7 Stench Wads priced at 385 meat and 700 priced at 390, the following code:

 print("stench wad price: "+ mall_price($item[stench wad]));
 buy(5, $item[stench wad]);
 print("stench wad price: "+ mall_price($item[stench wad]));
 buy(5, $item[stench wad]);
 print("stench wad price: "+ mall_price($item[stench wad]));

Will yield this output:

 Searching for "stench wad"...
 stench wad price: 385
 Searching for "stench wad"...
 Purchasing stench wad (5 @ 385)...
 You acquire stench wad (5)
 Purchases complete.
 stench wad price: 390
 Using cached search results for stench wad...
 Purchasing stench wad (2 @ 385)...
 You acquire stench wad (2)
 Purchasing stench wad (3 @ 390)...
 You acquire stench wad (3)
 Purchases complete.
 stench wad price: 390

Notice how mall_price went to 390 before any stench wads were purchased at that price. Magic!

When not logged in, this function returns 0.

See Also:
my_closetmeat() || item_amount()