Bug - Not A Bug Mallbroke again?

Raijinili

Member
mood: > use Knob Goblin nasal spray
Searching for "Knob Goblin nasal spray"...
Search complete.
Stopped purchasing Knob Goblin nasal spray @ 21,222.
Searching for "Knob Goblin nasal spray"...
Search complete.
Stopped purchasing Knob Goblin nasal spray @ 21,222.
You need 5 more Knob Goblin nasal spray to continue.

> search knob goblin nasal spray
Search complete.
16,803,338 @ 150 meat
683 @ 500 meat
45 @ 21,222 meat
1 @ 192,837,465 meat
1 @ 999,999,998 meat

If it matters, I couldn't afford the nasal spray at the time.
 

Veracity

Developer
Staff member
Please use descriptive phrases in the subject lines of bug reports, so we have a clue about the issue. Thanks.

What do you get when you type "ash dispensary_available()" in the gCLI?
 

Raijinili

Member
Now?
> ash dispensary_available()
Returned: true

But it's already working again. Let me try after closeting my meat.

===

With 268 meat to start:
Code:
Purchasing Knob Goblin nasal spray (1 @ 150)...
You acquire an item:     Knob Goblin nasal spray
You spent 150 Meat
Stopped     purchasing Knob Goblin nasal spray @ 21,222.
Searching for "Knob     Goblin nasal spray"...
Search complete.
Stopped     purchasing Knob Goblin nasal spray @ 21,222.
You     need 4 more Knob Goblin nasal spray to continue.
Mood swing     complete.

>     buy knob goblin nasal spray

Searching for "Knob Goblin nasal     spray"...
Search complete.
Desired purchase quantity not     reached (wanted 1, got 0)

> use 5 knob goblin     nasal spray

Searching for "Knob Goblin nasal spray"...
Search     complete.
Stopped purchasing Knob Goblin nasal spray     @ 21,222.
Searching for "Knob Goblin nasal spray"...
Search     complete.
Stopped purchasing Knob Goblin nasal spray     @ 21,222.
You need 4 more Knob Goblin nasal     spray to continue.

So it looks like an issue of one part of Mafia getting an error (not enough meat), and the other part assuming that it's because of some ridiculous pricing.
16,832,685 @ 150 meat
558 @ 500 meat
45 @ 21,222 meat
1 @ 192,837,465 meat
1 @ 999,999,998 meat
 

slyz

Developer
I suppose "get autoSatisfyWithNPCs" returns true?

The "buy" CLI command will call KoLMafia.makePurchases() directly, whereas the "use" CLI command will go through InventoryManager.retrieveItem() before calling KoLMafia.makePurchases(). I can't see anything that would cause what you are seeing though
 

Raijinili

Member
> get autoSatisfyWithNPCs
true

Well, to be sure, have you taken note that I did not have enough meat to complete the purchase?

To be clear, the command for the first sequence was, "use 5". Mafia bought one (having enough meat to do so) and couldn't get the rest (lack of funds after the first).
 

Theraze

Active member
I don't think this qualifies as any sort of bug... mafia will use the 5th lowest cost as its value if your auto-price is high enough. If actually buying, it will use the real number, but in terms of goals and multiple purchases and the like? I think the 5th price being displayed on the error message is just a feature of the anti-mallbot code...
 

slyz

Developer
Mafia uses the price of the 5th item, and that's only for things like mall_price().

The price displayed in Raijinili's error message is obtained from PurchaseRequest.getPrice(). I think it's the actual price of the item Mafia wants to buy.
 

slyz

Developer
I think I understand what's happening.

1) NPCStoreDatabase.contains() returns false when you don't have enough meat to buy an NPC item, so Mafia tries buying from the mall. It first gets the price from the first 10 shops, then KoLMafia.makePurchases() tries to buy from each of them. Since you don't have enough meat, the requests don't happen.

2) KoLMafia.makePurchases() keeps going through the results, and when it reaches one where the price is higher than your autoBuyPriceLimit, it stops with the "Stopped purchasing Knob Goblin nasal spray @ 21,222" message without even trying to run the request.

3) When you use the "buy" CLI command, isAutomated is false in KoLMafia.makePurchases(), so the "Stopped purchasing Knob Goblin nasal spray @ 21,222" doesn't appear.

There's no real problem here, it's just that the error message is confusing. And Mafia could probably avoid trying to buy from the mall an NPC item that you could buy if you had enough meat. PurchaseRequest has the canPurchaseIgnoringMeat() function, maybe it can be used in NPCStoreDatabase.contains() instead of canPurchase().
 
Top