PDA

View Full Version : Equip all familiars Script please?



Criswell
06-29-2006, 06:14 PM
I'd like to see a script to equip all familiars with their specific special equipment. I spend a lot of time clicking to put all of those items on them. Does someone already have something like this? I wrote a set specific for my characters, but found I had to keep modifying it when I got new familiars or equipment. TIA - Criswell

Tirian
06-29-2006, 07:11 PM
I've got such a script here:

http://kolmafia.us/index.php/topic,91.0.html

It probably doesn't have the last few months worth of new familiars, but it should be easy enough for you to fire up Notepad and see where in TirianLib.ash the associations are made and add in stuff like the spirit hobo and astral badger if needed.

Presto Ragu
06-29-2006, 08:16 PM
but found I had to keep modifying it when I got new familiars or equipment. TIA - Criswell


Unfortunately, that will always be true... Well... If you aren't updating it, someone will be.

Tirian
06-29-2006, 08:49 PM
Well, it might depend. If Criswell is buying the IotM every month, then it will require regular maintenance. But if Criswell is a more novice player who is adding long-existing familiars like the bonus mushrooms or the NPZR, then a comprehensive list that is several months out of date could be quite useful.

I've been of the mind for a while now to split TirianLib.ash so as to divide the basic functions from the collections of maps, and to make the latter more of an "open-source" file that people would be encouraged to publicly correct as the need arose. My main reservation is that it would be pretty ugly having the Scripts drop-down menu filled with header files that would have no executable functionality. Maybe if I bake Holatuwol a batch of cookies he can set up a special extension for ASH headers that would be excluded from the menu list. :D

holatuwol
06-30-2006, 02:34 AM
My main reservation is that it would be pretty ugly having the Scripts drop-down menu filled with header files that would have no executable functionality.* Maybe if I bake Holatuwol a batch of cookies he can set up a special extension for ASH headers that would be excluded from the menu list.
If you prefix the name of your script with a "." (in other words, ".TirianLib.ash" instead of "TirianLib.ash"), it will be ignored in the scripts dropdown.* Also, if you add either a ~ or a .bak to the end of a script's filename, it'll be considered a backup file and therefore not be included in the menu list.* Finally, if you go into your preferences and start configuring your scriptbar to only include files you use, and even go so far as go into the Login configuration and ask that the scriptbar always appear on the main panel, then you won't even need to look at the script menu.

I'm a huge fan of oatmeal raisin cookies.

MCMcDLT
01-20-2008, 05:43 AM
I tried this one and it totally wigged out!
so I made an "old fashioned" text one of it

macman104
01-20-2008, 07:45 AM
That would probably because some of those functions have changed (like familiar_to_item) and some may not be there anymore. If you could be more specific about "wigging out" we might be able to help you use the script correctly.

hippymon
01-20-2008, 07:16 PM
I have a script, although as stated before, it too will have to be updated but it works great for me.

dangerpin
01-21-2008, 05:40 AM
Isn't there a handy button in the Familiar Trainer for equipping all familiars?

hippymon
01-21-2008, 05:41 AM
There is, but every time I have tried using that button nothing happens.

Veracity
01-21-2008, 04:07 PM
Yeah, yeah. Well, OK.

I fixed the button in revision 5589. It will now pull familiar items from the closet or storage, as needed, to equip all of your familiars.

hippymon
01-22-2008, 02:33 AM
Yeah, yeah. Well, OK.

I fixed the button in revision 5589. It will now pull familiar items from the closet or storage, as needed, to equip all of your familiars.


Woot, that would be helpful if I played. Thanks!

EDIT: That is helpful, thanks!

macman104
01-22-2008, 03:33 AM
Woot, that would be helpful if I played. Thanks!What? You brought up the issue, but now you say you don't play? I'm confused?

th3y
09-10-2009, 02:51 AM
I fixed the button in revision 5589. It will now pull familiar items from the closet or storage, as needed, to equip all of your familiars.


Necro/feedback: I wouldn't mind if it tried the clan stash, and/or mall purchase (subject to built-in price limit) for familiar items unavailable in inventory/closet/storage...

-That's what TH3Y think

Veracity
09-10-2009, 03:18 AM
It would do that automatically, if I used the built-in "acquire" technology, but I tried to be efficient and bulk-move items from storage, rather than getting them one at a time.

