Bug - Not A Bug Concoctions database vs two of the same ingredient

Erosion

Member
Was running my mixbot today when I found out that it will fail when trying to combine two of the same item.

Updating inventory...
Got 320 beer lens from tHE eROsIoNseEker.
combine beer lens + beer lens = beer goggles
Creation failed, no results detected.

I suspect this will also apply for any other craftable that uses two of the same item:

Updating inventory...
Got 2 spider web from tHE eROsIoNseEker.
combine spider web + spider web = really sticky spider web
Creation failed, no results detected.

Clearly it recognizes the recipe, but will refuse to actually craft the item.
 

Veracity

Developer
Staff member
Code:
> create really sticky spider web

Verifying ingredients for really sticky spider web (1)...
Creating really sticky spider web (1)...
You acquire an item: really sticky spider web
Successfully created really sticky spider web (1)

> ash craft("combine", 1, $item[spider web], $item[spider web])

You acquire an item: really sticky spider web
Returned: 1

My session log:

Code:
Combine 1 spider web + 1 spider web
You acquire an item: really sticky spider web
Crafting used 1 each of spider web and spider web

Combine 1 spider web + 1 spider web
You acquire an item: really sticky spider web
Crafting used 1 each of spider web and spider web

I have no idea what printed "combine spider web + spider web = really sticky spider web".
I see no code in KoLmafia that prints anything like that.
You are going to have to explain exactly what you did.
 

Erosion

Member
Mixbot calls this as a chat script, which pulls from concoctions.txt, and only fails vs duplicate ingredients.
 

Attachments

  • mixbotv2.ash
    3.8 KB · Views: 1

Veracity

Developer
Staff member
How odd. It calls craft().
I demonstrated that craft() works just fine with duplicate ingredients.
Ah.

Code:
                if (RECIPES[method, it1] contains it2) {
                    print(method + " " + it1 + " + " + it2 + " = " + RECIPES[method, it1, it2]);
                    int qty = min(stuff[it1], stuff[it2]);
                    craft(method, qty, it1, it2);
                    stuff[it1] -= qty;
                    stuff[it2] -= qty;
                    before[it1] -= qty;
                    before[it2] -= qty;
                }

You calculate "qty" as the smallest of count(1st ingredient) and count (2nd ingredient).
So, if you have 100 spider webs, you have enough to make 50 really sticky spider webs - but you ask KoLmafia to make 100 of them.

This looks like your bug.
 
Top