Difference between pages "Equipped amount" and "Put shop"

From Kolmafia
(Difference between pages)
Jump to navigation Jump to search
imported>StDoodle
m
 
imported>StDoodle
m
 
Line 1: Line 1:
{{#vardefine:name|equipped_amount}}
+
{{
{{#vardefine:return_type|int}}
+
#vardefine:name|put_shop}}{{
 +
#vardefine:return_type|boolean}}{{
  
{{FunctionPage|
+
FunctionPage|
 
name={{#var:name}}|
 
name={{#var:name}}|
 
function_category=Item Management|
 
function_category=Item Management|
Line 11: Line 12:
 
return_type={{#var:return_type}}|
 
return_type={{#var:return_type}}|
 
return_also={{#var:return_also}}|
 
return_also={{#var:return_also}}|
parameter1={{Param|item|it}}|
+
parameter1={{Param|int|price}}|
p1desc={{Pspan|it}} is the item that will be checked for among your worn gear.|
+
parameter2={{Param|int|limit}}|
 +
parameter3={{Param|item|it}}|
 
}}|
 
}}|
  
function_description=Returns the amount of a given item currently equipped on your character.|
+
function2={{Function|
 +
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|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>
 +
<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|
 
code1={{CodeSample|
 
title=Code Sample|
 
title=Code Sample|
description=Checks if you're safe to chat.|
+
description=The following example will put all of your broken skulls in your mall store for 500 meat at a limit of 5.|
 
code=
 
code=
 
<syntaxhighlight>
 
<syntaxhighlight>
if (equipped_amount($item[sword behind inappropriate prepositions]) == 1)
+
put_shop(500 , 5 , $item[broken skull]);
  abort("You aren't safe to chat!");
+
</syntaxhighlight>}}|
</syntaxhighlight>
 
}}|
 
  
see_also={{SeeAlso|closet_amount|display_amount|item_amount|shop_amount|stash_amount|storage_amount}}|
+
see_also={{SeeAlso|have_shop|shop_amount}}|
 +
cli_equiv=The CLI command "mallsell" works similarly.|
 
}}
 
}}

Revision as of 21:12, 8 March 2010

Function Syntax

boolean put_shop(int price ,int limit ,item it )

boolean put_shop(int price ,int limit ,int qty ,item it )

  • 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
  • limit is the limit per player per day, or no limit if set to 0
  • qty an optional parameter for the quantity of items to put in your shop (defaults to all if not provided)
  • it is the item to put in your mall store.

Places items in your mall store with settings as described above. Returns true if placement is successful and false if placement fails.

Note that attempting to put an item in your store at less than minimum mall price will automatically reset the price to mall minimum.

Note that attempting to put a negative amount of an item in your store will not do anything, but will still return true.

Note that you cannot specify a quantity of 0 to change prices, but the function will still return true.

Code Sample

The following example will put all of your broken skulls in your mall store for 500 meat at a limit of 5.

put_shop(500 , 5 , $item[broken skull]);

CLI Equivalent

The CLI command "mallsell" works similarly.

See Also

have_shop() | shop_amount()