Getting outfits

fronobulax

Developer
Staff member
I'm a non-Ascending collector. I have some cool things in my DC that I occasionally pull, use and return. I've scripted that for things where occasionally means Daily but it tends to be manual for less frequent uses. I have noticed that most of my non-Daily items are part of a defined outfit - either one KoL has defined or one I have defined. What I would like would be a kind of get_outfit command that read the outfit definition and pulled any parts that were not in inventory from the DC, closet (regardless of use closet setting) and the clan stash if allowed. It does not have to equip the outfit and it should not purchase or make anything. It either succeeds in getting the parts or reports what's missing. It does not have to worry about returning anything since OCDInventory can do that and DCQuest will identify items that are in inventory but not in the DC.

The hard piece is converting an intrinsic or custom outfit name into a list of the component equipment. Has anyone done that and are willing to share? Is it an interesting FR? Is it a previously rejected FR?

Since I am touching the DC I assume that the rest of the functionality is a niche case but if people might be interested then let me know and I'll share if I ever get something.
 

slyz

Developer
ASH already has
Code:
item [int] outfit_pieces( string )
which works for built-in and custom outfits.

You can add your own get_outfit() function to your scripts:
PHP:
boolean get_outfit( string o )
{ 
	item [int] pieces = o.outfit_pieces();

	if( pieces.count() == 0) abort( "No outfit named " + o );

	foreach i,itm in pieces
	{
		if ( itm.item_amount() + itm.equipped_amount() > 0 ) continue;
		if ( itm.closet_amount() > 0 ) take_closet( 1, itm );
		else if ( itm.display_amount() > 0 ) take_display( 1, itm );
	}

	boolean [ item ] missing;
	foreach i,itm in pieces
	{
		if ( itm.item_amount() + itm.equipped_amount() > 0 ) continue;
		missing[ itm ] = true;
		print( "Missing 1 " + itm, "red" );
	}

	return missing.count() == 0;
}
Or make an alias:
Code:
alias get_outfit => ashq item[int]pieces=outfit_pieces("%%");if(pieces.count()==0)abort("No outfit named "+"%%" );foreach i,itm in pieces{if(itm.item_amount()+itm.equipped_amount()>0)continue;if(itm.closet_amount()>0)take_closet(1,itm);else if(itm.display_amount()>0)take_display(1,itm);}boolean[item]missing;foreach i,itm in pieces{if(itm.item_amount()+itm.equipped_amount()>0)continue;missing[itm]=true;print("Missing 1 "+itm,"red");}return missing.count()==0;
 
Last edited:

fronobulax

Developer
Staff member
ASH already has
Code:
item [int] outfit_pieces( string )
which works for built-in and custom outfits.

Thanks. My wiki searching did not find that and what it did find that was similar seemed to imply it did not work for custom outfits.
 

fronobulax

Developer
Staff member
When you get to a certain age, 2,400 revisions seems like it happened yesterday :)

Woeks fine. Thank you.
 
Top