historical_age
Jump to navigation
Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
Function Syntax
float historical_age( item shop_for )
- Returns the age of the price returned by
historical_age()
in days.- shop_for: Item to check for
The return value is in days. For example, a return value of 0.5 means that the price is 12 hours old.
Code Samples
This function returns a price no more than 18 hours old by checking mall_price()
if historical_price()
is older than that.
ASH | JavaScript |
---|---|
1 int check_price( item shopfor ) {
2 if ( historical_age( shopfor ) > .75 )
3 return mall_price( shopfor );
4 return historical_price( shopfor );
5 }
|
1 const { historicalAge, historicalPrice, mallPrice } = require("kolmafia");
2
3 function checkPrice(shopfor) {
4 if (historicalAge(shopfor) > .75)
5 return mallPrice(shopfor);
6 return historicalPrice(shopfor);
7 }
|