I could add stash and mall as sources. But, since I already own all the items for all of my familiars, I wouldn't ever use it or be able to test it.

the_great_cow_guru
09-10-2009, 06:26 PM
Unfortunately, that will always be true... Well... If you aren't updating it, someone will be.

Not necessarily, if you make a script that uses mafia's familiars.txt file it should work for all the new familiars, as long as you keep mafia up to date.

Bale
09-10-2009, 08:20 PM
Huh? What? Why should we need to use mafia's familiars.txt file? This is way too easy. Thanks to a recently added feature I can do this whole script in a few lines and be certain it will always be updated to use mafia's current information about familiars.


void main() {
item pet_toy;
foreach pet in $familiars[]
if(have_familiar(pet)) {
pet_toy = familiar_equipment(pet);
if(familiar_equipped_equipment(pet) != pet_toy) {
retrieve_item(1, pet_toy);
use_familiar(pet);
equip($slot[familiar], pet_toy);
}
}
}

zarqon
09-12-2009, 08:14 AM
Small edit to save server hits:


void main() {
item pet_toy;
foreach pet in $familiars[]
if(have_familiar(pet)) {
pet_toy = familiar_equipment(pet);
if(familiar_equipped_equipment(pet) != pet_toy) {
retrieve_item(1, pet_toy);
if (pet == my_familiar()) equip($slot[familiar], pet_toy);
else visit_url("familiar.php?pwd&action=equip&whichfam="+to_int(pet)+"&whichitem="+to_int(pet_toy));
}
}
}

Bale
09-12-2009, 08:26 AM
Yeah, well, if I'd been serious about this script I could have figured out the php for that line also. It just didn't seem worth the trouble for such a minor script that I rattled off in a few minutes just to make a point about not needing to parse familiars.txt.

Bloody perfectionist.

zarqon
09-12-2009, 08:31 AM
What's this, a lapse in Bale's OCD?

I was actually kind of happy to finally find something to fix in your code. I think usually it's the other way around. :)

Bale
09-12-2009, 08:45 AM
Is it? I learn an awful lot from your code. That's what you're getting all those bat bits for. (Though their low mall price does encourage me to keep it up.)

Mostly I was amused that you took the time to figure out the visit_url() for that command. I should have probably put a winky face on the end of that post to make it clear.

zarqon
09-12-2009, 10:20 AM
Haha, no, your jest was taken as such, and dished back in kind. ;)

A recent check of jickenwings shows that I'm in the top 15 for most of my bat collection! I'm much lower for tiny plastic bats and once-per-ascension items, and I'm not number one in anything yet (although a couple are pretty close), but it's exciting progress. Thanks to all the batbit donors, in particular Bale and mredge for including batbit-donating in their scripts!

Raven434
09-13-2009, 12:35 AM
Nice 'snippet' of handy code!

Thanks guys.

mredge73
09-13-2009, 01:13 PM
Yet another improvement...
Callable from any script with the option to only equip your current familiar and it does not auto-abort if you cannot get the equipment (like elemental fairy items).



//Equip Familiar by Bale
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
void EquipFamiliar(boolean All)
{
item pet_toy= familiar_equipment(my_familiar());
if(ALL)
{
foreach pet in $familiars[]
if(have_familiar(pet))
{
pet_toy = familiar_equipment(pet);
if(familiar_equipped_equipment(pet) != pet_toy)
{
if(retrieve_item(1, pet_toy))
{
if (pet == my_familiar())
equip($slot[familiar], pet_toy);
else
visit_url("familiar.php?pwd&action=equip&whichfam="+to_int(pet)+"&whichitem="+to_int(pet_toy));
print ("Equipped "+pet+" with "+pet_toy,"blue");
}
}
}
}
else
{
if(retrieve_item(1, pet_toy))
{
equip($slot[familiar], pet_toy);
print ("Equipped "+my_familiar()+" with "+pet_toy,"blue");
}
}
}

That FN Ninja
09-13-2009, 04:06 PM
My TraFa script handles equipping your current familiar, equipping a specific familiar, or even equipping all your familiars and has useful aliases to do these things in the documentation! I just recently posted it. The links in my sig.