Why does kolmafia always buy items before checking closet, display, and stash? o_O

t4kato

New member
Whenever I use a CLI command to acquire, equip, use, etc. an item, it buys the item with highest priority and only checks the others optionally... That seems silly. Is there an option to place things in priority? Or am I just missing something.

In fact, when kolmafia has to acquire an item when I don't command it to (like during a quest or something), it DOES withdraw from closet/display first, before going out to get it. Why isn't this functionality extended to other cases?
 

Theraze

Active member
Can you please give some specific examples? It's a mite difficult to judge the way the code works for "whenever etc happens" if you know what I mean. :)
 

Veracity

Developer
Staff member
Ditto. It doesn't work that way for me.

Can you explain exactly what you have "in closet, display and stash", exactly what you did to "acquire, buy, or use", and exactly what happened - and why you think it was wrong?

I mean, if you say "buy", then, well, duh - you are TELLING it to buy stuff. Obviously it won't refuse to do that just because you have some of the item already. But, in my experience, "acquire" will look in closet (if you have "use items in closet" set) and stash (if you have pull items from stash set). Display? Nope. Personally, I would consider it a bug if KoLmafia removed items from my display for any reason whatsoever, unless I was specifically telling it to loot my display case.

Thanks.
 
Last edited:

t4kato

New member
Ok sure. I'll give some current examples.

I just typed into CLI: "equip tuxedo shirt". There is one tuxedo shirt in my closet and one in my display case. The CLI went to the mall, bought the cheapest tuxedo shirt, and equipped it.

On a separate occasion, I told the CLI to: "maximize items". Responding to this command, the CLI went through my display case and closet to maximize instead of going to the mall (which would obviously be foolish since there could be exorbitant priced items that give item boost).

Obviously there is better reason for the latter command to check what you already have, but it seems that the code for the first command should also check what you have (especially if you have the option to buy from mall unchecked in preferences). This seems like a good preference setting to add, no?
 

lostcalpolydude

Developer
Staff member
I tried testing "equip tuxedo shirt" after putting the one I had in my closet. Mafia didn't buy one from the mall (I have that turned off), and it didn't pull from my closet. Instead it spent a turn crafting one. Not really the result I would ever want automatically done.

Once I figured this out, I hid all the ingredients for making it in my mall store, checked that mafia couldn't create it any more (Creatables section in Item Manager), then used "equip tuxedo shirt" again, and mafia did nothing (as I would expect). If mafia bought one from the mall, it's because you had mall buying on, or something else weird was going on.

The maximizer command seems kind of scary to run when it could easily use up expensive items (using expensive items you already have is no better than buying expensive ones to use), unless there are good ways of limiting it that I've overlooked. Using the Modifier Maximizer window is a bit safer since you can see everything mafia wants to do before any of it happens.
 

Veracity

Developer
Staff member
The "equip" command uses InventoryManager.retrieveItem to fetch things. That uses storage (if available and you are out of Ronin), the closet (if you have that preference set), the clan stash (if you have that preference set), the mall (if you have that preference set). It will attempt to craft the item, before buying one, unless you have a "buy script" that says not to do so.

Note that I listed three preferences there:

- The "use items from closet" preference is off by default and is a checkbox in the Creatable panel of the Item Manager
- The "use items from stash" preference is off by default and is a checkbox in the General panel of Preferences
- The "buy items from mall" preference is off by default and is a checkbox in the General panel of Preferences

There is no preference to allow access to the Display Case. No cli command - including eat, equip, or maximize - will pull items from the Display Case. Neither will the Modifier Maximizer GUI.

Given all that, I am unable to reproduce your report. Here is gCLI output showing various equip commands. I have "buy from mall" turned off. I put an item in the closet, twice, and tried using it. The first time, I had "use closet" turned on, and it pulled it from the closet. The second time, I had "use closet" turned off, and it did not.

> equip battered hubcap

Pulling items from storage...
Holding battered hubcap...
Equipment changed.

> unequip battered hubcap

Taking off battered hubcap...
Equipment changed.

> closet put battered hubcap

Placing items into closet...
Requests complete.

> equip battered hubcap

Removing items from closet...
Holding battered hubcap...
Equipment changed.

> unequip battered hubcap

Taking off battered hubcap...
Equipment changed.

> closet put battered hubcap

Placing items into closet...
Requests complete.

> equip battered hubcap

You need 1 more battered hubcap to continue.
 

t4kato

New member
Try using the "maximize ..." command. It'll attempt to pull from display. Couldn't this be replicated with a option added in the preferences?
 

Theraze

Active member
There is no preference to allow access to the Display Case. No cli command - including eat, equip, or maximize - will pull items from the Display Case. Neither will the Modifier Maximizer GUI.

So, you're (t4kato) disagreeing with this? Could you please give at least a session log showing this happening?

