Mall price: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>StDoodle
imported>StDoodle
No edit summary
Line 1: Line 1:
[[int]] '''mall_price( item it )'''
{{#vardefine:name|mall_price}}
{{#vardefine:return_type|int}}


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.
{{FunctionPage|
name={{#var:name}}|
function_category=Item Management|


For example, if there are 7 Stench Wads priced at 385 meat and 700 priced at 390, the following code:
function1={{Function|
name={{#var:name}}|
aggregate={{#var:aggregate}}|
return_type={{#var:return_type}}|
return_also={{#var:return_also}}|
parameter1={{Param|item|shop_for}}|
p1desc={{Pspan|shop_for}} is the item to inquire on the mall price of|
}}|


<code>
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.|
  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]));
</code>


Will yield this output:
needscode=yes|


<code>
see_also={{SeeAlso|buy|retrieve_item}}|
  Searching for "stench wad"...
cli_equiv=The CLI command "searchmall" also returns current mall prices.|
  stench wad price: 385
special=Items not listed in the mall will return 0. When not logged in, this function returns -1.|
  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
</code>
 
Notice how mall_price went to 390 before any stench wads were purchased at that price. Magic!
[[Category:Your Character | My meat()]]
[[Category:Ash Functions | My meat()]]
 
When not logged in, this function returns -1.
 
<center><table style="width:80%;margin-top:+.7em;background-color:#F4DF3B;border:2px solid #8663A8"><tr>
    <td class="box_tgen" style="text-align:center;color:#000;font-size:90%;border:none;margin: 0;padding:.1em;">
'''See Also:''' <br> [[my_closetmeat()]] || [[item_amount()]]</td>
</tr></table></center>

Revision as of 18:14, 5 March 2010



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. This function runs a new check each time it is called, so if you call this function and then purchase some of shop_for in the mall, calling this function again will return the new price of the item, again ignoring the first five.

CLI Equivalent

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

See Also

buy() | retrieve_item()

Special

Items not listed in the mall will return 0. When not logged in, this function returns -1.