Difference between revisions of "All normal outfits"

From Kolmafia
Jump to navigation Jump to search
imported>Relyk
(Created page with "{{ #vardefine:name|get_custom_outfits}}{{ #vardefine:return_type|string [int]}}{{ #vardefine:aggregate|yes}}{{ FunctionPage| name={{#var:name}}| function1={{Function| name={...")
 
imported>Relyk
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
{{
 
{{
#vardefine:name|get_custom_outfits}}{{
+
#vardefine:name|all_normal_outfits}}{{
 
#vardefine:return_type|string [int]}}{{
 
#vardefine:return_type|string [int]}}{{
 
#vardefine:aggregate|yes}}{{
 
#vardefine:aggregate|yes}}{{
Line 18: Line 18:
 
code1={{CodeSample|
 
code1={{CodeSample|
 
title=Code Sample|
 
title=Code Sample|
description=The following code will print the list of available outfits.|
+
description=The following code will print the list of available outfits you own and their components.|
 
code=<syntaxhighlight>
 
code=<syntaxhighlight>
 
foreach x,outfit_name in all_normal_outfits()
 
foreach x,outfit_name in all_normal_outfits()
 +
{
 +
  if( have_outfit(outfit_name) )
 
   {
 
   {
      print("Outfit: " + outfit_name);
 
 
       foreach x,piece in outfit_pieces(outfit_name)
 
       foreach x,piece in outfit_pieces(outfit_name)
 
         print("=> " + piece);
 
         print("=> " + piece);
 
   }
 
   }
 +
}
 
</syntaxhighlight>
 
</syntaxhighlight>
 
}}|
 
}}|

Latest revision as of 01:15, 24 September 2015

Function Syntax

string [int] all_normal_outfits()

This function returns a list of all available in-game outfits.

Code Sample

The following code will print the list of available outfits you own and their components.

foreach x,outfit_name in all_normal_outfits()
{
   if( have_outfit(outfit_name) )
   {
      foreach x,piece in outfit_pieces(outfit_name)
         print("=> " + piece);
   }
}

CLI Equivalent

The CLI command outfit list will print a list of official KoL outfits to the CLI.

See Also

have_outfit() | outfit_pieces() | is_wearing_outfit() | get_outfits()