Edit: Looking at swingui/MaximizerFrame, lines 431-434 are inventory, 435-440 are the closet, 441-446 are storage/pullable, 448-451 would be creatable, 452-458 would be NPC store buyable, 459-464 would be foldable (Mr. Store) items, 465-470 are storage/pullable (again?), 471-478 are the mall store. That's it... no display case code I can find there. -_-
 
Last edited:

Veracity

Developer
Staff member
I don't believe you. I looked at every single call of a DisplayCaseRequest in the source tree, and MaximizerFrame.maximize (which is called by the "maximize" command) doesn't call any of them. The MaximizerFrame doesn't ever look at your display case collection.

The code doesn't lie, but to verify it, I pulled my Brimstone Boxers from my display.
The Maximizer Frame saw their 50% Moxie bonus and suggested I use them for +169 moxie when I said maximize Moxie.
When I put them back, it suggested I use hardened slime pants (from storage) for +69 moxie.

I have no idea what you think you are seeing, but the maximize command does not and cannot pull things from your display case, as currently coded.
 

t4kato

New member
Oh you're right. I was mistaken about it being able to withdraw from the display case. Looking back on my logs, all instances that I took as withdrawing from the display case were actually withdrawing from stash. o_O

Nevertheless, it seems odd, as noted by lostcalpolydude, that maximize seems to bypass normal preference settings. (Although it's not as scary as you think because it only changes equipment, not the full range of functionality present in modifier maximizer.)

Though, thank you for the tidbit about permitting closet access through the option under Creatables. It still puzzles me why this isn't in General right alongside "take from stash" and "buy from shops." A "take from display case" option would also be welcome in the same way.
 

Veracity

Developer
Staff member
The maximize command does not "bypass normal preference settings". He noticed that it ignored the item in his closet, but did not mention that he had the "use items from closet" preference unchecked - and it was, therefore, correct to ignore it. He commented that he did not like the fact that it crafted the item, but that, again, is just how the "acquire" command works: it will craft before buying from the mall.

I don't have time in my life, at the moment, to spend on discussions/investigations like this. Thanks for admitting that the "display case" thing was a false report, but can you give me back the time I wasted?

Sheesh.
 

t4kato

New member
Fine, here's your wasted time and my apologies. [TIME]

It's not like I was trying to help streamline the interface by pointing out apparent discrepancies or anything. I'm sorry I'm too nooby to help. And thus am not allowed to receive any.
 
Last edited:

fronobulax

Developer
Staff member
" A "take from display case" option would also be welcome in the same way.
No. Just No.

Fine, here's your wasted time and my apologies. [TIME]
That was uncalled for.
It's not like I was trying to help streamline the interface by pointing out apparent discrepancies or anything. I'm sorry I'm too nooby to help. And thus am not allowed to receive any.
I find it hard to have much sympathy for your alleged ignorance when you insisted at least three times that items were being pulled form the DC and then casually threw out that you were mistaken. Your attitude does not come across as nooby as much as it comes across as someone who is way too sure that they are right and everyone else is wrong.

I didn't really see any request for help so your assertion that you are not allowed to receive any doesn't make any sense.

For future reference if you are saying something "doesn't work" then just help us help you by telling in some detail what you did, what you expected and what happened instead. If you are making a suggestion then feel free to continue. The worst that will happen is that no one will think it is a good enough idea to actually invest time in implementing it. And one final hint - the names of things in KoL and KoLmafia often have precise meanings above and beyond plain English. Thus the display case, inventory, closet and clan stash are all different. Your initial post where you said "closet/display" certainly blurred the distinction that needed to be made to understand your comment.
 

t4kato

New member
I find it hard to believe that apologies are uncalled for, in response to criticism. And if you find my sincere, though curt, admission of my mistake regarding the display case insufficient. I again apologize fully for that mistake, which I admit was an egregious though unintended oversight. There was some miscommunication there because I was more concerned with things I believed were discrepancies. For future reference, I will keep in mind I must have prescient knowledge of my mistakes to post here.

Please take your lack of sympathy elsewhere. I find it disheartening.
 
Last edited:

Theraze

Active member
It's more a natural response to a very sarcastic response made to one of the official developers who was asking for you to please give specific and accurate information, instead of the vague and just pure wrong information you gave in your first three posts, until we went to the code to verify that what you were reporting (three times) was impossible... Then you once again reported incorrect information, saying that maximize bypasses settings... again Veracity pointed out that wasn't true.

There's a different between noob and lying... :) Intentional or not, you gave wrong information 4 posts in a row...
 

t4kato

New member
If I was intentionally lying, then I agree what I did would have been awful. But mostly I was just very confused by the mixed signals it seemed to be giving me. Being confused and seeking clarification help is ok, no? I don't feel I deserve the verbal abuse. I'm sorry if you all spent more time than you hoped to, straightening out my elementary mistake. Thank you all greatly for taking the time to help in the first place, however.

I appreciate your reasonable response compared to frono's, Theraze.
 
Top