Feature Always show price for mall items in maximizer

I noticed an interesting quirk as I learned more about the maximizer setup - it would only show mall prices for items when you specified a maximum price (and of course chose pullable/buyable and can buy stuff from the mall). I would find it more useful to always show the price of the mall item when the maximizer is suggesting one, so as to give me some context as to the consequence of hitting "execute". I've got a patch to do this (I think, see below), but I have not yet tested it because I'm still in ronin. So, figured I'd at least get this out there to discuss, and if it makes sense I'll dig into it further once I can fully test it, or if a dev gets really excited about it and they take a look even better. :)

Code:
### Eclipse Workspace Patch 1.0
#P kolmafia
Index: src/net/sourceforge/kolmafia/swingui/MaximizerFrame.java
===================================================================
--- src/net/sourceforge/kolmafia/swingui/MaximizerFrame.java	(revision 11363)
+++ src/net/sourceforge/kolmafia/swingui/MaximizerFrame.java	(working copy)
@@ -939,19 +939,19 @@
 									: "acquire & " + text;
 							}
 						}
-						if ( priceLevel == 2 || (priceLevel == 1 && count > 0) )
+						if ( price <= 0 && KoLCharacter.canInteract() &&
+								ItemDatabase.isTradeable( item.getItemId() ) )
 						{
-							if ( price <= 0 && KoLCharacter.canInteract() &&
-								ItemDatabase.isTradeable( item.getItemId() ) )
+							if ( priceLevel == 2 || (priceLevel == 1 && count > 0) )
 							{
 								if ( MallPriceDatabase.getPrice( item.getItemId() )
 									> maxPrice * 2 )
 								{
 									continue;
 								}
-
-								price = StoreManager.getMallPrice( item );
 							}
+							
+							price = StoreManager.getMallPrice( item );
 						}
 						if ( price > maxPrice ) continue;
 					}
 
hmm. I already found a place where I missed stuff on my patch (this just gets items, not equipment). :) So, please ignore the patch for now, just let me know if the feature is worth it or not. Sorry about that.
 

Theraze

Active member
The benefit of not showing mall price on the "I really really don't care" version is that you can run it during combat or whenever else. Also, if you've told it that you don't care about how much it will cost... you're hopefully doing it because you really don't care how much it will cost. :)
 

fronobulax

Developer
Staff member
I have not looked at this in detail, but if I understand correctly I think I like it.

When basement diving, using the relay browser, mafia shows me prices and I can pick and choose which items are worth it to me at the moment. I always wished the maximizer would do something similar. I understand that it currently does, but only if I have asked to see prices under a certain value. To get what I want the price would be 999,999,999 (or whatever). However I also would find price information useful even if the item is already in hand because that helps me avoid inadvertently consuming something I'd rather not.

I'm not sure I understand the point about "in combat" but if using historical_price would address it, I'd be fine with that. If the point is just cluttering up the display with information that is not immediately usable then I like that and think in this case it would be a feature, not a problem.
 

Theraze

Active member
Yes... the question is if the maximizer is smart enough to switch to historical_price if you're in combat. If so, great... more info isn't a bad thing.
 

Veracity

Developer
Staff member
What is the point of calling the maximizer in combat? You cannot change equipment or use items there.

- Open the maximizer frame, tell it to maximize, cool. You can't execute anything it shows you, though.
- Call the maximize() function from a consult script - won't work for the same reason.

Therefore, why should the maximizer have any special behavior depending on whether you are in combat or not? Other than refusing to actually execute anything, perhaps.
 

Theraze

Active member
You can't actually make the change until after combat, but if you're looking at a monster and decide you want to be able to look at the monster stats while you're maximizing your defensive stat...
 

Theraze

Active member
Yes, since the maximizer function already allows setting the max price you'd like it to consider, there's no change being proposed there... correct? The "boolean maximize( string expression , int max_price , int price_level , boolean simulate )" version should allow for setting max_price to whatever you'd like it to consider already...
 

Winterbay

Active member
Can you get the maximizer function to show you prices as it is today? It thought that was only the frame.
 

Theraze

Active member
Can't show prices, but you can set a max price for its suggestion. This whole FReq though is about making prices show on the frame even if you don't have it limited to aBPL.
 

roippi

Developer
I'd prefer a little less liberal application of this than "always". Certainly when in a run I don't care about mall prices.
 

roippi

Developer
I'd prefer a little less liberal application of this than "always". Certainly when in a run I don't care about mall prices.
 
I should clarify - it would only show prices when the suggested action is "acquire", i.e., get something from the mall. So if you don't choose the "pullable/buyable" radio option, you will unsurprisingly never see prices. If you choose that option (to get stuff from hagnks) but aren't out of ronin (i.e., can't get stuff from the mall), then again, unsurprisingly you'll never see a price.

the current behavior is when the suggested change is "acquire", and you've specified a price limit via the max price field, then display the cost along with the change. My suggestion is to tweak that so when the suggested change is "acquire", always display the price regardless of whether or not you've set a limit (and of course if you do set a limit, that should apply, that part of the behavior is unchanged). The reasoning on my part is even when I "don't care" how expensive something is, I'd always prefer kolmafia to inform me of the consequences of my actions. It also helps because sometimes there are reasonably priced things in the mall that pop up from the maximizer, and sometimes there are 100m+ items that I can't afford, and without a price I have no idea which an item is without going to the mall/wiki.

Hopefully that helps clarify? It seems like there's enough interest that either way, I'll finish up my patch and of course you all can review and make a call...
 
Top