Bug - Won't Fix Storage_amount() doesn't return correct amount

ereinion

Member
I got a special edition batfellow comic in a kmail today, which automatically get stored at hagnk's. I was going to update my breakfast script to automatically pull and use it, but no matter what I do it does not seem to detect the item in Hagnk's. Tried both a "refresh all" and visiting Hagnk's but it still didn't detect the comic.
Screenshot_1.png
 

gulaschkanone

New member
Free pulls are considered separately, which is probably documented somewhere. Try the "free pulls" category in the item manager, available_amount and retrieve_item.
 

ereinion

Member
Available_amount gives the same result:

Code:
[COLOR=olive]> ash available_amount($item[edition Batfellow comic])[/COLOR]

Changing      "edition Batfellow comic" to "special edition Batfellow comic" would get      rid of this message. ()
Returned: 0
 

Veracity

Developer
Staff member
You logged in.
You are told "you have a message from Batfellow"
You look at it.
It says "You acquire an item: Special edition Batfellow comic"
You look at inventory and don't see it.

Note that we NEVER parse "You acquire" messages in kmail.

My guess:

You log in.
You are told "you have a message from Batfellow"
/count Special edition Batfellow comic
-> returns X
You look at the message.
It says "You acquire an item: Special edition Batfellow comic"
/count Special edition Batfellow comic
-> returns X + 1

If that is the way it works, then, sorry. Won't fix.
 

ereinion

Member
I log on at and get a message "you have a message from batfellow".

I go look at the message:
Screenshot_1.png

I do:

Code:
[COLOR=olive]> ash storage_amount($item[special edition Batfellow      comic])[/COLOR]

Returned: 0

I do:

Code:
[COLOR=olive]> refresh all; ash storage_amount($item[special      edition Batfellow comic])[/COLOR]

Refreshing session data...
Synchronizing      moon data...
Loading character status...
Retrieving character data...
Updating      inventory...
Examining Meat in closet...
Updating closet...
Retrieving      quest data...
Retrieving familiar data...
Familiar data retrieved.
Retrieving      campground data...
You are currently a member of Hardcore Oxygenation
Visiting      Hot Dog Stand in clan VIP lounge
Visiting Speakeasy in clan VIP lounge
Visiting      Floundry in clan VIP lounge
Seeing what's still unrestricted today...
Done      checking allowed items.
Session data refreshed.
Returned: 0

I visit hagnk's, see the special edition batfellow magazine there, and do:

Code:
[COLOR=olive]> ash storage_amount($item[special edition Batfellow      comic])[/COLOR]

Returned: 0

I log out and back in, and do it again:

Code:
[COLOR=olive]> ash storage_amount($item[special edition Batfellow      comic])[/COLOR]

Returned: 0

[COLOR=olive]> ash available_amount($item[special edition Batfellow      comic])[/COLOR]

Returned: 0

It seems to me it fails to detect the magazine in Hagnk's at all. Don't really know what is going on :p
 

Veracity

Developer
Staff member
"refresh_all" does not refresh storage.

If we logged in, did not see it either in storage or "free pulls", then storage_amount() will return 0.

If you look at the message and it now appears in storage, whereas it was not there before, the "storage_amount" will still return 0.

As I said, "refresh all" will not refresh storage - because we have never, prior to this, been shown a case where storage changed after you logged in - although shop purchases will update your storage meat.

You can do "cli execute( "refresh storage" )" and see if storage_amount() will now find your comic.
 

Veracity

Developer
Staff member
Regarding logging out and in again and it doesn't refresh storage for you?

Yeah. It sure doesn't behave that way for me.

Code:
[color=green]> ash storage_amount($item[special edition Batfellow comic])[/color]

Returned: 8
 

lostcalpolydude

Developer
Staff member
KoLmafia doesn't check storage once it has been emptied (as tracked by lastEmptiedStorage == my_ascensions() ), because it used to be impossible to get items in there once it was empty.
 

ereinion

Member
Ah, that would explain it - cli_execute("refresh storage") fixed it - thanks a lot for clearing things up for me :)
 

Veracity

Developer
Staff member
Ah. So if you emptied storage and then Batfellow gave you a comic, yeah.

You could do this:

set lastEmptiedStorage=-1
refresh storage
pull * special edition Batfellow comic

Which will detect that storage is (again) empty and update lastEmptiedStorage to your current ascension.
 

Veracity

Developer
Staff member
It has been many many runs since I emptied my storage. I got used to PVPing where storage was the best place to keep my stuff.
I need to use it? KoLmafia will automatically pull and use or equip or whatever.
Somebody wants to steal something I gained in-run? Who cares? I never even see it, since I never look at PVP logs.
Although, if I will be PVPing for an extended time in aftercore, I do use my script which closets anything which autosells for more than 100 meat. People can gloat all they want at taking my batgut or Knob goblin tongs.

I never see it. I don't look at PVP win or lose messages.
 

AlbinoRhino

Active member
The same with me. I only PVP occasionally but I do like to look at what got stolen. But I have a script that makes sure it's nothing but junk too. But, yeah, "autoSatisfyWithStorage" pretty much takes care of me, so why bother?
 
Last edited:

lostcalpolydude

Developer
Staff member
PvP is the reason I started pulling everything, after years of not doing so. Closet valuable stuff once, let pull all dump that stuff back in the closet, and fill my inventory with garbage even if I happen to have something useful sitting around (like a lump of eldritch matter, which is now in my closet but could have easily been overlooked initially).
 

AlbinoRhino

Active member
Hagnk's is my closet now. In fact, I sometimes think of it as "the ascension closet." Then it kind of became the the regular closet.
 

AlbinoRhino

Active member
Is having stuff in your closet advantageous to PVP in some way ? All I ever do is use that command you guys wrote that burns all the turns for me and gathers swagger or whatever it's called.
 

Veracity

Developer
Staff member
No. If you have nothing in your inventory, it will steal from your closet, but if you have nothing there, tough noogies for the thief. Storage is still safe.

I think lost's strategy is that by pulling all, he will end up with more junk in inventory than what he collected in-run.

That's never made a difference to me. But, your milage may vary, etc.
 

fronobulax

Developer
Staff member
After over a decade playing the game, I have not yet done PvP. Maybe someday, but Club is the weakest of my Bartle attributes. The Diamond, however is strong in this one and I have several scripts that help me determine what I need in my Display Case. There was a time when the ash functions those scripts used or needed did not play nicely with Hangk's *. I chose to make the scripts work on the inventory contents only. Given the choice of reworking the scripts or just always pulling everything I opt for the latter.

(* My memory is fuzzy but I recall that the functions I wanted did not exist and/or that the function names differed based on where something was stored. This is not a comment on the current state of ash and rooted in my basic laziness).
 

lostcalpolydude

Developer
Staff member
After over a decade playing the game, I have not yet done PvP. Maybe someday, but Club is the weakest of my Bartle attributes.

I treat it as a Diamond activity anyway, just a way to make my swagger value go up so I can spend it on stuff in the shop. The associated leaderboards (which I sometimes make, though usually by accident) also fit the Diamond attribute.
 
Top