Equip best familiar, add more familiars.

hippymon

Member
I am currently working on GhettoTrucker's GT_Meatfarm.ash script: http://kolmafia.us/index.php/topic,970.0.html

I want to change the choose familiar portion of the script to use the best of 14 familiars, and rather than re-doing the portion of the script 13 more times... I am wondering if there is any other easier way to go about this?

Keep in mind that this will replace the "GET_BEST_FAMILIAR" section of GhettoTrucker's script.

Code:
 void Get_Best_Familiar(){

                if(have_familiar($familiar[ X ])){
		equip_familiar($familiar[ X ]);
		while(have_equiped($familiar[ X ])){
		if(item_amount($item[lucky Tam O'Shanter]) > 0){
		equip($item[lucky Tam O'Shanter]);
}
		else if(item_amount($item[miniature gravy-covered maypole]) > 0){
		equip($item[miniature gravy-covered maypole]);
}
		else if(item_amount($item[plastic pumpkin bucket]) > 0){
		equip($item[plastic pumpkin bucket]);
}
		else{
		equip($item[familiar_equipment( X )]);
}
}
}


#### I wish to take /\ /\ that command and replace the X with the following familiars (in the same order)
#### is there some kind of map or string that will make this easier?

Coffee Pixie
Attention-Deficit Demon
Jitterbug
Nervous Tick 
Cymbal-Playing Monkey 
Chesire Bat
Green Pixie
Leprechaun
Baby Gravy Fairy
Flaming Gravy Fairy
Frozen Gravy Fairy
Stinky Gravy Fairy
Spooky Gravy Fairy
Ninja Pirate Zombie Robot
 

dornbeast

New member
I think I'd go with creating a variable best_familiar.

string best_familiar = ""
if (have_familiar($familiar[ Coffee Pixie ]))
{ best_familiar = "Coffee Pixie"; }

Repeat until you have your best familiar.

Then use best_familiar in place of the $familiar [X] part for equipping. You're still repeating the test fourteen times, but at least you don't have to repeat the equip text fourteen times.

On the other hand, I'm not sure whether this would work or not.

Oh, just to add to your headache: What if the Coffee Pixie is twenty pounds, and all the other familiars weigh one pound?
 
Top