Outfit pieces

From Kolmafia
Revision as of 05:38, 8 February 2011 by imported>Bale (r9018 new function)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Function Syntax

item [int] outfit_pieces(string outfit )

  • outfit is the name of an outfit

This function returns an array of the items which compose an outfit. This works for both KoL standard outfits and custom outfits. If outfit is not a valid outfit, then this will return an empty aggregate.

Code Sample

The following code will determine if you can currently equip a given outfit.

boolean can_equip(string testOutfit) {
   if(count(outfit_pieces(testOutfit)) == 0) {
      print(testOutfit + " is not a valid outfit!", "red");
      return false;
   }
   foreach key,doodad in outfit_pieces(testOutfit)
      if(!can_equip(doodad)) return false;
   return true;
}

See Also

outfit() | have_outfit()