Item Management: Difference between revisions
imported>StDoodle mNo edit summary |
imported>StDoodle mNo edit summary |
||
Line 25: | Line 25: | ||
{{Flink|boolean|put_closet|int|desc=Attempts to move meat from on-hand to your closet and reports success.}} | {{Flink|boolean|put_closet|int|desc=Attempts to move meat from on-hand to your closet and reports success.}} | ||
{{Flink|boolean|put_shop|int|int|{{opt|int}}|item|desc=Puts items in your store (see page for details).}} | {{Flink|boolean|put_shop|int|int|{{opt|int}}|item|desc=Puts items in your store (see page for details).}} | ||
{{Flink|boolean|buy|int|item|desc= | {{Flink|boolean|buy|int|item|desc=Attempts to buy the specified item, checking NPC stores first, then mall if available, and reports success.}} | ||
{{Flink|int|buy|int|item|int|desc= | {{Flink|int|buy|int|item|int|desc=Tries to buy the given amount of items at or below your specified price, and returns the number purchased.}} | ||
'''boolean [[buy()|buy( int quantity, item it )]]''' - tries to buy the specified [[%28ASHRM%29_Datatype_Constants#.24item.5Bconstant.5D|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.<br /> | '''boolean [[buy()|buy( int quantity, item it )]]''' - tries to buy the specified [[%28ASHRM%29_Datatype_Constants#.24item.5Bconstant.5D|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.<br /> | ||
'''int [[buy()|buy( int quantity, item it, int price_limit )]]''' - tries to buy the specified number of [[%28ASHRM%29_Datatype_Constants#.24item.5Bconstant.5D|items]] at or below the specified price. Returns the number of items successfully purchased, which may be 0 if your limit is too low. | '''int [[buy()|buy( int quantity, item it, int price_limit )]]''' - tries to buy the specified number of [[%28ASHRM%29_Datatype_Constants#.24item.5Bconstant.5D|items]] at or below the specified price. Returns the number of items successfully purchased, which may be 0 if your limit is too low. |
Revision as of 23:22, 1 March 2010
int my_meat()
int my_closet_meat()
boolean have_chef()
boolean have_bartender()
int [item] get_campground()
boolean have_mushroom_plot()
boolean take_storage( int, item )
boolean take_closet( int, item )
boolean take_stash( int, item )
boolean take_display( int, item )
boolean put_coset( int, item )
boolean put_stash( int, item )
boolean put_display( int, item )
boolean take_closet( int )
boolean put_closet( int )
boolean put_shop( int, int, [int], item )
boolean buy( int, item )
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