Bug - Fixed Storage - Empty & Pull

Irrat

Member
With the recent addition to the "Storage" menu of the Item Manager. We now have "Empty"

However empty can be called, even when it can't be used. Such as in hardcore, ronin etc. KoL will actually mark your attempt and refuse to let you access your storage until the timer runs out.
This seems like a simple fix, just check if pulls remaining == -1.

Now the second, I'm not sure if it should be a bug request or a feature request. So after mafia restarts it no longer knows what items you've pulled, which is understandable. Could do a preference for this actually.

But it doesn't parse the pull result message.

Which is somewhat important when it says "You've already pulled this today" as it just silently fails and doesn't internally mark it as pulled.

And if someone isn't smart enough to realize what's going on when they can't pull the item.. Well.

There's also the error where you're not allowed to modify your closet or storage for a minute or so after emptying it out, that's of a very minor concern but is another usecase. I think attempting to modify your storage/closet before the timer runs out, resets the timer.
 
Last edited:

Veracity

Developer
Staff member
This puzzles me.

1) I am not aware that "empty" is a new addition to the Storage panel. However, let's consider it.

It creates an EMPTY_STORAGE request and attempts to run it.
- It already checks if you are in Hardcore and fails: "You cannot empty storage while in Hardcore."
- It does not check if you are in Ronin. It should do that, and fail.
- Presumably, the button could be greyed out if you are Hardcore or Ronin.

2) "after mafia restarts it no longer knows what items you've pulled".

What version of KoLmafia are you running? Can I suggest 26201? That version does the following:

If you are pulling in Ronin (the only time pulls are restricted):

- every successful pull is saved in the daily property: _roninStoragePulls
- In the Storage panel, such items have a strike-through on their names to indicate you've already pulled them today
- You can still select them and try to pull, but it will filter them out - and tell you "You've already pulled one 'NAME' today. Skipping..."

Note that if you pull outside of KoLmafia, obviously we don't know about that.

"it doesn't parse the pull result message."

Yes it does. But only for successful pulls. Are you aware that you can select multiple items and KoLmafia will group them (up to 11 at a time) into a single request? Which is to say, you can get up to 11 "NAME (COUNT) moved from storage to inventory" lines.

If you only pull one item at a time, we can tell which one you attempted - and add it to the set of pulled-today items. Which is useful, I guess, for detecting actions done outside of KoLmafia.

I have no idea if it will mix "You already pulled one of those today." in with the successful pulls if you try to pull multiple items at once. Or, if so, it will actually tell you which item it applied to? I'll experiment later today, although, since I am on day 2 of a run, I'm not going to try pulling anything I don't really need to pull.

3) "you're not allowed to modify your closet or storage for a minute or so after emptying it out"

Once you've empty storage, how can you "modify" it? I haven't emptied storage in many years. Ever since I started PVPing, in particular.

This is not something I care about - especially since I can't test it.
 

Irrat

Member
My bad. I definitely didn't have enough sleep when I made this post.

Yeah, only 1. is valid.

2., I had updated halfway through the day and tested with the wrong item, one I had already pulled..
 

Veracity

Developer
Staff member
I have a pull request waiting for review which soups up the "empty storage" button.

In particular, it is greyed out - disabled - if you are in Hardcore or Ronin, or have nothing in storage.
As soon as you leave Ronin or Hardcore - by freeing the King, say - the button automatically enables itself.
And once you empty storage, presumably it disables itself.

I'm still considering if I can reliably add to the "items pulled today" property by noticing the failure message. Since that's only for detecting actions you did outside of KoLmafia, it's not a high priority for me. I'm still going to experiment trying to pull 3 items - one of them previously pulled - and seeing what KoL's response says.
 

Veracity

Developer
Staff member
I researched it.

I cleared my _roninStoragePulls property and tried to pull:

- amulet of extreme plot significance
beer helmet
bejeweled pledge pin
blackberry galoshes
- dieting pill
distressed denim pants
- jar of squeeze

(The ones starting with - had already been pulled today.)

The following request was submitted:

Code:
storage.php?action=pull&ajax=1&whichitem1=594&howmany1=1&whichitem2=2069&howmany2=1&whichitem3=2353&howmany3=1&whichitem4=4659&howmany4=1&whichitem5=9707&howmany5=1&whichitem6=2070&howmany6=1&whichitem7=3399&howmany7=1&pwd

Those are the seven items in order.

With ajax, I got the following response:

Code:
<center><table><tr><td>You already pulled one of those today.<b>beer helmet (1)</b> moved from storage to inventory.<br /> <b>bejeweled pledge pin (1)</b> moved from storage to inventory.<br /> <b>blackberry galoshes (1)</b> moved from storage to inventory.<br /> You already pulled one of those today.<b>distressed denim pants (1)</b> moved from storage to inventory.<br /> You already pulled one of those today.<script type="text/javascript">$(".pullsleft").text("12");</script></td></tr></table></center>

One per line:

Code:
You already pulled one of those today.
<b>beer helmet (1)</b> moved from storage to inventory.<br /> 
<b>bejeweled pledge pin (1)</b> moved from storage to inventory.<br /> 
<b>blackberry galoshes (1)</b> moved from storage to inventory.<br /> 
You already pulled one of those today.
<b>distressed denim pants (1)</b> moved from storage to inventory.<br /> 
You already pulled one of those today.

Note that KoL did not insert line breaks following the "You already pulled one of those today." messages.
But, with some fanciness, we could iterate through the URL and the response text in parallel and deduce which items have already been pulled - outside of KoLmafia, presumably.

Perhaps I will look at that tomorrow. It would require whacking StorageRequest.transferItems().
 

Veracity

Developer
Staff member
I looked at it tonight and added it to my open StorageRequest PR. When it parses the storage response, for every "You already pulled one of those today", we now add the corresponding item to the _roninStoragePulls property.
 
Top