Conditional Switch Familiar Script

muffins

Member
Heya,

Okay, this was just an idea I had for personal use as an extremely lazy method of switching familiars.

The idea I had was to use something like this:

Code:
if(equip_familiar($familiar[Cymbal-Playing Monkey])) {
equip_familiar($familiar[Attention-Deficit Demon]);
}
else {
equip_familiar($familiar[Cymbal-Playing Monkey]);
}

However, all that does is equip the CPM, then go right back to the ADD.

Is this a bug, or is there a better way I could script this (without having to create two scripts, preferably)?
 

Nightmist

Member
[quote author=muffins link=topic=578.msg2793#msg2793 date=1163394544]
*Stuff*
[/quote]

Heh well I guess theres aways the use this command: "have_familiar( familiar pet )" found in here... http://wiki.kolmafia.us/?page_id=8. Have a look in the "Part 1 - Your character" section too since theres some familiar info stuff there too.

Oh and look at your code... the "If" check... if you successfully equip the CPM then run whats in the first set of "{}"... which is to equip a ADD? Uhh just add a "!" in front of the equip_familiar inside of the "if" and then kill the "else" part, since u will already have it equipped... (Unless you start using the "have_familiar()", in which case, keep the else but remember to use a "!" in front of it, so "!have_familiar()")

Right now its doing:
Code:
If I have a CPM and it equips successfully then
equip a ADD
else
equip a CPM

Edit: Oh and I just remembered, don't forget to add the "my_familiar()" check to it, in-case you already have the CPM equipped.
 

muffins

Member
Oh... I somehow managed to completely overlook the my_familiar() command... now I feel like an idiot.

This works exactly as I wanted it to:

Code:
if(my_familiar() == $familiar[Cymbal-Playing Monkey]) {
equip_familiar($familiar[Attention-Deficit Demon]);
}
else {
equip_familiar($familiar[Cymbal-Playing Monkey]);
}

Thanks!
 
Top