Bug Maximiser 'on hand' tries to unstash then buy

elpasi

New member
r13522

Options for maximise equipment are 'none' 'on hand' 'creatable/foldable' and 'pullable/buyable'.

The less important question is why is it the case that with 'on hand' selected, KoLmafia wants to unstash things from the clan? Is this not in the same class of retrieval as the pull part of 'pullable'?

The real issue is that, when it realises that it's a 0 karma item ("unstash and equip acc1 natty blue ascot") it runs off to the mall and tries to buy it, before aborting realising 222,222 is a lot of meat. If the item to buy had been cheaper, I assume it would have bought it.

This seems at least somewhat dangerous behaviour (the purchase attempt part) because I'd expect 'on hand' to only ever do anything that involves no meat spend.

Code:
Maximizing...
264 combinations checked, best score 417.13
Wielding Seeger's Unstoppable Banjo...
Equipment changed.
Pulling items from stash...
Transfer failed for natty blue ascot
Movement of items failed.
Searching for "natty blue ascot"...
Search complete.
Stopped purchasing natty blue ascot @ 222,222.
Using cached search results for natty blue ascot...
Stopped purchasing natty blue ascot @ 222,222.
You need 1 more natty blue ascot to continue.
 

elpasi

New member
I have. This shouldn't make me subsequently attempt to purchase it, though, correct?

I do now see why maybe it makes sense in the 'on hand' section, though.
 

Bale

Minion
That does mean choosing an item in your stash is behaving exactly as you have told it. At least that part is intended behavior.


The real issue is that, when it realises that it's a 0 karma item ("unstash and equip acc1 natty blue ascot") it runs off to the mall and tries to buy it, before aborting realising 222,222 is a lot of meat. If the item to buy had been cheaper, I assume it would have bought it.

The problem there is probably that it tries to get the item with "acquire" which doesn't care where the item comes from. This causes it to purchase from the mall because it fails to get it from the stash. I suspect that would be troublesome to make it work in the way you expect.

I personally recommend never enabling "Take items from the clan stash whenever needed" since it can cause all kinds of trouble, particularly if you every switch clans during a session or don't have free access to clan items.
 

lostcalpolydude

Developer
Staff member
The problem there is probably that it tries to get the item with "acquire" which doesn't care where the item comes from. This causes it to purchase from the mall because it fails to get it from the stash. I suspect that would be troublesome to make it work in the way you expect.

Acquire only looks at the mall if you have the mall enabled. I know this because I have mall purchases disabled and mafia never goes to the mall for me.

I don't know what's going on in this case.
 

Theraze

Active member
I don't know what's going on in this case.

Sounds like on hand runs with anything that can grabbed with acquire, not counting coinmasters, npc stores, or the mall. As in your storage, closet, clan stash - any location that he said it should automatically acquire items from without further confirmation. The problem here is that while he told it to acquire items from his clan stash, it didn't let him grab whatever he wanted - it was stopped and the transfer failed.

After that, mafia ran a confirmatory "acquire" to get the item back into inventory in case it happened to be equipped to a disembodied hand or whatever else might have made things messy. This went against the full set of acquire rules, including trying to buy it from the mall, since it wasn't available through the clan stash or any other available source. Luckily it was stopped by a sane aBPL.

But this would probably happen anytime a clan stash or softcore-limited-storage pull fails.
 

elpasi

New member
As another bug to do with this, and this is regardless of what you think about all other bugs:

I /own/ three natty blue ascots now. However, the maximiser still is preferring to tell me to 'unstash and equip' the natty blue ascot for 'Equipment: on hand' - it is preferring the stash to my actual inventory.
 

elpasi

New member
It knows I have 3 natty blue ascot, and also one mark IV hat, but in both cases it claims 'unstash and equip'.
 

elpasi

New member
I want to clarify the topics so far, since the last one is outstanding and now rather annoying here, and I want to amend my statement as to the issue.

I retract point 1.
1. If the maximiser decides the correct option is 'unstash and equip' and yet you take an item with more karma cost than your daily limit, or a zero karma item where you do not have permission to remove zero karma items, kolmafia will issue an 'aquire' that actually makes you buy it from the mall (or hit the mall price limit and fail). I suppose in the discussion above, it's clear that this one would take too much effort to make work properly.

2. Regardless of if you own an item or not, the maximiser will prefer 'unstash and equip' over 'equip'. I have multiple items that my clan stash also has, maximiser will ALWAYS unstash a second, or at least attempt to, before the 'acquire' action uses the one from the existing inventory. This just gets annoying in having to either issue your own equip commands for the maximised data, or having to restash things kolmafia has unstashed without reason.
 
Last edited:

Theraze

