Item Management

From KoLMafia
Jump to: navigation, search

Informational

int my_meat()

Returns the amount of meat you have on hand.

int my_closet_meat()

Returns the amount of meat you have in your Colossal Closet.

int my_storage_meat()

Returns the amount of meat you have in Hagnk's Ancestral Mini-Storage.

int pulls_remaining()

Returns the number of pulls you can make from storage, or 0 if not applicable.

boolean have_chef()

Returns true if you have a chef-boxen at your campground.

boolean have_bartender()

Returns true if you have a bartender-boxen at your campground.

int [item] get_campground()

Returns a map of your campground items.

int [item] get_clan_lounge()

Returns a map of your Clan VIP Lounge items.

item get_dwelling()

Returns the item corresponding with your dwelling.

boolean have_mushroom_plot()

Returns true if and only if you've purchased a mushroom plot this run.

int stills_available()

Returns the number of Nash Crosby's Still uses left for the day (0 if not accessible).

stringitem_type( item )

Returns the type of item specified.

intitem_amount( item )

intcloset_amount( item )

intdisplay_amount( item )

intequipped_amount( item )

intshop_amount( item )

int [item] get_shop()

Returns entire contents of shop and quantity of each item

intstash_amount( item )

intstorage_amount( item )

These 7 functions return the total number available of a given item in the respective section of your inventory.

intavailable_amount( item )

Returns the total number available of a given item in all inventory sections accessible to your character based on current restrictions.

intcreatable_amount( item )

Returns the amount of the item that you are capable of creating given your current inventory and skills.

int [item]get_ingredients( item )

Returns a map where each key is one of the required ingredients, with the integer value the number required. If you don't have the skills needed to make the item, it will return an empty map.

stringcraft_type( item )

Returns a string identifying how an item is crafted and any other requirements for creating it.

int [item] get_inventory()

Returns a map where each key is an item in your inventory, with the integer value its quantity.

int [item]get_related( item, string )

Returns associated items in a zap or fold group (see page for details).
You can categorize items in KoL using is_tradeable(), is_giftable(), and is_displayable().

booleanis_tradeable( item )

Returns whether the item can be placed in the mall.

booleanis_giftable( item )

Returns whether the item can be traded in a gift package.

booleanis_displayable( item )

Returns whether the item can be put in a display case (true for all but quest items).

booleanis_discardable( item )

Returns whether the item can be discarded or autosold.

boolean have_shop()

Returns whether you have a mall store.

boolean have_display()

Returns whether you have a display case.

booleanis_npc_item( item )

Returns whether the item can be bought from an NPC store.

void refresh_stash()

Takes a new look at the contents of your clan stash, as that section of inventory cannot be internally tracked due to access by others.

void refresh_shop()

Takes a new look at the contents of your mall store, as that section of inventory cannot be internally tracked due to access by others.

intshop_price( item )

Returns the current price for the given item if it is present in your mall store.

intmall_price( item )

Returns the current (lowest) mall price of the given item.

intnpc_price( item )

Returns the current price of the given item if it can currently be bought from an NPC store.

inthistorical_price( item )

Returns the most recently checked price for an item. This will never hit the server, unlike mall_price().

floathistorical_age( item )

Returns the age of the most recently checked price for an item in days. This allows you to decide if you want to use historical_price() or mall_price().

intautosell_price( item )

Returns the autosell price of the item (0 for items that cannot be autosold).

intget_power( item )

Returns the power of the item (0 for items that don't have a power).

stringto_plural( item )

Returns the plural of an item as a string.

intmeat_drop( [monster] )

Returns a certain monster's base meat drop.

int [item]item_drops( [monster] )

Returns an array of a certain monster's base item drops, keying item to drop rate. Has certain limitations detailed on individual page.

record [int]item_drops_array( [monster] )

Returns an array of records holding information regarding a certain monster's base item drops.


Moving Items Around

boolean empty_closet()

Remove every item from the closet in a single server hit.

booleanput_closet( int, [item] )

booleanput_display( int, item )

booleanput_stash( int, item )

booleantake_closet( int, [item] )

booleantake_display( int, item )

booleantake_stash( int, item )

booleantake_storage( int, item )

Attempts to take or put the specified item in the appropriate section of your inventory, and returns its success.
If the item parameter is omitted from put_closet() or take_closet(), meat is transferred instead of an item.

booleanput_shop( int, int, [int], item )

booleantake_shop( [int], item )

Adds or removes items in your store and returns success.


Acquiring & Using Items

booleanautosell( int, item )

Attempts to autosell the given items and reports success.

booleanbuy( [coinmaster], int, item )

intbuy( int, item, int )

Tries to purchase the specified items.

booleanbuy_using_storage( int, item )

intbuy_using_storage( int, item, int )

Tries to purchase the specified items using meat in Hangks.

booleancreate( int, item )

Attempts to create the specified items, following your KoLmafia settings regarding purchases to gather ingredients & require boxen.

booleandrink( int, item )

Attempts to drink items as specified and reports success.

booleaneat( int, item )

Attempts to eat items as specified and reports success.

booleaneatsilent( int, item )

Attempts to eat items as specified.

booleanchew( int, item )

Attempts to chew spleen items as specified and reports success.

booleanhermit( int, item )

Trades worthless items (buying and using chewing gum if needed) to the hermit for specified items (see page for details).

booleanuse( int, item )

Attempts to use items as specified and reports success.

booleanoverdrink( int, item )

booleanretrieve_item( int, item )

Uses KoLmafia internal logic to gather items (see page for details).

intcraft( string, int, item, item )

Raw crafting that obeys KoLmafia settings (see page for details).

string last_item_message()

Returns message that KoL reports in the event of error.


Coinmaster Control

Some items can be bought from or sold to various "coinmasters" which are like shops that deal in a currency other than meat. These coinmasters include the Dimemaster and Quartermaster during the Island War, the Hermit, the Mr. Store and many others. Some relevant information can be found in proxy records for the item and coinmaster data types. The rest is controlled by the following functions.

Inquiries

coinmasterto_coinmaster( string )

Converts a string to a valid coinmaster.

booleanis_coinmaster_item( item )

Is a given item acquirable from a coinmster.

booleanbuys_item( coinmaster, item )

Is a specific item acquirable from the named coinmster.

intbuy_price( coinmaster, item )

What is the coinmaster's purchase price for an item.

booleansells_item( coinmaster, item )

Is a specific item sellable to the named coinmster.

intsell_price( coinmaster, item )

What is the coinmaster's selling price for an item.


Coinmaster transactions

booleanis_accessible( coinmaster )

Is a given coinmaster currently accessible.

stringinaccessible_reason( coinmaster )

The reason a given coinmaster is currently inaccessible.

booleanvisit( coinmaster )

Refreshes information at a coinmaster.

booleanbuy( coinmaster, int, item )

Buys an item from a coinmaster.

booleansell( coinmaster, int, item )

Sells an item to a coinmaster.


Sweet Synthesis

item [int]candy_for_tier( int, [int] )

Returns all the candy to create a given tier of effect.

item [int]sweet_synthesis_pairing( effect, item, [int] )

Find a second candy to synthesize.

item [int]sweet_synthesis_pair( effect, [int] )

Picks a pair of candies to synthesize for an effect.

effectsweet_synthesis_result( item, item )

Show result of synthesis.

booleansweet_synthesis( item, item )

Synthesize specified candies.

booleansweet_synthesis( effect, [int] )

Picks a pair of candies and synthesizes them for the effect.