How do I find what items familiars in my terrarium are wearing?

ereinion

Member
Is there any way to find out what equipment is on the familiars you have in your terrarium, using ash, except to use available_amount(), and then compare to whatever other places it may be?

Putting a little box of fireworks on a familiar, and then putting it in the terrarium returns the following results using the various functions I find using "ashref amount":

Code:
[COLOR=olive]> ash available_amount($item[little box of fireworks])[/COLOR]

Returned:      1

[COLOR=olive]> ash storage_amount($item[little box of      fireworks])[/COLOR]

Returned: 0

[COLOR=olive]> ash      closet_amount($item[little box of fireworks])[/COLOR]

Returned: 0

[COLOR=olive]>      ash item_amount($item[little box of fireworks])[/COLOR]

Returned: 0

[COLOR=olive]>      ash equipped_amount($item[little box of fireworks])[/COLOR]

Returned:      0

[COLOR=olive]> ash creatable_amount($item[little box of      fireworks])[/COLOR]

Returned: 0

[COLOR=olive]> ash      display_amount($item[little box of fireworks])[/COLOR]

Updating      display case...
Returned: 0

[COLOR=olive]> ash      shop_amount($item[little box of fireworks])[/COLOR]

Requesting store      inventory...
Store inventory request complete.
Returned: 0

[COLOR=olive]>      ash stash_amount($item[little box of fireworks])[/COLOR]

Refreshing      stash contents...
Stash list retrieved.
Returned: 0

It would of course be quite surprising if one of these functions returned 1 for stuff which is in the terrarium, but I thought it pertinent to include them all for completeness' sake.
 

Veracity

Developer
Staff member
Actually, I take that back - that other thread told me (you) the function you need.

> ashq print( my_familiar() )

Exotic Parrot

> ashq print( familiar_equipped_equipment( $familiar[exotic parrot ] ) )

none

> ashq print( equipped_item( $slot[ familiar ] ) )

none

> ashq print( familiar_equipped_equipment( $familiar[jumpsuited hound dog ] ) )

blue suede shoes
You want familiar_equipped_equipment( familiar)
 

ereinion

Member
Sort of - but in order to discover if e.g. my little box of fireworks is in the terrarium, I'll have to loop through all the familiars in there. In the end, I just went with checking if it is available (available_amount), which "see" items in the terrarium, and if it is I'll attempt to retrieve it (retrieve_item). That works well enough for my purposes, and I believe it saves a few server hits compared to checking on each familiar.

Code:
item choose_familiar_equipment(string currently_farming) {
(...)
            if (available_amount(priority_of_fam_eq[i]) >= 1) {
                if (item_amount(priority_of_fam_eq[i]) ==  0) {
                    if (retrieve_item(1, priority_of_fam_eq[i])) {
                        return priority_of_fam_eq[i];
                    }
                } else {
                    return priority_of_fam_eq[i];
                }
            } 
(...)
}

Another upside with this is that the script will get it if it's stored somewhere else too, if it's available for "free", so it's probably a better solution than checking each place individually - at least in this case.
 
Last edited:

Veracity

Developer
Staff member
There are no server hits involved in checking what your familiars are wearing; we look at the terrarium when you log in, notice what equipment each familiar has, and keep track of any changes you make. Iterating over your list of familiars and checking each piece of equipment looks messy, but it's all just looking at data which is already in memory.
 

Crowther

Active member
Wouldn't this produce the same results?
Code:
item choose_familiar_equipment(string currently_farming) {
(...)
            if (retrieve_item(1, priority_of_fam_eq[i])) {
                return priority_of_fam_eq[i];
            }
(...)
}
 

ereinion

Member
Testing in the cli certainly seems to indicate so. I'll try to simplify my code, and see if it works once I have a few more adventures :) Thanks for the tip!
 
Top