Bug - Not A Bug Acquire buying when have ability to make

DawsonBeverly

New member
I'm not actually sure this is a bug or that it's an issue with native mafia and not a script of some kind, or user error. :(
Searching for acquire didn't find anything so I hope I'm following the procedures correctly here.

v16.0 r12906

Purchased a bunch of mummy wrappings in order to make gauze hammocks to send to the hotdog bot. Used the "acquire" command. Instead of using the wrappings I already had, or even buying more wrappings, it just purchased all the hammocks at painful prices.

> acquire 271 gauze hammock

Refreshing stash contents...
Stash list retrieved.
Searching for "gauze hammock"...
Search complete.
Searching for "mummy wrapping"...
Search complete.
Using cached search results for gauze hammock...
Purchasing gauze hammock (50 @ 3,200)...
Purchasing gauze hammock (5 @ 3,200)...
Purchasing gauze hammock (10 @ 3,300)...
Purchasing gauze hammock (94 @ 3,300)...
Purchasing gauze hammock (3 @ 4,999)...
Purchasing gauze hammock (109 @ 8,500)...
Purchases complete.
 

Darzil

Developer
Current market value seems to be around 545/mummy wrapping. 5th price (which I think is what mafia uses?) is 649.

So mafia would (I think) value your stock at 649 each, so would buy gauze hammocks at below 6490. I'm not sure why it bought at 8500, I suspect that means mafia doesn't recheck the prices once it has decided to buy from mall, which would usually be right.
 

Winterbay

Active member
If you want to force mafia to use the ones you have on hand I think you need to use "create" instead. "Acquire" will try to be smart and cost efficient about its creation process and thus it found it cheaper to buy the items (given that you sell the wrappings you have in the mall).
 

Veracity

Developer
Staff member
That is correct. If you can sell 10 mummy wrappings for more than it costs to buy a gauze hammock, it is theoretically more profitable to sell the mummy wrappings and buy the hammock.

I say theoretically, because the mall is unreliable.

What you describe is how "acquire" is supposed to work. Winterbay is correct: if you want to force KoLmafia to create, rather than attempt to be clever about whether it is better to buy or create, use "create".

If "acquire" decides that "10 times the cost of a mummy wrapping is the limit to spend on a gauze hammock", then it should not buy any that are more expensive than that - and if it did so for you, that looks like a bug.

But, "Acquire buying when have ability to make" is not a bug. It is intended behavior - and the solution, if you don't like it, is "don't use acquire when you should use create."
 

Veracity

Developer
Staff member
If "acquire" decides that "10 times the cost of a mummy wrapping is the limit to spend on a gauze hammock", then it should not buy any that are more expensive than that - and if it did so for you, that looks like a bug.
InventoryManager.retrieveItem():

Code:
			KoLmafia.makePurchases(
				results, results.toArray(), InventoryManager.getPurchaseCount( itemId, missingCount ), isAutomated );
The full version of KoLmafia.makePurchases has one additional parameter: priceLimit. This will make it stop buying if the next thing to buy would exceed that. InventoryManager.retrieveItem could use that, but it would need a fair amount of refactoring to remember the price to make. It currently just uses InventoryManager.cheaperToBuy, which uses InventoryManager.priceToMake - which is likely what is needed.

Somebody with a lot of patience should look at it; InventoryManager.retrieveItem is complicated.

Other than that, the original report is Not A Bug.
 
Top