Bug - Waiting for Info KolMafia unable to execute between battle actions, can't figure out why

I'm grinding out the island quest and had automation setup between moods and a custom combat script to pound through 100-odd adventures killing frat folk. At some point, however, kolmafia got "stuck", such that it's no longer doing the between battle commands (healing me, and/or executing moods to burn excess MP), and I can't figure out why. I've got "Run AfterAdventure", "Run betweenBattleScript", "run moods", and "maintain health" between manual adventures all turned on. the only message I get in the CLI (and debug log, after I turned that on when running into this), is "KoLmafia declares world peace.". I can manually adventure fine - although manul adventures display the warning page "Between battle actions failed. Click the image if you'd like to continue anyway.", and I've got plenty of mp to cast the various spells for healing at whatnot. I also thought something went funny with my session, so I logged out of kolmafia, logged back in, and have the same problems. My next thought is to crack open the code for wherever that "declares world peace" message is coming from, but figured I'd ask first in the hope I'm missing something stupid/obvious (and if so, crap, my apologies). Attached is a debug log snippit of me doing manual adventures and clicking through the failure - automation won't even start because of the failure to do the between battle stuff. Any thoughts on how to fix this? I'm of course happy to do whatever debugging you recommend.
 

Attachments

  • DEBUG_20120601.txt
    218.9 KB · Views: 62

Veracity

Developer
Staff member
What are the "between battle actions" you have selected?

- What, exactly, is your "before battle script"?
- What, exactly, is your mood?
- What, exactly, are your HP recovery settings?
- What, exactly, are your MP recovery settings?
 

Veracity

Developer
Staff member
Other than aborting a script, the only place KoLmafia calls RequestThread.declareWorldPeace is MoodTrigger.execute() when it tries to execute a skill and gets an error message in UseSkillRequest.lastUpdate. Since your debug log does not show an actual request being submitted, it appears that UseSkillRequest.run() is aborting with an error - but is not actually printing the error - before submitting a request.

Right off hand, I can't pinpoint where that would happen without any error message getting printed, although it can fail in a number of ways. For example, if your mood includes an AT, SA, or TT skill and you don't have an appropriate weapon, it will abort before casting the skill.

I repeat: let's see your mood.

Thanks.
 
Other than aborting a script, the only place KoLmafia calls RequestThread.declareWorldPeace is MoodTrigger.execute() when it tries to execute a skill and gets an error message in UseSkillRequest.lastUpdate. Since your debug log does not show an actual request being submitted, it appears that UseSkillRequest.run() is aborting with an error - but is not actually printing the error - before submitting a request.

Right off hand, I can't pinpoint where that would happen without any error message getting printed, although it can fail in a number of ways. For example, if your mood includes an AT, SA, or TT skill and you don't have an appropriate weapon, it will abort before casting the skill.

I repeat: let's see your mood.

Thanks.

lessie... moods:

:~/.kolmafia/settings$ more irontetsubo_moods.txt
[ apathetic ]

[ default ]
lose_effect astral shell => cast 1 astral shell
lose_effect empathy => cast 1 empathy of the newt
lose_effect fat leon's phat loot lyric => cast 1 fat leon's phat loot lyric
lose_effect leash of linguini => cast 1 leash of linguini
lose_effect rage of the reindeer => cast 1 rage of the reindeer
lose_effect seal clubbing frenzy => cast 1 seal clubbing frenzy
lose_effect springy fusilli => cast 1 springy fusilli

hitting execute in the mood tab indeed gets me "KolMafia declares world peace.", then "Mood swing complete."

I tried to go cast the skills in the skill casting tab, and after a server refresh, it's working again. Heh. In the time between my post and now, my session timed out, and doing the refresh got it back on track - but (I swear!) I tried logging out/back in before when having the issue, and also was manually adventuring fine, just couldn't do the between battle actions.

For completeness's sake, what else you requested:

- What, exactly, is your "before battle script"?

none, just had the pref checked. I don't have any scripts in my scripts folder.

- What, exactly, is your mood?

above.

- What, exactly, are your HP recovery settings?

stop automation at 20%, auto-recover at 80%, try to recover up to 100%, and I've got Cannelloni Cocoon, Tongue of the Walrus, and Lasagna Bandages checked (and I have the first two skills, not Lasagna Bandages).

- What, exactly, are your MP recovery settings?

mana burning - start recasting immediately, recast to 75%, do not auto-recover mana, recover up to 30%.

Well, bummer - anything else to look at, or chalk this one up to a fluke and move on?
 
Oh, wait, crap. I think I see the problem - I don't have seal clubbing frenzy (had the mood from a prior run), yet I've got it defined in the mood. Oddly, though, now that it's unstuck, I can adventure successfully with this mood. :) If nothing else, I would respectfully request to change my bug report to ask for some sort of error message saying hey, you don't have this skill (and that still doesn't explain why it's working again now with frenzy still in the mood).
 

Veracity

Developer
Staff member
Revision 11062 will print an extra message before the mood manager declares world peace. It will be something like:

Mood failed to cast 1 astral shell: some error message

Perhaps this will help if you ever see this again. Until then, I am tagging this Cannot Reproduce.
 
