Difference between pages "Pulls remaining" and "Equipped amount"

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:name|pulls_remaining}}{{
+
{{#vardefine:return_type|int}}
#vardefine:return_type|int}}{{
 
  
FunctionPage|
+
{{FunctionPage|
 
name={{#var:name}}|
 
name={{#var:name}}|
 
function_category=Item Management|
 
function_category=Item Management|
Line 12: Line 11:
 
return_type={{#var:return_type}}|
 
return_type={{#var:return_type}}|
 
return_also={{#var:return_also}}|
 
return_also={{#var:return_also}}|
 +
parameter1={{Param|item|it}}|
 +
p1desc={{Pspan|it}} is the item that will be checked for among your worn gear.|
 
}}|
 
}}|
  
function_description=Returns the number of pulls remaining for the day for characters in-Ronin, or 0 otherwise.|
+
function_description=Returns the amount of a given item currently equipped on your character.|
  
 
code1={{CodeSample|
 
code1={{CodeSample|
 
title=Code Sample|
 
title=Code Sample|
description=The following checks to see if you've forgotten to use up your daily pulls.|
+
description=Checks if you're safe to chat.|
 
code=
 
code=
 
<syntaxhighlight>
 
<syntaxhighlight>
if (pulls_remaining() > 0) {
+
if (equipped_amount($item[sword behind inappropriate prepositions]) == 1)
  print("You still have " + pulls_remaining() + " pulls you can make today.");
+
   abort("You aren't safe to chat!");
} else {
+
</syntaxhighlight>
   print("You're all set on daily pulls.");
+
}}|
}
+
 
</syntaxhighlight>}}|
+
see_also={{SeeAlso|closet_amount|display_amount|item_amount|shop_amount|stash_amount|storage_amount}}|
special=Returns 0 when not logged in.
 
 
}}
 
}}

Revision as of 05:21, 3 March 2010



Function Syntax

int equipped_amount(item it )

  • it is the item that will be checked for among your worn gear.

Returns the amount of a given item currently equipped on your character.

Code Sample

Checks if you're safe to chat.

if (equipped_amount($item[sword behind inappropriate prepositions]) == 1)
   abort("You aren't safe to chat!");

See Also

closet_amount() | display_amount() | item_amount() | shop_amount() | stash_amount() | storage_amount()