Retrieve price

From Kolmafia
Revision as of 22:01, 27 December 2022 by Taltamir (talk | contribs) (Created page with "{{ #vardefine:name|retrieve_price}}{{ #vardefine:return_type|int}}{{ FunctionPage| name={{#var:name}}| function1={{Function| name={{#var:name}}| aggregate={{#var:aggregate}}...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Function Syntax

int retrieve_price(item get )

  • get is the item to acquire

int retrieve_price(item get ,int qty )

  • get is the item to acquire
  • qty is the quantity to acquire

int retrieve_price(int qty ,item get )

  • qty is the quantity to acquire
  • get is the item to acquire

int retrieve_price(item get ,int qty ,boolean exact )

  • get is the item to acquire
  • qty is the quantity to acquire
  • exact if true will perform new mallsearch to make sure the price is exact

int retrieve_price(int qty ,item get ,boolean exact )

  • qty is the quantity to acquire
  • get is the item to acquire
  • exact if true will perform new mallsearch to make sure the price is exact

Returns the total meat cost of using retrieve_item. This does include the mall value of items you already own.

Code Sample

This is an example of a very simple aftercore logout script.

item nightcap = $item[ Mon Tiki ];
int price = retrieve_price(nightcap);
if(price > 30000)
  abort( nightcap+ " is unreasonably expensive. It costs " +price );
if(my_inebriety() == inebriety_limit())
{
   if ( !retrieve_item( nightcap ) )
      abort( "Could not make/buy a " + nightcap + " for a nightcap." );
   else
      overdrink( 1 , nightcap );
}

CLI Equivalent

?

See Also

retrieve_item() | buy()