Difference between revisions of "Creatable amount"

From Kolmafia
Jump to navigation Jump to search
imported>StDoodle
imported>StDoodle
Line 1: Line 1:
'''int creatable_amount( item it )'''
+
{{#vardefine:name|creatable_amount}}
<br />Returns the amount of the item that you are capable of creating with your current inventory and skills.
+
{{#vardefine:return_type|int}}
  
<p>Example:
+
{{FunctionPage|
<br /><pre># end-of-ascension scriptlet that tries to create your key lime pies
+
name={{#var:name}}|
boolean create_key_lime_pies()
+
function_category=Item Management|
{
 
  
  item[int] pies;
+
function1={{Function|
  pies[0] = $item[boris's key lime pie];
+
name={{#var:name}}|
  pies[1] = $item[jarlsberg's key lime pie];
+
aggregate={{#var:aggregate}}|
  pies[2] = $item[sneaky pete's key lime pie];
+
return_type={{#var:return_type}}|
  pies[3] = $item[digital key lime pie];
+
return_also={{#var:return_also}}|
  pies[4] = $item[star key lime pie];
+
parameter1={{Param|item|check}}|
 +
p1desc={{Pspan|check}} is the item to inquire about|
 +
}}|
  
  boolean ret = true;
+
function_description=Returns the total number of {{pspan|check}} that you can currently create within the limits of your current inventory, skills, etc.|
  
  foreach i in pies
+
needscode=yes|
  {
 
  
    if (item_amount(pies[i]) < 1)
+
see_also={{SeeAlso|create}}|
    {
+
cli_equiv=The CLI command "create" offers similar information, but on all possibilities at once, when supplied no parameters.|
     
+
}}
      if (creatable_amount(pies[i]) >= 1)
 
      {
 
       
 
        if (!create(1, pies[i])) ret = false;
 
       
 
      }
 
      else
 
      {
 
     
 
        ret = false;
 
     
 
      }
 
     
 
    }
 
 
 
  }
 
 
 
  return ret;
 
 
 
}</pre></p>
 

Revision as of 19:02, 5 March 2010



needs(code_samples);

Function Syntax

int creatable_amount(item check )

  • check is the item to inquire about

Returns the total number of check that you can currently create within the limits of your current inventory, skills, etc.

CLI Equivalent

The CLI command "create" offers similar information, but on all possibilities at once, when supplied no parameters.

See Also

create()