Difference between revisions of "Mall price"

From Kolmafia
Jump to navigation Jump to search
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...)
 
imported>Bale
Line 1: Line 1:
[[int]] [[mall_price( item it )]]
+
[[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.
+
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 some limited 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:
 
For example, if there are 7 Stench Wads priced at 385 meat and 700 priced at 390, the following code:

Revision as of 05:31, 23 April 2009

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 some limited 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()