Bug - Fixed Auto adventure in "Island: Belowdecks" for "1 Talisman o' Namsilat" gives error

taltamir

Member
Auto adventure in "Island: Belowdecks" for "1 Talisman o' Namsilat" gives error

Auto adventure in "Island: Belowdecks" for "1 Talisman o' Namsilat" gives weird error. It makes it, but a weird thing is going on and it prints up an error errorlog file.

Code:
[834] Belowdecks
Encounter: gaudy pirate
Round 0: taltamir wins     initiative!
Round 0: taltamir casts SLICE!
Round 1: gaudy pirate     takes 233 damage.
Round 1: gaudy pirate drops 16 attack power.
Round     1: taltamir wins the fight!
You gain 112 Meat
You acquire an item:     gaudy key
After Battle: You gain 10 Strengthliness
After Battle: You     gain 31 Enchantedness
After Battle: You gain 7 Chutzpah

Verifying     ingredients for Talisman o' Namsilat (1)...
Verifying ingredients for     snakehead charrrm (2)...
Creating snakehead charrrm (1 of 2)...
You     acquire an item: snakehead charrrm
Successfully created snakehead     charrrm (1)
You acquire an item: snakehead charrrm
Verifying     ingredients for Talisman o' Namsilat (1)...
Creating Talisman o'     Namsilat (1)...
You acquire an item: Talisman o' Namsilat
Successfully     created Talisman o' Namsilat (1)
Unexpected error, debug log printed.
Successfully     created snakehead charrrm (-1)
[COLOR=red]Using 1 gaudy key     doesn't make anything interesting.[/COLOR]
Creating snakehead charrrm (2     of 2)...
[COLOR=red]Using 1 gaudy key doesn't make anything     interesting.[/COLOR]
Conditions satisfied after 7 adventures.
It seems like it first uses the 2 keys, then makes talisman o namsilat, then tries to use the 2 keys a second time?
 

fronobulax

Developer
Staff member
There is a similar report out there and I decided I was not going to fix it because my only idea for a fix would break things.

Basically KoLmafia will autocreate the Tailsman when it is allowed to auto create and it recognizes it has the parts. What I recall was that if the stars aligned KoLmafia would instantly create the Tailsman when the second key dropped. It does so and then control flows back to the 'adventure goal' where it again tries to create the Tailsman but now fails because the ingredients have been consumed.

I think, if the error really bothers you, you can set autocreate to true and then use 2 gaudy key as the goal. Or maybe two snakehead charms...
 

fronobulax

Developer
Staff member
Maybe the default goal should be changed to 2 gaudy keys instead of a talisman.

I was wondering about that but I haven't figured out what happens if one was already used and so there is one snakehead charm. I have a recollection I ended up with a Tailsman and one charm in that case...
 

taltamir

Member
I was wondering about that but I haven't figured out what happens if one was already used and so there is one snakehead charm. I have a recollection I ended up with a Tailsman and one charm in that case...
wouldn't using both "or" and "sum" work?
Have 1 talisman
OR
Have sum of charm's and keys equal or greater than 2.

As for the conflict with auto create thing and no clean resolution... wouldn't a check for auto create setting when hitting begin work?
If on, then call on a function that target acquiring the components as per above. If off, then call on a function that performs the crafting (current one).
 
Last edited:

lostcalpolydude

Developer
Staff member
As for the conflict with auto create thing and no clean resolution... wouldn't a check for auto create setting when hitting begin work?
If on, then call on a function that target acquiring the components as per above. If off, then call on a function that performs the crafting (current one).

Feel free to take a look at the code (should be in session/ResultProcessor.java). Multiple people have given up on it.
 

fronobulax

Developer
Staff member
http://kolmafia.us/showthread.php?22487-Tailsman&highlight=Tailsman

I'll gladly review someone else's patch but this no longer bothers me personally enough to do the research necessary to construct and verify a working patch.

I do not recall the goals syntax but if there is a goal that would stop at two keys or two charms or one of each I can't see any harm in adding it to the list. I'm not comfortable with making it the default because using it requires a user to know the a recipe for the Talisman to understand what the goal is going to accomplish (i.e. get the components but what happens next is based on the autocreate setting). The goal of Talisman will get a Tailaman and may, depending upon settings, generate a debug log. Gee, did I just make this a feature and the expected behavior? :)
 

