Difference between revisions of "Have outfit"

From Kolmafia
Jump to navigation Jump to search
imported>Bale
m
imported>PhilmASTErpLus
(Added code sample)
Line 17: Line 17:
 
function_description=This function returns true if you have all parts of the outfit {{Pspan|name}} and meet all of the stat requirements to equip it. Only in-game outfits are currently supported, not custom outfits.|
 
function_description=This function returns true if you have all parts of the outfit {{Pspan|name}} and meet all of the stat requirements to equip it. Only in-game outfits are currently supported, not custom outfits.|
  
needscode=yes|
+
 
 +
code1={{CodeSample|
 +
title=Code Sample|
 +
description=The following code will attempt to buy herbs from the [http://kol.coldfront.net/thekolwiki/index.php/The_Hippy_Store The Hippy Store].|
 +
code=<syntaxhighlight>
 +
if ( have_outfit( "Filthy Hippy Disguise" ) )
 +
{
 +
  outfit( "Filthy Hippy Disguise" );
 +
  buy( 1 , $item[ herbs ] );
 +
}
 +
else
 +
  print( "Cannot purchase herbs from the Hippy Store, you junkie." );
 +
</syntaxhighlight>
 +
}}|
  
 
see_also={{SeeAlso|outfit}}|
 
see_also={{SeeAlso|outfit}}|

Revision as of 10:21, 26 June 2010

Function Syntax

boolean have_outfit(string name )

  • name is an outfit to check for

This function returns true if you have all parts of the outfit name and meet all of the stat requirements to equip it. Only in-game outfits are currently supported, not custom outfits.

Code Sample

The following code will attempt to buy herbs from the The Hippy Store.

if ( have_outfit( "Filthy Hippy Disguise" ) )
{
   outfit( "Filthy Hippy Disguise" );
   buy( 1 , $item[ herbs ] );
}
else
   print( "Cannot purchase herbs from the Hippy Store, you junkie." );

CLI Equivalent

The CLI command command "outfit" with the parameter "list" gives information on the in-game outfits you have available (but does not list custom outfits or check for whether the outfit can be equipped).

See Also

outfit()

Special

Note that this function does not check for miscellaneous requirements such as Torso Awaregness.