Item Management

From Kolmafia
Revision as of 13:52, 1 March 2010 by imported>StDoodle
Jump to navigation Jump to search

Part 2 - Item management

Now we'll expand our focus to include some of your special "me-places" in the Kingdom and how to play with them.

int my_meat() - returns your current meat in inventory.
int my_closetmeat() - returns the amount of meat currently in your Colossal Closet (doesn't exist, code is included).

int pulls_remaining() - if you are in Ronin, returns the number of additional items that you can remove from Ancestral Storage today.

boolean have_chef() - returns true if you have a chef-in-the-box installed in your campground.
boolean have_bartender() - returns true if you have a bartender-in-the-box installed in your campground.
int [item] get_campground() - returns a mapping from items to integers (the integer can only be 1 for most items, but can be as high as 9 for pretty bouquets and fences). There are a few special cases for campground items that don't correspond directly to an inventory item: having Really Good Feng Shui is represented by the item "Feng Shui for Big Dumb Idiots", having a pagoda is represented by "pagoda plans", and the ground (having no housing) is represented by a "big rock" for lack of anything more appropriate.


boolean have_mushroom_plot() - returns true if you have purchased the mushroom plot in Degrassi Knoll.

int stills_available() - returns the number of transformations you can make at Nash Crosby's Still today (or 0 if you have no access).

int item_amount( item )
int closet_amount()|closet_amount( item it )
int equipped_amount( item )
int display_amount( item )
int shop_amount( item it )
int storage_amount( item it )
int stash_amount( item it )
Returns the amount of the given item in (respectively) your main inventory, your Colossal Closet, your equipped gear, your Display Case, your Mall store, Hagnk's Ancestral Storage, your clan’s stash, and (to the degree that you have access to these locations). (Sample:Collect_bounty)
int available_amount( item it ) - returns the amount of the given item in inventory, closet (even if you've turned off the closet as a source of ingredients), and equipment (including your current familiar's item, but not items still equipped on other familiars - that's arguably a bug). If you're out of hardcore/Ronin, it also counts items in Hagnk's.

boolean take_storage( int quantity, item it )
boolean take_closet( int quantity, item it )
boolean take_stash( int quantity, item it )
boolean take_display( int quantity, item it )
boolean put_closet( int quantity, item it )
boolean put_stash( int quantity, item it )
boolean put_display( int quantity, item it )
Attempts to move the desired number of the desired item into or out of the Colossal Closet, Ancestral Storage, or your clan’s stash. The return value indicates the success of your endeavor. If you have fewer than the desired number of the item, then the function will not place any. (Sample:Collect_bounty)

boolean take_closet( int amount ) - removes amount meat from your closet.
boolean put_closet( int amount ) - places amount meat in your closet.

boolean put_shop( int price, int limit, item it ) - places all of the associated item into your mall store at the desired price and with the associated limit on purchases per day, if possible. If the price is set to 0, then the current price will remain unchanged if you already have that item in your store. If you do not already have that item in your store and if the price is set to 0, then the price set will be 999,999,999 meat.

boolean put_shop( int price, int limit, int qty, item it ) - Places qty of the item in the mall store, similar to the above.

boolean buy( int quantity, item it ) - tries to buy the specified items. First preference is given to NPC stores that you have access to and then, if possible, will buy the cheapest available items from the mall. When passing 0 or a negative number to the buy function, KoLmafia does nothing and automatically returns true.
int buy( int quantity, item it, int price_limit ) - tries to buy the specified number of items at or below the specified price. Returns the number of items successfully purchased, which may be 0 if your limit is too low.

boolean autosell( int quantity, item it ) - autosells the given items.

int autosell_price( item it ) - returns the autosell price of the item. Non-discardable items return a negative value.

boolean mall_price( item it ) - returns the current mall price of the given item.

boolean retrieve_item( int quantity, item it ) - uses KoLmafia internal logic to gather the items in the least destructive manner. See the “acquire” documentation in the CLI manual for more details.

boolean hermit( int quantity, item it )
Buys the appropriate number of the given item from the Hermit, buying hermit permits and adventuring in the sewer for more worthless items if necessary.

boolean use( int quantity, item it )
boolean eat( int quantity, item it )
boolean drink( int quantity, item it )
Consumes the given items. These are not interchangeable - food must be consumed with eat(), booze with drink(), and non-foods with use().

boolean create( int quantity, item it ) - attempts to create the specified items. Depending on your in-game settings and conditions, this may involve buying ingredients for the items or servants to create the items for you.

int creatable_amount( item it ) - returns the amount of the item that you are capable of creating with your current inventory and skills.

int [item] get_ingredients( item it ) - returns a map where each item key is a known ingredient and each int value is the number of that ingredient required. If you do not have the relevant skill to create the item from the ingredients, returns an empty map.

int [item] get_related( item it , string type ) - type can be either "zap" or "fold". "zap" returns the zap group that the item is part of. The integer values in the map are meaningless in this case, and the item itself isn't included. "fold" returns the fold group that the item is part of. The integer is the position in the fold sequence (1..N), and the item itself IS included, so you can determine its position. Retrieves some variable-length internal data that isn't readily readable via file_to_map().

void refresh_stash() - takes a new look at the contents of your clan stash. Crucial if your clanmates have been manipulating the contents during your session.

boolean is_tradeable( item it ) - returns true if the item can be placed in the mall

boolean is_giftable( item it ) - returns true for tradeable items and gift items like stuffies

boolean is_displayable( item it ) - returns true for all items that can be put in a display case (all items but quest items)

boolean is_npc_item( item it ) - returns true for all items that can be bought from an NPC store