Darzil

Developer
So, I reckon two things are going on here.
1. As you are autoadventuring, with a created item as a goal, it will create the item when you get the ingredients, and will then stop adventuring.
2. When you acquire the ingredients, regardless of how you make them, result processor will automatically create the item.

I think one (not sure which triggers first) will be needed to check if the other is going to happen, and not try.
 

Darzil

Developer
Try r18875 to stop this happening. Basically if autoCraft is set, autoadventuring won't try to create the item, and will leave it to result processor.
 

taltamir

Member
Try r18875 to stop this happening. Basically if autoCraft is set, autoadventuring won't try to create the item, and will leave it to result processor.
Tested it. It just kept on adventuring without stopping once it got the second gaudy key, and didn't craft the talisman, it didn't use the keys either so my inventory shows 2 unused keys
Code:
        [367] Belowdecks
Encounter: gaudy pirate
Round 0: taltamir wins initiative!
Round 1: taltamir executes a macro!
Round 1: taltamir casts MICROMETEORITE!
Round 2: gaudy pirate drops 31 attack power.
Round 2: gaudy pirate drops 29 defense.
Round 2: taltamir casts LUNGING THRUST-SMACK!
Round 3: gaudy pirate takes 1107 damage.
Round 3: You gain 7 hit points
Round 3: taltamir wins the fight!
After Battle: You gain 6 Beefiness
You gain 324 Meat
You gain 13 Meat.
After Battle: Statchell does the traditional "Spooky Scary Skeletons" dance. It's adorable.
[B][U]You acquire an item: gaudy key[/U][/B]
After Battle: You gain 54 Fortitude
After Battle: You gain 20 Enchantedness
After Battle: You gain 14 Smarm

Request 7 of 77 (Island: Belowdecks) in progress...

[368] Belowdecks     
Encounter: grassy pirate
...
[369] Belowdecks
...
it went until i manually aborted.

I bolded the line where it found my second gaudy key.

Incidentally, when I manually used the two keys, it immediately triggered the auto create.
Code:
        You acquire an item: snakehead charrrm
You acquire an item: snakehead     charrrm
Verifying ingredients for Talisman o' Namsilat (1)...
Creating     Talisman o' Namsilat (1)...
You acquire an item: Talisman o' Namsilat
Successfully     created Talisman o' Namsilat (1)
 
Last edited:

Darzil

Developer
Ok, I think solution is probably that we also auto-use gaudy keys with autoCraft set.

Other than that it is change to current process, any reason we don't do this?
 

fronobulax

Developer
Staff member
I'm thinking that the most important behavior is that auto-adventuring stop when the goal is met. If you are not auto-adventuring then the various possibilities can be handled manually. There is precedent for requiring the user to understand the goals they set. KoLmafia does nothing, for example, to prevent a user from setting a goal of an item that will never drop in the specified zone.

So if the Talisman is the goal and auto-create is allowed then the talisman should be created. If it is the goal and the user has not allowed auto-create then automation won't stop and the user can be "blamed" for operator error.

If my goal is one, or two snakehead charms then auto-create should use keys if allowed or fail to stop. I can argue that regardless of auto-create KoLmafia should NOT autocreate a Tailsman when two charms are present because if the user had wanted one, that would have been the goal.

If my goal is gaudy keys then auto-create is irrelevant. The goal was keys and keys will be gotten.

I think what I am advocating for is that auto-create is NOT invoked for the charms or Tailsman unless one of those items is a goal for automated adventuring.

I recognize that might be a lot of work, especially in getting all the pieces together to make the decision.

As an alternative I would accept that

a) if auto-create is off, KoLmafia does nothing with keys or charms.
b) if auto-create is on, KoLmafia will make a Tailsman if components are available and one is not already in Inventory. In this case, keys will not be touched except as a transitory step towards making the Tailsman.

I can accept that a user who sets 2 keys as a goal and has auto-create on might very well not see automation stopped until they have a Tailsman and two keys in inventory.

