Difference between pages "Put shop" and "Item Management"

From Kolmafia
(Difference between pages)
Jump to navigation Jump to search
imported>StDoodle
m
 
imported>StDoodle
m
 
Line 1: Line 1:
{{
+
{{Flink|int|my_meat|desc=Returns the amount of meat you have on hand.}}
#vardefine:name|put_shop}}{{
+
{{Flink|int|my_closet_meat|desc=Returns the amount of meat you have in your Colossal Closet.}}
#vardefine:return_type|boolean}}{{
+
{{Flink|int|pulls_remaining|desc=Returns the number of pulls you can make from storage, or 0 if not applicable.}}
 +
{{Flink|boolean|have_chef|desc=Returns true if you have a chef-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|boolean|have_mushroom_plot|desc=Returns true if and only if you've purchased a mushroom plot this run.}}
 +
{{Flink|int|stills_available|desc=Returns the number of Nash Crosby's Still uses left for the day (0 if not accessible).}}
 +
{{Flink|int|item_amount|item}}
 +
{{Flink|int|closet_amount|item}}
 +
{{Flink|int|equipped_amount|item}}
 +
{{Flink|int|display_amount|item}}
 +
{{Flink|int|shop_amount|item}}
 +
{{Flink|int|storage_amount|item}}
 +
{{Flink|int|stash_amount|item|desc=Returns the total number available of a given item in the respective section of your inventory.}}
 +
{{Flink|int|available_amount|item|desc=Returns the total number available of a given item in all inventory sections accessible to your character based on current restrictions.}}
 +
{{Flink|boolean|take_storage|int|item}}
 +
{{Flink|boolean|take_closet|int|item}}
 +
{{Flink|boolean|take_stash|int|item}}
 +
{{Flink|boolean|take_display|int|item}}
 +
{{Flink|boolean|put_coset|int|item}}
 +
{{Flink|boolean|put_stash|int|item}}
 +
{{Flink|boolean|put_display|int|item|desc=Attempts to take or put the specified item in the appropriate section of your inventory, and returns its success.}}
 +
{{Flink|boolean|take_closet|int|desc=Attempts to move meat from your closet to on-hand 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|item|}}
 +
{{Flink|boolean|put_shop|int|int|int|item|desc=Puts items in your store (see page for details).}}
  
FunctionPage|
+
'''boolean [[put_shop()|put_shop( int price, int limit, item it )]]''' - places all of the associated [[%28ASHRM%29_Datatype_Constants#.24item.5Bconstant.5D|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.
name={{#var:name}}|
 
function_category=Item Management|
 
  
function1={{Function|
+
'''boolean [[put_shop()|put_shop( int price, int limit, int qty, item it )]]''' - Places qty of the item in the mall store, similar to the above.
name={{#var:name}}|
 
aggregate={{#var:aggregate}}|
 
return_type={{#var:return_type}}|
 
return_also={{#var:return_also}}|
 
parameter1={{Param|int|price}}|
 
parameter2={{Param|int|limit}}|
 
parameter3={{Param|item|it}}|
 
}}|
 
  
function2={{Function|
+
'''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 />
name={{#var:name}}|
+
'''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.
aggregate={{#var:aggregate}}|
 
return_type={{#var:return_type}}|
 
return_also={{#var:return_also}}|
 
parameter1={{Param|int|price}}|
 
parameter2={{Param|int|limit}}|
 
parameter3={{Param|int|qty}}|
 
parameter4={{Param|item|it}}|
 
p1desc={{pspan|price}} is the price to set; using 0 will result in the max-price of 999,999,999 if item is not currently in your store|
 
p2desc={{pspan|limit}} is the limit per player per day, or no limit if set to 0|
 
p3desc={{pspan|qty}} an optional parameter for the quantity of items to put in your shop (defaults to all if not provided)|
 
p4desc={{pspan|it}} is the item to put in your mall store.|
 
}}|
 
  
function_description=Places items in your mall store with settings as described above. Returns true if placement is successful and false if placement fails.</p>
+
'''boolean [[autosell()|autosell( int quantity, item it )]]''' - autosells the given [[%28ASHRM%29_Datatype_Constants#.24item.5Bconstant.5D|items]].
<p>Note that attempting to put an item in your store at less than minimum mall price will automatically reset the price to mall minimum.</p>
 
<p>Note that attempting to put a negative amount of an item in your store will not do anything, but will still return true.</p>
 
<p>Note that you cannot specify a quantity of 0 to change prices, but the function will still return true.|
 
  
code1={{CodeSample|
+
'''int [[autosell_price()|autosell_price( item it )]]''' - returns the autosell price of the [[%28ASHRM%29_Datatype_Constants#.24item.5Bconstant.5D|item]].  Non-discardable items return a negative value.
title=Code Sample|
 
description=The following example will put all of your broken skulls in your mall store for 500 meat at a limit of 5.|
 
code=
 
<syntaxhighlight>
 
put_shop(500 , 5 , $item[broken skull]);
 
</syntaxhighlight>}}|
 
  
see_also={{SeeAlso|have_shop|shop_amount}}|
+
'''boolean [[mall_price()|mall_price( item it )]]''' - returns the current mall price of the given [[%28ASHRM%29_Datatype_Constants#.24item.5Bconstant.5D|item]].
cli_equiv=The CLI command "mallsell" works similarly.|
+
 
}}
+
'''boolean [[retrieve_item()|retrieve_item( int quantity, item it )]]''' - uses KoLmafia internal logic to gather the [[%28ASHRM%29_Datatype_Constants#.24item.5Bconstant.5D|items]] in the least destructive manner. See the &#8220;acquire&#8221; documentation in [http://kolmafia.sourceforge.net/scripting.html the CLI manual] for more details.
 +
 
 +
'''boolean [[hermit()|hermit( int quantity, item it )]]'''<br />
 +
Buys the appropriate number of the given [[%28ASHRM%29_Datatype_Constants#.24item.5Bconstant.5D|item]] from the Hermit, buying hermit permits and adventuring in the sewer for more worthless items if necessary.
 +
 
 +
'''boolean [[use()|use( int quantity, item it )]]'''<br />
 +
'''boolean [[eat()|eat( int quantity, item it )]]'''<br />
 +
'''boolean [[drink()|drink( int quantity, item it )]]'''<br />
 +
Consumes the given [[%28ASHRM%29_Datatype_Constants#.24item.5Bconstant.5D|items]].  These are not interchangeable - food must be consumed with eat(), booze with drink(), and non-foods with use().
 +
 
 +
'''boolean [[create()|create( int quantity, item it )]]''' - attempts to create the specified [[%28ASHRM%29_Datatype_Constants#.24item.5Bconstant.5D|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()|creatable_amount( item it )]]''' - returns the amount of the [[%28ASHRM%29_Datatype_Constants#.24item.5Bconstant.5D|item]] that you are capable of creating with your current inventory and skills.
 +
 
 +
'''int [item] [[get_ingredients()|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|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|is_tradeable( item it )]]''' - returns true if the item can be placed in the mall
 +
 
 +
'''boolean [[is_giftable|is_giftable( item it )]]''' - returns true for tradeable items and gift items like stuffies
 +
 
 +
'''boolean [[is_displayable|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|is_npc_item( item it )]]''' - returns true for all items that can be bought from an NPC store

Revision as of 21:55, 1 March 2010

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 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.

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).

int item_amount( item )

int closet_amount( item )

int equipped_amount( item )

int display_amount( item )

int shop_amount( item )

int storage_amount( item )

int stash_amount( item )

Returns the total number available of a given item in the respective section of your inventory.

int available_amount( item )

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

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 )

Attempts to take or put the specified item in the appropriate section of your inventory, and returns its success.

boolean take_closet( int )

Attempts to move meat from your closet to on-hand and reports success.

boolean put_closet( int )

Attempts to move meat from on-hand to your closet and reports success.

boolean put_shop( int, int, item )

boolean put_shop( int, int, int, item )

Puts items in your store (see page for details).


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