Yup, now I can adventure again without error, but despite the fact that I've got the same prefs checked (execute mood between manual adventures), it's not executing any of the mood at all - no messages about mood at all in the console, either. It is properly healing me:

You gain 12 Smarm
You gain a Moxie point!
1 frat boy defeated; 417 down, 583 left.
Casting Cannelloni Cocoon 1 times...
You gain 168 hit points
Cannelloni Cocoon was successfully cast.

[1598] Battlefield (Hippy Uniform)
Encounter: War Frat 500th Infantrygentleman
Round 0: irontetsubo wins initiative!
 

Veracity

Developer
Staff member
And now I see your followup.

Well, interesting. I see that UseSkillRequest.run() returns immediately if you don't have the skill without setting an error message. You'd think it should set an error message...
 

Veracity

Developer
Staff member
OK. Revision 11063 will set an error message if UseSkillRequest is given a skill that you do not know.

> mood execute

Mood failed to cast 1 Seal Clubbing Frenzy: You don't know how to cast Seal Clubbing Frenzy.
KoLmafia declares world peace.

Mood swing complete.

I predict that somebody will complain about this: "I want to make one set of moods for all of my characters to share which lists every skill that any character knows and have it silently ignore skills that a particular character doesn't know."

To which I reply: "I respectfully suggest that you will be better off having a separate mood file for each character, customized to that character."
 
OK. Revision 11063 will set an error message if UseSkillRequest is given a skill that you do not know.



I predict that somebody will complain about this: "I want to make one set of moods for all of my characters to share which lists every skill that any character knows and have it silently ignore skills that a particular character doesn't know."

To which I reply: "I respectfully suggest that you will be better off having a separate mood file for each character, customized to that character."

okay, perfect - that did the trick, I'm now correctly getting an error:

Mood failed to cast 1 Seal Clubbing Frenzy: You don't know how to cast Seal Clubbing Frenzy.
KoLmafia declares world peace.
Validating adventure sequence...

Mood failed to cast 1 Seal Clubbing Frenzy: You don't know how to cast Seal Clubbing Frenzy.
KoLmafia declares world peace.

Thanks!
 
I predict that somebody will complain about this: "I want to make one set of moods for all of my characters to share which lists every skill that any character knows and have it silently ignore skills that a particular character doesn't know."

/me raises his hand

To which I reply: "I respectfully suggest that you will be better off having a separate mood file for each character, customized to that character."

Gah. Really, I've never had the issue that prompted this post. I considered it a feature that mood manager would silently skip skills I didn't have. Now all those lines will have to be predicated with if(have_skill($skill[someskill])). This has profound implications on any existing script that currently does anything with your mood.

I could live with just the error msg in the gCLI but not stopping automation, which is much closer to the original behavior.

The real question here should have been why isn't mood manager skipping Seal Clubbing Frenzy, but I guess that's all moot now.
 
Last edited:
I said that already, and you completely missed the larger point. This check wasn't necessary before and imho the wrong thing "got fixed".
 
Last edited:

Veracity

Developer
Staff member
This is why I, mostly, stopped responding to bug reports; I simply don't have time for this kind of discussion anymore. Fortunately, we have other developers, and perhaps one of them will take an interest, will discuss this, and will change - perhaps revert - things to suit everyone's taste.

That person will not be me. As of today, I'm only making changes to this program that affect me, personally.
 

Bale

Minion
That person will not be me. As of today, I'm only making changes to this program that affect me, personally.

Please don't take this the wrong way, but you keep saying this. You've been saying this for a few weeks now. We get it already. We do not believe that you are required to fix everything. We also don't believe you need to tell us that you are not fixing everything. We know you are only fixing the things you find fun. Other people are definitely stepping up to fill your very large shoes.

Please chill out and stop being stressed by a perceived need to fix every bug.
 
Last edited:

Veracity

Developer
Staff member
You say I have big feet? ;)

I've actually been saying it for months - and putting my money where my mouth is. Or is it my feet where my mouth is?

I'm tired.

Edit: I know I don't need to fix every bug. I believe that in this bug report, I was just saying that even though I just - according to Weatherboy - inserted a bug, I will not be looking any more at this specific issue. Well, I did generalize, since Weatherboy pissed me off (using bold for emphasis, unnecessarily, just like he did.) But I was mostly intending to say that I will not be working on the new "bug" that I supposedly inserted - or even discussing it further.

I regret that I got involved. I am considering just backing out what I did and letting other people decide what they think the "right" solution to the bug report is.
 
Last edited:

fronobulax

Developer
Staff member
While I respect weatherboy's opinion, I would not want this change reverted. It actually solved a couple of puzzling things I was seeing and could not explain. I have not seen any reports of broken scripts or proactive script writers posting updates so I have to believe this is a case where there is a vast gulf between what is possible and what is probable. I have been on the wrong side of that gap too many times.
 

Theraze

Active member
As I understand it, the behaviour changing is mainly to help us be aware of why it was aborting before in a consistent way. As such, there is no "new bug" created... just better reporting on why mafia aborts sometimes. :)

Having mafia abort when you tell it to do something that you can't do isn't a bug... it's good coding. Just like how having it warn you when you have boolean functions returning non-booleans is also a good coding issue.
 
Last edited:
Top