Feature Terrarium equipment handling

Fluxxdog

Active member
KoLmafia has no way to directly handle equipment held in the terrarium through ASH or CLI. All it has is a function to see what a familiar has (familiar_equipped_equipment(familiar f)).

Some possible ideas:

boolean unequip(familiar f) - Removes any equipment from the selected familiar (true if no problems)
int[item] terrarium_contents() - Map of currently equipped items in the terrarium
boolean clean_terrarium(boolean genericsOnly) - Removes any equipment from all familiars (true if no problems)
genericsOnly = true - Only generic equipment, like the Snow Suit, is retrieved, leaving familiars with their own specialized equipment
genericsOnly = false - All equipment, regardless of generic
I'm sure others have ideas for access or information.

URL for unequipping familiar xxx (where xxx is the familiar number). 'ajax' is needed due to a KoL bug (see here for info):
Code:
familiar.php?pwd&action=unequip&famid=xxx&ajax=1
HTML for successful unequip to update inventory:
HTML:
<center><table><tr><td>Item unequipped.</td></tr></table></center>
 
Last edited:

Bale

Minion
If that is added, there should probably also be a command to equip familiars that are in the terrarium. Right now, I call the following code in my kingLiberatedScript, but it requires me to use a visit_url() to avoid an extra server hit by switching my active familiars before equipping them.

Code:
void equip_familiars() {
	item it;
	foreach f in $familiars[]
		if(have_familiar(f) && familiar_equipped_equipment(f) == $item[none]) {
			it = familiar_equipment(f);
			if(it != $item[none] && item_amount(it) > 0) {
				print('Equipping your '+f+', "'+f.name+'," with '+it);
				visit_url("familiar.php?action=equip&pwd&whichfam="+ to_int(f) +"&whichitem="+ to_int(it));
			}
		}
}
 
Top