As I read all of this I think there is a lot of potential effort being made for a niche case so it makes sense to let the nich user manage the auto-create setting to satisfy their niche.

This will probably break a couple scripts that have special handling in this area but...
 

lostcalpolydude

Developer
Staff member
All of those ideas about how autoCraft should work seem nice, but the don't match up with the fact that you can currently steal a hemp string in pvp and end up crafting 30 bonerdagon necklaces as a result. I think it's fine to change that behavior in general, but I don't think the talisman should be a special case, outside of making the built-in goal not give an error.
 

fronobulax

Developer
Staff member
All of those ideas about how autoCraft should work seem nice, but the don't match up with the fact that you can currently steal a hemp string in pvp and end up crafting 30 bonerdagon necklaces as a result. I think it's fine to change that behavior in general, but I don't think the talisman should be a special case, outside of making the built-in goal not give an error.

Noted.

I looked at everything that gets auto created. While I miss a lot of game nuances I cannot think of any reason why more than one of any of the items needs to be auto created. Would changing autoCreate so it only created if there were none of the item in inventory solve the problem you cite and not break anything else?

AFAIK the Tailsman auto create occurs when a snakehead charm appears and there are two of them. It is not clear to me that a Tailsman would be created if there were already a snakehead charm in inventory and a gaudy key was found and nothing triggered a use of the key. But I could be missing something.
 

Darzil

Developer
Did you look at the code in KoLmafia.java that creates things that are goals? Or just the code in ResultProcessor.java that creates a talisman if you have two charms?
 

fronobulax

Developer
Staff member
Did you look at the code in KoLmafia.java that creates things that are goals? Or just the code in ResultProcessor.java that creates a talisman if you have two charms?

Basically a search on the preference autoCraft which made me decide the method autoCreate was the interesting thing so I looked at where it was used and on which items. ItemPool.GAUDY_KEY did not seem to be used anywhere in a context where mafia was explicitly using it (as opposed to an implicit use because it was a parameter) and that pretty much served as the launch pad for jumping to conclusions. I was also getting a sense of deja vu from my previous research into why there was sometimes a second attempt to create a Tailsman that generated an exception log.
 

fronobulax

Developer
Staff member
Just in case this is not the expected behavior (i.e. no recent changes)

r18897
autoCraft=true

No gaudy keys, charms or talisman in inventory.

Autoadventure Belowdecks with goal of 1 Talisman o' Namsilat

Let it run. Thought it was taking too long so manually aborted.

6 gaudy keys in inventory.

Clearly if did not use the keys when the second one dropped.
 

taltamir

Member
Tested, works now

Code:
        [1028] Belowdecks
Encounter: gaudy pirate
Round 0: taltamir wins     initiative!
Round 1: taltamir executes a macro!
Round 1: taltamir     casts MICROMETEORITE!
Round 2: gaudy pirate drops 16 attack power.
Round     2: gaudy pirate drops 14 defense.
Round 2: taltamir casts LUNGING     THRUST-SMACK!
Round 3: gaudy pirate takes 593 damage.
Round 3:     taltamir wins the fight!
You gain 206 Meat
After Battle: Statchell,     dressed as Prince George, demands that servants bring him some additional     items. (+15% Item Drops)
After Battle: Statchell does the traditional     "Spooky Scary Skeletons" dance. It's adorable.
You acquire an     item: gaudy key
Verifying ingredients for Talisman o' Namsilat (1)...
Verifying     ingredients for snakehead charrrm (2)...
Creating snakehead charrrm (1     of 2)...
You acquire an item: snakehead charrrm
Successfully created     snakehead charrrm (1)
You acquire an item: snakehead charrrm
Successfully     created snakehead charrrm (1)
Creating snakehead charrrm (2 of 2)...
Creating     Talisman o' Namsilat (1)...
You acquire an item: Talisman o' Namsilat
Successfully     created Talisman o' Namsilat (1)
After Battle: You gain 28 Strongness
After     Battle: You gain 16 Wizardliness
After Battle: You gain 6 Roguishness
You     acquire an item: Special Seasoning

Conditions satisfied after 2     adventures.
 
Top