Bug - Not A Bug ashq closet_amount not working? r9814

This broke yesterday I think.

So I have this ash script that does this: (it starts with 2 stinky cheese eyes in my inventory).

fold($item[stinky cheese diaper]);
put_closet(1, $item[stinky cheese diaper]);
fold($item[stinky cheese diaper]);
cli_execute("maximize adv, switch hobo monkey, +equip tiny bindle");
if (closet_amount($item[stinky cheese diaper]) > 1) {
take_closet(1, $item[stinky cheese diaper]);
}

I used to have a stinky cheese diaper on my character and in my inventory when the script completed
but now when I check the closet, the stinky cheese diaper is still in there.

I tried this on the command line:

> ashq take_closet(1, $item[stinky cheese diaper]);

Removing items from closet...
You acquire an item: stinky cheese diaper
Requests complete.

So I'm guessing closet_amount isn't working correctly?
 
urgh, in looking at the code I think I should change:

if (closet_amount($item[stinky cheese diaper]) > 1) {

to

if (closet_amount($item[stinky cheese diaper]) > 0) {



But I'm still not sure why it was working fine for quite a while until yesterday..
 

Theraze

Active member
Especially since it involves a folding item... is your goal to get all of them out of your closet, or one? If it's to get them all out, you should probably do something more like:
Code:
 fold($item[stinky cheese diaper]);
 put_closet(1, $item[stinky cheese diaper]);
 fold($item[stinky cheese diaper]);
 cli_execute("maximize adv, switch hobo monkey, +equip tiny bindle");
 foreach it in get_related($item[stinky cheese diaper], "fold") {
  if (closet_amount(it) > 0) {
   take_closet(closet_amount(it), it);
  }
 }
 
Especially since it involves a folding item... is your goal to get all of them out of your closet, or one? If it's to get them all out, you should probably do something more like:
Code:
 fold($item[stinky cheese diaper]);
 put_closet(1, $item[stinky cheese diaper]);
 fold($item[stinky cheese diaper]);
 cli_execute("maximize adv, switch hobo monkey, +equip tiny bindle");
 foreach it in get_related($item[stinky cheese diaper], "fold") {
  if (closet_amount(it) > 0) {
   take_closet(closet_amount(it), it);
  }
 }

Well the only reason I am putting the item into the closet is because fold seems to not work if you already have 1 of the item you are requesting to fold.
Since I wanted two of the same item, I discovered that putting one of them into the closet, enabled me to fold the other item.
So I think I will only be taking one of the item out of the closet.
 
Top