Historical price: Difference between revisions

From Kolmafia
Jump to navigation Jump to search
imported>Eliteofdelete
No edit summary
imported>Relyk
No edit summary
Line 33: Line 33:
    
    
</syntaxhighlight>|
</syntaxhighlight>|
moreinfo=
moreinfo=Historical price is best used for estimates and planning. When purchasing items or putting them into your store, it is better to use mall_price.
Historical price is best used for estimates and planning. When purchasing items or putting them into your store, it is better to use mall_price.
</pre>
}}|
}}|



Revision as of 21:23, 30 January 2015

Function Syntax

int historical_price(item shop_for )

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

Returns the most recently seen mall price of the given item, following the same restrictions as mall_price(). Unlike mall_price() this function will never hit the server. To update to a more recent price you can use mall_price() (if you haven't called it for that item yet this session) or purchase some of shop_for in the mall.

Code Samples

Gives you an estimate of your total mall-worth.

cli_execute("outfit save Backup");
cli_execute("outfit birthday suit");
int[item] inventory = get_inventory();
cli_execute("outfit Backup");
int total;
foreach it in inventory
   total += historical_price(it) * inventory[it];
string amount = to_string(total, "%,d");   
print("The estimated total mall-worth of your inventory is "+amount+" meat.", "blue");

Historical price is best used for estimates and planning. When purchasing items or putting them into your store, it is better to use mall_price.

CLI Equivalent

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

See Also

historical_age() | mall_price()