Difference between revisions of "Get outfits"

From Kolmafia
Jump to navigation Jump to search
imported>Bale
(r12062)
 
imported>Bale
(add code sample)
 
Line 14: Line 14:
 
}}|
 
}}|
  
function_description=This function returns a list of all KoL outfits that the character currently owns and can wear.|
+
function_description=This function returns a list of all KoL outfits that the character currently owns and can wear. This list includes " - No Change - ", "Birthday Suit" and "Your Previous Outfit" even though they aren't exactly KoL outfits.|
needscode=yes|
+
 
 +
code1={{CodeSample|
 +
title=Code Sample|
 +
description=The following code will print the list of all currently equippable KoL outfits.|
 +
code=<syntaxhighlight>
 +
foreach x, outfit_name in get_outfits()
 +
  if( outfit_name != " - No Change - " && outfit_name != "Birthday Suit" && outfit_name != "Your Previous Outfit" )
 +
      print( outfit_name );
 +
</syntaxhighlight>
 +
}}|
 
cli_equiv=The CLI command <code> outfit list </code> will print the same list in the CLI.|
 
cli_equiv=The CLI command <code> outfit list </code> will print the same list in the CLI.|
  

Latest revision as of 01:24, 25 November 2014

Function Syntax

string [int] get_outfits()

This function returns a list of all KoL outfits that the character currently owns and can wear. This list includes " - No Change - ", "Birthday Suit" and "Your Previous Outfit" even though they aren't exactly KoL outfits.

Code Sample

The following code will print the list of all currently equippable KoL outfits.

foreach x, outfit_name in get_outfits()
   if( outfit_name != " - No Change - " && outfit_name != "Birthday Suit" && outfit_name != "Your Previous Outfit" )
      print( outfit_name );

CLI Equivalent

The CLI command outfit list will print the same list in the CLI.

See Also

have_outfit() | outfit_pieces() | is_wearing_outfit() | get_custom_outfits()