How many Mr. As do I have?

dj_d

Member
item_amount() ignores the number equipped. Have_equipped is a boolean, not an int. Do I have to iterate through each slot with equipped_item? I'm interested in a general solution to enhance item_amount with something more comprehensive, by the way, not just Mr. Accessories. :)
 

Veracity

Developer
Staff member
We have item_amount, closet_amount, storage_amount, display_amount, shop_amount, and stash_amount, but are missing equipped_amount.

We do have available_amount, which is the sum of item_amount, closet_amount, (equipped_amount), and storage_amount (if you are out of Ronin).

What the heck. I'll add equipped_amount. Its absence seems like an oversight.
 

Camber

Member
Would equipped_amount also work for equipment on your familiar? and also for equipment on familiars in your terrarium?

Thanks!
 

Veracity

Developer
Staff member
It works on the equipment on your current familiar, but does not look into your terrarium.
 

Camber

Member
Is there an easier way to take inventory of specific familiar equipment (like Items of the Month) that are equipped on familiars in your terrarium without changing familiars before each check?

I have found that i need to do a refresh after changing familiars or the fam eq doesn't get updated and causes errors; and that is a lot of server hits just to see if a terrarium familiar has the Mayflower bouquet or not.

I am just looking for better scripting ideas i currently have working.

Thanks!
 

Veracity

Developer
Staff member
[quote author=Camber link=topic=2047.msg10148#msg10148 date=1228331050]
Is there an easier way to take inventory of specific familiar equipment (like Items of the Month) that are equipped on familiars in your terrarium without changing familiars before each check?[/quote]
Not currently. familiar_equipment( familiar ) just returns the familiar's special item, whether or not your familiar has it equipped, whether or not you even own the familiar.

I suppose I could add something like familiar_equipped_item( familiar ) (or perhaps equipped_familiar_item) which would return the current equipment on the specified familiar.

I have found that i need to do a refresh after changing familiars or the fam eq doesn't get updated and causes errors
This worries me. Can you describe exactly what you do and exactly what is wrong? Are you saying that you change familiars via use_familiar( familiar ) and after doing so, equipped_item( $slot[ familiar ] ) is incorrect?
 

Camber

Member
[quote author=Veracity link=topic=2047.msg10149#msg10149 date=1228331706]
Not currently. familiar_equipment( familiar ) just returns the familiar's special item, whether or not your familiar has it equipped, whether or not you even own the familiar.

I suppose I could add something like familiar_equipped_item( familiar ) (or perhaps equipped_familiar_item) which would return the current equipment on the specified familiar.[/quote]

That would great!

I have found that i need to do a refresh after changing familiars or the fam eq doesn't get updated and causes errors

This worries me. Can you describe exactly what you do and exactly what is wrong? Are you saying that you change familiars via use_familiar( familiar ) and after doing so, equipped_item( $slot[ familiar ] ) is incorrect?

After a use_familiar(), I am using have_equipped() to look for a specific item (See code below). If I don't do a refresh equipment before using have_equipped, strange things happen. The best i came up with when i was extensively troubleshooting this back in May, was that Mafia wasn't getting the familiar equipment slot updated properly. I got it working with the refresh; put in a userprompt before actually doing it; don't run the fam_eq part hardly at all; and got distracted until now. :)

Code:
For x from 1 upto NumFamiliars by 1
{
 familiar pet = to_familiar(x);
 if(have_familiar(pet)){
  use_familiar(pet);
  cli_execute("refresh equip"); // ** Must use, else failures
  foreach x in MrFamEq 
  {
   if (have_equipped(to_item(MrFamEq[x].name))) {
    cli_execute("unequip " + MrFamEq[x].name);
    print_html("<b><font color='#FF0000'>"+MrFamEq[x].name + " Removed from " + pet+"</font></b>");
   }
   //else print_html("<b><font color='#FFFF00'>" + MrFamEq[x].name +" Not on " + pet + "</font></b>");
  }
 }
 //else print_html("<b><font color='#00FFFF'>Do Not have " + pet + "</font></b>");
} // close for loop

mrFamEq_Map.txt
Code:
1	lucky Tam O'Shanter
2	miniature gravy-covered maypole
3	wax lips
4	plastic pumpkin bucket
5	flaming familiar doppelgänger
6	Mayflower bouquet
7	origami "gentlemen's" magazine

I have attached my whole Mr. Items Inventory script sans file_to_map files for your review.

Thanks again for all that you do...
 

Attachments

  • _Mr_Items_v2.ash
    8.2 KB · Views: 38

Veracity

Developer
Staff member
[quote author=Camber link=topic=2047.msg10151#msg10151 date=1228335573]
After a use_familiar(), I am using have_equipped() to look for a specific item (See code below). If I don't do a refresh equipment before using have_equipped, strange things happen.[/quote]

I can't reproduce this. I didn't use your exact script, but I think the following tests what you claim doesn't work:

Code:
familiar fam = my_familiar();
item md = to_item( "Meat detector" );

print( "Current familiar = " + fam + " wearing " + equipped_item( $slot[ familiar ] ) );
print( "Have a " + md + " equipped = " + have_equipped( md ));

use_familiar( $familiar[ leprechaun ] );
print( "Current familiar = " + my_familiar() + " wearing " + equipped_item( $slot[ familiar ] ) );
print( "Have a " + md + " equipped = " + have_equipped( md ));

use_familiar( fam );
print( "Current familiar = " + my_familiar() + " wearing " + equipped_item( $slot[ familiar ] ) );
print( "Have a " + md + " equipped = " + have_equipped( md ));

When I run it, this is the result:

> familiarTest.ash

Current familiar = Cheshire Bat wearing smile-sharpening stone
Have a Meat detector equipped = false
Putting Grinning Grrl the Cheshire Bat back into terrarium...
Taking Lucky Grrl the Leprechaun out of terrarium...
Current familiar = Leprechaun wearing Meat detector
Have a Meat detector equipped = true
Putting Lucky Grrl the Leprechaun back into terrarium...
Taking Grinning Grrl the Cheshire Bat out of terrarium...
Current familiar = Cheshire Bat wearing smile-sharpening stone
Have a Meat detector equipped = false
Requests complete.
 

Camber

Member
[quote author=Veracity link=topic=2047.msg10204#msg10204 date=1228446917]
I can't reproduce this. I didn't use your exact script, but I think the following tests what you claim doesn't work:[/quote]

Well, that certainly shows that my thoughts were wrong. Sorry that i made you test that for nothing. Now back to my code to make it work without the refresh. That should be easier now with the familiar_equipped_equipment() function.

Thanks again!
 
Top