Item Management: Difference between revisions
imported>Bale →Informational: r14923 craft_type |
→Acquiring & Using Items: Add clear_booze_helper(), clear_food_helper() |
||
(10 intermediate revisions by 3 users not shown) | |||
Line 8: | Line 8: | ||
{{Flink|boolean|have_bartender|desc=Returns true if you have a bartender-boxen at your campground.}} | {{Flink|boolean|have_bartender|desc=Returns true if you have a bartender-boxen at your campground.}} | ||
{{Flink|int [item]|get_campground|desc=Returns a map of your campground items.}} | {{Flink|int [item]|get_campground|desc=Returns a map of your campground items.}} | ||
{{Flink|int [item]|get_clan_lounge|desc=Returns a map of your Clan VIP Lounge items.}} | |||
{{Flink|item|get_dwelling|desc=Returns the item corresponding with your dwelling.}} | {{Flink|item|get_dwelling|desc=Returns the item corresponding with your dwelling.}} | ||
{{Flink|boolean|have_mushroom_plot|desc=Returns true if and only if you've purchased a mushroom plot this run.}} | {{Flink|boolean|have_mushroom_plot|desc=Returns true if and only if you've purchased a mushroom plot this run.}} | ||
Line 30: | Line 31: | ||
{{Flink|boolean|is_giftable|item|desc=Returns whether the item can be traded in a gift package.}} | {{Flink|boolean|is_giftable|item|desc=Returns whether the item can be traded in a gift package.}} | ||
{{Flink|boolean|is_displayable|item|desc=Returns whether the item can be put in a display case (true for all but quest items).}} | {{Flink|boolean|is_displayable|item|desc=Returns whether the item can be put in a display case (true for all but quest items).}} | ||
{{Flink|boolean|is_discardable|item|desc=Returns whether the item can be discarded or autosold.}} | |||
{{Flink|boolean|have_shop|desc=Returns whether you have a mall store.}} | {{Flink|boolean|have_shop|desc=Returns whether you have a mall store.}} | ||
{{Flink|boolean|have_display|desc=Returns whether you have a display case.}} | {{Flink|boolean|have_display|desc=Returns whether you have a display case.}} | ||
Line 36: | Line 38: | ||
{{Flink|void|refresh_shop|desc=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.}} | {{Flink|void|refresh_shop|desc=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.}} | ||
{{Flink|int|shop_price|item|desc=Returns the current price for the given item if it is present in your mall store.}} | {{Flink|int|shop_price|item|desc=Returns the current price for the given item if it is present in your mall store.}} | ||
{{Flink|int|npc_price|item|desc=Returns the current price of the given item if it can currently be bought from an NPC store.}} | {{Flink|int|npc_price|item|desc=Returns the current price of the given item if it can currently be bought from an NPC store.}} | ||
{{Flink|int|autosell_price|item|desc=Returns the autosell price of the item (0 for items that cannot be autosold).}} | {{Flink|int|autosell_price|item|desc=Returns the autosell price of the item (0 for items that cannot be autosold).}} | ||
{{Flink|int|get_power|item|desc=Returns the power of the item (0 for items that don't have a power).}} | {{Flink|int|get_power|item|desc=Returns the power of the item (0 for items that don't have a power).}} | ||
Line 46: | Line 45: | ||
{{Flink|int [item]|item_drops|{{opt|monster}}|desc=Returns an array of a certain monster's base item drops, keying item to drop rate. Has certain limitations detailed on individual page.}} | {{Flink|int [item]|item_drops|{{opt|monster}}|desc=Returns an array of a certain monster's base item drops, keying item to drop rate. Has certain limitations detailed on individual page.}} | ||
{{Flink|record [int]|item_drops_array|{{opt|monster}}|desc=Returns an array of records holding information regarding a certain monster's base item drops.}} | {{Flink|record [int]|item_drops_array|{{opt|monster}}|desc=Returns an array of records holding information regarding a certain monster's base item drops.}} | ||
===Mall Prices=== | |||
{{FunctionEmbed|historical_age|desc=yes}} | |||
{{FunctionEmbed|historical_price|desc=yes}} | |||
{{FunctionEmbed|mall_price|desc=yes}} | |||
{{FunctionEmbed|mall_prices|desc=yes}} | |||
==Moving Items Around== | ==Moving Items Around== | ||
{{Flink|boolean|empty_closet|desc=Remove every item from the closet in a single server hit.}} | |||
{{Flink|boolean|put_closet|int|{{opt|item}}}} | {{Flink|boolean|put_closet|int|{{opt|item}}}} | ||
{{Flink|boolean|put_display|int|item}} | {{Flink|boolean|put_display|int|item}} | ||
Line 60: | Line 66: | ||
==Acquiring & Using Items== | ==Acquiring & Using Items== | ||
{{Flink|boolean|autosell|int|item|desc=Attempts to autosell the given items and reports success.}} | {{Flink|boolean|autosell|int|item|desc=Attempts to autosell the given items and reports success.}} | ||
{{Flink|boolean|buy|int|item}} | {{Flink|boolean|buy|{{opt|coinmaster}}|int|item}} | ||
{{Flink|int|buy|int|item|int|desc=Tries to purchase the specified items.}} | |||
{{Flink|boolean|buy_using_storage|int|item}} | |||
{{Flink|int|buy_using_storage|int|item|int|desc=Tries to purchase the specified items using meat in Hangks.}} | |||
{{FunctionEmbed|clear_booze_helper|desc=yes}} | |||
{{FunctionEmbed|clear_food_helper|desc=yes}} | |||
{{Flink|boolean|create|int|item|desc=Attempts to create the specified items, following your KoLmafia settings regarding purchases to gather ingredients & require boxen.}} | {{Flink|boolean|create|int|item|desc=Attempts to create the specified items, following your KoLmafia settings regarding purchases to gather ingredients & require boxen.}} | ||
{{ | {{FunctionEmbed|drink|desc=yes}} | ||
{{ | {{FunctionEmbed|eat|desc=yes}} | ||
{{Flink|boolean|eatsilent|int|item|desc=Attempts to eat items as specified.}} | {{Flink|boolean|eatsilent|int|item|desc=Attempts to eat items as specified.}} | ||
{{Flink|boolean|chew|int|item|desc=Attempts to chew spleen items as specified and reports success.}} | |||
{{Flink|boolean|hermit|int|item|desc=Trades worthless items (buying and using chewing gum if needed) to the hermit for specified items (see page for details).}} | {{Flink|boolean|hermit|int|item|desc=Trades worthless items (buying and using chewing gum if needed) to the hermit for specified items (see page for details).}} | ||
{{Flink|boolean|use|int|item|desc=Attempts to use items as specified and reports success.}} | {{Flink|boolean|use|int|item|desc=Attempts to use items as specified and reports success.}} | ||
{{ | {{FunctionEmbed|overdrink|format=signature|desc=yes}} | ||
{{Flink|boolean|retrieve_item|int|item|desc=Uses KoLmafia internal logic to gather items (see page for details).}} | {{Flink|boolean|retrieve_item|int|item|desc=Uses KoLmafia internal logic to gather items (see page for details).}} | ||
{{Flink|int|craft|string|int|item|item|desc=Raw crafting that obeys KoLmafia settings (see page for details).}} | {{Flink|int|craft|string|int|item|item|desc=Raw crafting that obeys KoLmafia settings (see page for details).}} | ||
{{Flink|string|last_item_message|desc=Returns message that KoL reports in the event of error.}} | {{Flink|string|last_item_message|desc=Returns message that KoL reports in the event of error.}} | ||
Line 90: | Line 101: | ||
{{Flink|boolean|buy|coinmaster|int|item|desc=Buys an item from a coinmaster.}} | {{Flink|boolean|buy|coinmaster|int|item|desc=Buys an item from a coinmaster.}} | ||
{{Flink|boolean|sell|coinmaster|int|item|desc=Sells an item to a coinmaster.}} | {{Flink|boolean|sell|coinmaster|int|item|desc=Sells an item to a coinmaster.}} | ||
===Sweet Synthesis=== | |||
{{Flink|item [int]|candy_for_tier|int|{{opt|int}}|desc=Returns all the candy to create a given tier of effect.}} | |||
{{Flink|item [int]|sweet_synthesis_pairing|effect|item|{{opt|int}}|desc=Find a second candy to synthesize.}} | |||
{{Flink|item [int]|sweet_synthesis_pair|effect|{{opt|int}}|desc=Picks a pair of candies to synthesize for an effect.}} | |||
{{Flink|effect|sweet_synthesis_result|item|item|desc=Show result of synthesis.}} | |||
{{Flink|boolean|sweet_synthesis|item|item|desc=Synthesize specified candies.}} | |||
{{Flink|boolean|sweet_synthesis|effect|{{opt|int}}|desc=Picks a pair of candies and synthesizes them for the effect.}} | |||
[[Category:Scripting]] | [[Category:Scripting]] |
Latest revision as of 14:26, 13 July 2021
Informational
int my_meat()
int my_closet_meat()
boolean have_chef()
boolean have_bartender()
int [item] get_campground()
int [item] get_clan_lounge()
item get_dwelling()
boolean have_mushroom_plot()
string item_type( item )
int [item] get_shop()
int [item] get_ingredients( item )
string craft_type( item )
int [item] get_inventory()
int [item] get_related( item, string )
boolean is_tradeable( item )
boolean is_giftable( item )
boolean is_displayable( item )
boolean is_discardable( item )
boolean have_shop()
boolean have_display()
boolean is_npc_item( item )
void refresh_stash()
void refresh_shop()
string to_plural( item )
int [item] item_drops( [monster] )
record [int] item_drops_array( [monster] )
Mall Prices
- Returns the age of the price returned by
historical_age()
in days.
- Returns the most recently seen mall price of an item without making a server request.
int mall_price( item )
- Returns the current (lowest) mall price of an item.
int mall_prices( string, string? )
- Updates the mall price for a category of items, and returns the number of items searched.
int mall_prices( boolean [item] )
- Updates the mall price for a set of items, and returns the number of items searched.
Moving Items Around
boolean empty_closet()
boolean put_closet( int, [item] )
boolean put_display( int, item )
boolean put_stash( int, item )
boolean take_closet( int, [item] )
boolean take_display( int, item )
boolean take_stash( int, item )
boolean take_storage( int, item )
If the item parameter is omitted from put_closet() or take_closet(), meat is transferred instead of an item.
boolean put_shop( int, int, [int], item )
boolean take_shop( [int], item )
Acquiring & Using Items
boolean autosell( int, item )
boolean buy( [coinmaster], int, item )
boolean buy_using_storage( int, item )
int buy_using_storage( int, item, int )
- Clears all queued booze helper items.
- Clears all queued food helper items.
boolean create( int, item )
- Attempts to drink the booze item(s).
- Attempts to drink qty of booze.
- Attempts to eat the food item(s).
- Attempts to eat qty of item.
boolean eatsilent( int, item )
boolean chew( int, item )
boolean hermit( int, item )
boolean use( int, item )
boolean overdrink( int, item )
boolean overdrink( item, int? )
- Attempts to drink a given number of item(s), suppressing overdrinking warnings.
boolean retrieve_item( int, item )
int craft( string, int, item, item )
string last_item_message()
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
coinmaster to_coinmaster( string )
boolean is_coinmaster_item( item )
boolean buys_item( coinmaster, item )
int buy_price( coinmaster, item )
boolean sells_item( coinmaster, item )
int sell_price( coinmaster, item )
Coinmaster transactions
boolean is_accessible( coinmaster )
string inaccessible_reason( coinmaster )
boolean visit( coinmaster )
boolean buy( coinmaster, int, item )
boolean sell( coinmaster, int, item )
Sweet Synthesis
item [int] candy_for_tier( int, [int] )
item [int] sweet_synthesis_pairing( effect, item, [int] )
item [int] sweet_synthesis_pair( effect, [int] )
effect sweet_synthesis_result( item, item )
boolean sweet_synthesis( item, item )
boolean sweet_synthesis( effect, [int] )