Bug - Won't Fix acquire makes sauceror potions sometimes when it is cheaper to simply buy them.

Veracity

Developer
Staff member
Current market for milk of magnesium

limit 1 @ 100
limit 1 @ 100
limit 150 @ 911

So, if I "acquire 1 milk of magnesium", it can get one for 100 in the mall.
Alternatively, it can create 3 of them from 1 scrumptious reagant and 1 glass of goat's milk.

Verifying ingredients for milk of magnesium (1)...
Using cached search results for scrumptious reagent...
Purchasing scrumptious reagent (1 @ 950)...
Purchases complete.
Using cached search results for glass of goat's milk...
Purchasing glass of goat's milk (1 @ 1,500)...
Purchases complete.
Creating milk of magnesium (1)...
You acquire milk of magnesium (3)
So, for 2,450 + 1 free craft I got 3 milk of magnesium, or 817 each. That is cheaper than the third cheapest cost - but I only wanted one. Heck, even if I'd wanted 3, it should have bought them all in the mall.

Note that my pastamancer multi with Advanced Saucecrafting is also capable of creating milk of magnesium, but "acquire 1 milk of magnesium" will always simply purchase one for 100.
 

lostcalpolydude

Developer
Staff member
Maybe it's using the 5th cheapest price, the same way mall_price() uses that? Just a guess, since I haven't looked at that code in a while.
 

Veracity

Developer
Staff member
Given that it's internal code, I thought it uses actual prices, but maybe not.
Investigation will be required to figure out what the heck it is doing.
 

Crowther

Active member
Not that KoLmafia knows it until after making the decision, but. . .
Code:
You are on this shop's ignore list (#2158403). Skipping...
I'd suspect most active players have been ignored by the 100 meat store. Hmmm, or maybe not, since the store's text now says,
Ignored? Kmail me (through a friend or a multi) and I'll ig-ignore you.
Maybe the policy changed.
 

Veracity

Developer
Staff member
Heh. Yeah, I saw that, but I assumed that the purpose was to find more players (i.e., friends or multis) that he hasn't ignored yet. I have two multis that he hasn't yet ignored, and I don't want them to lose access to his 100 Meat milk.

Do you have any idea why he has ignored so many people? I am sure that he never sent me a note explaining it before he did it.
 
Do you have any idea why he has ignored so many people? I am sure that he never sent me a note explaining it before he did it.

I'd guess because of the PVP Season 3 Mystery Contest (number of different items in your mall store priced at 999 Meat or less). That one caused quite a few people to baleet the entire kingdom.
 

Darzil

Developer
I've also been ignored from cheap stores for buying from them too many times in a day, as they like a short store log, and automated mafia purchasing may not buy in bulk
 

Bale

Minion
Seriously? That's so dumb. They should just be glad to sell their junk. Stupid anti-raffle nonsense.
 

Veracity

Developer
Staff member
Ran in Eclipse and stepped through the "acquire" process.

Cenam's store has milk of magnesium at 100. It correctly calculated the cost of making 3 milks of magnesium and saw that one was more expensive than Cenam's price, so it bought from Cenam.

Which is correct.
 

Veracity

Developer
Staff member
Ah.

Code:
		int mallPrice = StoreManager.getMallPrice( item, 7.0f ) * quantity;
It is looking for the mall price of the item and will accept a cached price up to 7 days old. Which is to say, if the last cached price is more than 100 - even though there is somebody offering it for 100 right now - we will use the cached price.

Personally, I'd prefer that it only accept a cached age that is "since I started this session".

Makes me want to look at how we use the MallPriceDatabase. I am getting Unhappy results because I am using it, I think.
 

Veracity

Developer
Staff member
Currently, my script does this:

Code:
// Get the current price so that when we want to "acquire" some, we'll
// buy it, rather than make it, if it is cheap enough.
int magnesium_price = mall_price( $item[ milk of magnesium ] );
int reagent_price = mall_price( $item[ scrumptious reagent ] );
int milk_price = mall_price( $item[ glass of goat's milk ] );
Note that although mall_price() returns the price of the 5th cheapest item, KoLmafia is caching the actual mall search results and will use the REAL cheapest price in "acquire".

Near as I can tell, acquire (InventoryManager.retrieve_item) is the only place in KoLmafia that is willing to use up-to-seven-days-old prices for items. This is the whole point of the "mall price database", whereby we share "recent" prices; it keeps KoLmafia from automatically hitting the server every time "acquire" wants to decide how expensive something is.

A script using mall_price() will flush/refresh the prices, nullifying that. If a script doesn't do that, the user can be surprised that KoLmafia is creating something, even though it is cheaper to buy it - just because it wan't cheaper to buy something last time somebody shared mall prices.

Now that my script knows what to do, I will not be burned by this any more. Instead, I will force three server hits, specifically to make sure that I don't spend (a few thousand) Meat making things that I should buy for 100 Meat. Looking at it from MY viewpoint, what is the cost of three mall searches - to ME?

Pondering.
 

fronobulax

Developer
Staff member
I have been burned by historical prices in a different context. My solution, since I am already iterating over items anyway, is to force a price update for any item where the historical price is "too old". I ease my guilt about server hits by making sure I share mall prices.
 

Veracity

Developer
Staff member
I'm going to mark this Will Not Fix.

Not a Bug might be appropriate, since it is behaving exactly as coded (KoL admin joke, there;) ). But, the fact that we will use prices up to a week old to decide whether to buy something is troubling. Also the fact that users have no control over this aspect of "acquire"; you cannot disable it or change the threshold of how old the prices can be before you need to go get an update. Heck, I think I'd be OK with "check the first time in a session and use that for the rest of the session", but that would eliminate any benefit from our sharing of mallprices.

In any case, my personal workaround, described about, for, specifically, milk, has that effect for my script, so any personal urgency and/or irritation is gone.
 
Top