Active member
So just don't tell it to auto-pull from your clan stash if you don't have unlimited karma? Since mafia can't necessarily know what you've been set to without actually doing the pull attempt, since other people might change the clan settings between the last time you tried and this time.

You're asking for mafia to become your clan's mind-reader. When YOU say that you can pull unlimited items from your clan stash by telling it to auto-pull, and you lie... then mafia gets confused. Rightly so.
 

elpasi

New member
The second point has nothing to do with being a mind reader. The logic for it is as follows:

- I own three natty blue ascots.
- Maximiser says I should wear three natty blue ascots.
- Maximiser decides to fulfil this by taking three natty blue ascots from the clan stash and trying to equip them. In the best case, I've just taken 600k meat of items from the clan stash I don't need and will need to put back when I notice. Worst case, someone's going to think I'm abusing ability to pull whatever I want and trying to loot the stash or something. Either is incorrect, since there are three sat in my inventory that should have been used.

= Illogical.

--

Alright, I put on my coder hat when thinking about issue number one, and I see why, as the general logic for deciding to pull goes, it's technically unavoidable. It's perhaps a little semantically jarring for the 'on hand' vs 'buyable' parts of the maximiser when the 'on hand' one can fall back to a mode that spends meat, but when it comes to calling acquire, it's not easy to discern if this is a fail-spending or fail-without-spending case. I don't exactly agree with your claim that when I ticked the box, I was stating unlimited access to both the stash and zero karma items. I haven't seen that being used to describe the cases upon which you should tick the box. Perhaps that's poor reading on my part, or a lack of documentation to that effect.

Scratch point 1 entirely. It was already on shaky ground in my mind before your post. Just point 2.
 
Last edited:

lostcalpolydude

Developer
Staff member
My guess (though it was long before my time) is that stash use was designed for people with unlimited zero karma access to get equipment that they share with clanmates, and wasn't ever considered for someone with a 3k karma limit. There is a bug here (or more than one, maybe), but it seems no one is highly motivated to figure out how to fix it. Based on looking at your profile, I'm surprised there's much you would find worthwhile to get from your stash with that limit.
 

Theraze

Active member
Inventory should win out over stash, but the stash may not necessarily be lowered below closet, storage, and other locations. For example, you can't re-storage something, but you can re-stash it if you're worried about PvP. Are we saying in your point two that the three ascots were all in pure, basic inventory as opposed to in your closet or storage or something else and it chose the stash first?

If I'm reading properly, the order in InventoryManager in the doRetrieveItem is:
Hermit's worthless token special handling and counting
Virtual item special handling and counting
Inventory
Equipped items
Familiar equipped items
Untinkering the bridge
Closet depending on settings
Free pulls from storage regardless of settings
Storage out of run depending on settings
Clan stash depending on settings
Creating the item using ingredients you own or through the mall if it's cheaper and allowed
Coinmasters depending on settings
Mall purchase depending on settings
NPC stores depending on settings
Storage in-run depending on settings
Creating the item through recursion if you have at least one ingredient

So the stash would only be if you're in-ronin and it was in your storage. That's the only time when it would make sense for the acquire code to try to retrieve the ascot...
 
Last edited:
There appears to be some kind of behaviour in the Modifier Maximizer that makes it sometimes not realize what you actually got in your inventory.

In Ronin, it happens that the Maximizer says "pull and equip" for some piece of outfit, even though this piece of outfit is already in the inventory (which Mafia knows about) and the Maximizer is only trying to equip one of.

Similarly, outside of ronin, it sometimes happens that it says something like "make and equip" even though you already have one.

When you then click on "equip all", or click on one of those lines and click on "exec selected", it does not actually pull or make said piece of equipment, but just equip it.

This could presumably be the reason why the Maximizer would suggest to "unstash and equip" elpasi's ascot. It would be interesting to know whether activating this choice would actually perform the unstash action.

Of course - just like the bug where the maximizer sometimes doesn't manage to perform all outfit changes when off-hands or disembodied hands are involved (a bug discussed heavily in the "autobasement" forum thread), i have not managed to find a clear and easy way to reproduce it. "It sometimes happens" is the best description I have for this bug now, which is completely unusable to do some serious debugging.

So, I'm throwing this forum post in just so maybe someone with more success in finding-a-way-to-reproduce-it (or maybe me at a later time) may build upon it.
 

fronobulax

Developer
Staff member
There appears to be some kind of behaviour in the Modifier Maximizer that makes it sometimes not realize what you actually got in your inventory.

I note that something causes KoLmafia to believe there are more scratch 'n' sniff swords in inventory that there really are and the Maximizer does all kinds of "bad stuff" when it thinks there are two (or more) and there is only one. So to point the finger away from the maximizer, I would see if refreshing the inventory makes this issue go away as well.
 
Top