Bug - Fixed Unexpected results from "stash" cli-command

ereinion

Member
I'm not entirely sure if this is a bug or not, but I find it odd that the "stash" cli-command returns a pyec to the stash when it is the only argument for the command, but not when it is the first of a list of arguments. I'd at least expect it to return an error message if it fails to find a unique item to return to the stash? And isn't it odd that the same command works when I try it again later? Any suggestions on what I should do to further troubleshoot this? Probably stupid of me to refresh my inventory before checking if mafia still thought it was there, but at that point I only wanted to know if it had been returned (I've had issues with it not being back in the stash when I thought it was before).
Code:
[COLOR=olive]
[COLOR=olive]> stash take platinum[/COLOR]

Pulling items      from stash...
Platinum Yendorian Express Card is not multiusable, but      KoLmafia thought it was
You acquire an item: Platinum Yendorian Express      Card
Requests complete.

[COLOR=olive]> use platinum[/COLOR]

Using      1 Platinum Yendorian Express Card...
You gain 4,372 Muscularity Points
You acquire an effect (...)

[COLOR=olive]> stash put platinum, hypno, 3 jekyll[/COLOR]

Dropping      items into stash...
Requests complete.

[COLOR=olive]>      refresh inv[/COLOR]

Updating inventory...
Requests complete.

[COLOR=olive]>      inv platinum[/COLOR]

Platinum Yendorian Express Card
[COLOR=green][URL="http://kolmafia.us/messages.php?box=PvP"] [/URL][URL="http://kolmafia.us/showplayer.php?who=2355952"]Cheesecookie[/URL][URL="http://kolmafia.us/peevpee.php?action=log&lid=257916&place=logs"]      just attacked you![/URL][/COLOR]


[COLOR=olive]> inv hypno[/COLOR]

[COLOR=olive]>      inv jekyll[/COLOR]

[COLOR=olive]> stash put platinum[/COLOR]

Dropping      items into stash...
Requests complete.

[COLOR=olive]> inv      platinum[/COLOR]

[COLOR=olive]> refresh inv[/COLOR]

Updating      inventory...
Requests complete.

[COLOR=olive]> inv      platinum[/COLOR]

[COLOR=olive]> stash take platinum[/COLOR]

Pulling      items from stash...
You acquire an item: Platinum Yendorian Express Card
Requests      complete.

[COLOR=olive]> inv platinum[/COLOR]

Platinum      Yendorian Express Card

[COLOR=olive]> stash take 3 jekyll,      hypno[/COLOR]

Pulling items from stash (request 1 of 2)...
You      acquire Jekyllin hide belt (3)
Pulling items from stash (request 2 of      2)...
You acquire an item: hypnodisk
Requests complete.

[COLOR=olive]>      stash put platinum, hypno, 3 jekyll[/COLOR]

Dropping items into      stash...
Requests complete.

[COLOR=olive]> inv platinum[/COLOR]

[COLOR=olive]>      refresh inv[/COLOR]

Updating inventory...
Requests complete.

[COLOR=olive]>      platinum[/COLOR]

[COLOR=red]Unable to invoke platinum[/COLOR]

[COLOR=olive]>      inv platinum[/COLOR][/COLOR]
 

lostcalpolydude

Developer
Staff member
There's another bug report about the PYEC being removed from mafia's idea of what's in your inventory when using it. The lack of an error message here surprises me. What surprises me even more is that when it is the only parameter for "stash put", it ends up in the stash even though mafia thinks you don't have one to return (if I kept track of what I was testing properly, though I didn't spend too much time on it).
 

ereinion

Member
Hmm. So you are able to replicate the issue? And if you do, have you got any idea of what is causing it, so that I can avoid having this problem in the future?
 

Veracity

Developer
Staff member
"Platinum Yendorian Express Card is not multiusable, but KoLmafia thought it was"

That is because we have it listed as an "mp" item. By default, those are multiusable. When we logged that message, we set the "usable" flag on it internally. It didn't repeat the message next time you pulled it because it was then properly tagged.

"The lack of an error message here surprises me."

It surprises me too. ItemFinder.getMatchingItemList( list, parameters ) looks up the items on the specified list and gets the "matchCount" of available items in that list, but doesn't insist that that the required number of items is available. That seems like a bug. if "errorOnFailure", it should print an error message and return null. Otherwise, it should simply return null.

Everything else you report here can be explained by KoLmafia erroneously removing the item from its idea of inventory when you use it.

I'll fix the item matcher to give an error message and will mark the item as "usable", so we don't think it is multiusable.

I will also figure out why it disappears from inventory, even though I see it marked as reusable - unless somebody did that after this report was made; I haven't actually TRIED this yet, since I only get one chance per day at it.
 
Top