Winterbay's Helpful Automatic Monsterbasher (WHAM)

I have both lightning bolt AND healing salve in my blacklist.

Yet WHAM consistently uses them.

What am I doing wrong?

EDIT: Found the flaw in Lightning Bolt. Apparently, it automatically adds the Heavy Rains version instead of the Deck version. I had to muck about with skill numbers.
 
Last edited:
I just got this interesting error:

Code:
[19089] Crimbo's Hat
Encounter: angry viking warriors
Strategy: C:\...\KolMafia\ccs\default.ccs [default]
Round 0: ililili wins initiative!
Round 1: ililili executes a macro!
Round 1: ililili tries to steal an item!
You acquire an item: negative lump
You gain 30 Meat.
Round 2: angry viking warriors takes 101 damage.
Round 2: You lose 105 hit points
WHAM: Running SmartStasis
Round 2: ililili executes a macro!
IOException during data post (fight.php?action=macro&macrotext=scrollwhendone%3B+sub+batround%3B++if+pastround+24%3B+abort+%22Stopping+fight+because+it+has+gone+on+for+too+long+%28set+WHAM_maxround+to+a+higher+value+if+you+think+this+was+in+error%29%22%3B+endif%3B+endsub%3B+skill+4034%3B+call+batround%3B+skill+7273%3B+call+batround%3B+).
WHAM: Starting evaluation and performing of attack
WHAM: Enqueuing a stun to help with the battle
WHAM: We are going to 2-shot with Rain-Doh blue balls and Saucegeyser.
Round 2: ililili executes a macro!
IOException during data post (fight.php?action=macro&macrotext=scrollwhendone%3B+sub+batround%3B++if+pastround+24%3B+abort+%22Stopping+fight+because+it+has+gone+on+for+too+long+%28set+WHAM_maxround+to+a+higher+value+if+you+think+this+was+in+error%29%22%3B+endif%3B+endsub%3B+use+5560%3B+call+batround%3B+skill+4012%3B+call+batround%3B+).
Round 2: ililili executes a macro!
IOException during data post (fight.php?action=macro&macrotext=abort+%22WHAM%3A+Critical+error%3A+An+empty+macro+was+generated.+Please+report+this+in+the+WHAM+thread+of+kolmafia.us.%22).
WHAM: Critical error: An empty macro was generated. Please report this in the WHAM thread of kolmafia.us.
You're on your own, partner.
Click here to continue in the relay browser.

using r17632
 
Bug: WHAM does nothing in the Protector Spectre fight, when called through automation. When called via the relay browser, it then works.

Looks like this is a bug in WHAM. See http://kolmafia.us/showthread.php?2...eet-the-protector-spectre&p=143609#post143609

Any chance this is the issue I've reported where SmartStasis finishes or gives up and then WHAM doesn't know what to do? In my case I am comfortable pointing a finger away from WHAM because it happens with SimpleSmack as well.

To be clear, the issue with the protector spectre is that it stops automation and leaves you on your own as opposed to not even starting the encounter, correct?
 
Does it work if you use a mafia build before or at r18096?

I'll check when I hit it next ascension.

Any chance this is the issue I've reported where SmartStasis finishes or gives up and then WHAM doesn't know what to do? In my case I am comfortable pointing a finger away from WHAM because it happens with SimpleSmack as well.

To be clear, the issue with the protector spectre is that it stops automation and leaves you on your own as opposed to not even starting the encounter, correct?

It goes through the choice adventure, but then does nothing in combat, and leaves no output from WHAM in the console. (I normally see, for example
Code:
WHAM: Running SmartStasis
)

As I was posting in the other thread, the debug output is
Code:
Encounter: Protector Spectre
Round 0: LeaChim wins initiative!
Starting consult script: WHAM.ash
Finished consult script: WHAM.ash
Starting consult script: WHAM.ash
Finished consult script: WHAM.ash
You're on your own, partner.
 
Tried with r18129 today, same output
Downgraded to 18096, same output. Also the same back at r18076. (Any earlier, and SmartStatis complains about mafia version etc, and I don't have the time right now to go downgrading all the scripts as well)
 
Protector Spectre is an autostop adventure which makes it not start automatically. Just run_combat again and it will automate properly.
 
What is an "autostop adventure"? Why do you think the fight with the Protector Spectre "doesn't start automatically"?

The DEBUG log he posted showed him entering combat with the Protector Spectre and his consult script - WHAM - being invoked.
It also showed that WHAM returned without submitting any actions. Twice.

What does that have to do with the combat "not starting automatically"?

*puzzled*
 
An autostop adventure would be the same thing that LeaChim reported before the bug got closed.
http://kolmafia.us/showthread.php?21916-adv1-aborts-when-I-meet-the-protector-spectre
Or what I made as a FReq three years ago where I'm supposed to get a debug log, if I can figure out what to report to make the behaviour more clear.
http://kolmafia.us/showthread.php?14874-Removing-autostop-on-Massive-Ziggurat

Basically, anytime you try to automate starting the protector spectre fight, whether through adventure or adv1, it aborts before combat actually begins. Launching "run_combat()" with the optional prior "text fight.php" to refresh mafia's understanding of where the combat state is and clear the pending state, will actually automate, but your first attempt to start the combat will abort.
Maybe mafia is handing bad information to consult scripts, causing them to abort.
Maybe mafia is marking this as an failed adventure or going in a pending state, and that breaks consult scripts.

Maybe something else is happening that affects people using consult scripts. All I know is that manually starting the combat using visit_url, choice, and run_combat() doesn't cause the same abort, so it's not a problem in the consult scripts themselves, since I've used at least four different consult scripts which have all had the same behaviour (WHAM, WHAM Beta, SmartStasis, and SimpleSmack) and they all abort using mafia's native adventure handling and don't abort when you avoid it.

I'd submit a log in a few days if I knew what was supposed to be submitted to allow for not needing to bypass mafia's adventure handling on this one fight.
 
My (still unreleased) script that handles the MacGuffin quest doesn't run into any aborts. In case it helps, here's what it does:

Ensure that choiceAdventure791 is set to fight the spectre (choice 1).
Set "1 [2180]ancient amulet" as a condition.
Auto-adventure at the Ziggurat.

The last two steps are really just a call to ZLib's obtain().
 
As I understand autostop adventures, having a condition will make mafia continue adventuring until that condition is met ignoring the autostop, so that does support that theory. Good to know there's another workaround though.
 
Except that this has nothing to do with autostop adventures as I understand them, since it didn't stop automation after going to that location. It submitted adventure.php, choice.php, and fight.php, exactly as expected.

There is something odd, though.

I got my 4 stone triangles.
I set my Custom Combat to [ default ] -> consult consult.ash
I selected my Adventure Location as A Massive Zigguart
I set the Hidden Ziggurat choice adventure to "fight Protector Spirit"
I did not touch the "conditions" filed since that was completely irrelevant.
I told it to adventure once.

Completely as expected, it did this:

Code:
Requesting: https://www.kingdomofloathing.com/adventure.php?snarfblat=350
Retrieved: https://www.kingdomofloathing.com/adventure.php?snarfblat=350
Field: Location = [choice.php?forceoption=0]
Requesting: https://www.kingdomofloathing.com/choice.php?forceoption=0
Retrieved: https://www.kingdomofloathing.com/choice.php?forceoption=0

[790] A Massive Ziggurat
Encounter: Legend of the Temple in the Hidden City
Legend of the Temple in the Hidden City

Requesting: https://www.kingdomofloathing.com/choice.php?whichchoice=791&option=1&pwd
Retrieved: https://www.kingdomofloathing.com/choice.php?whichchoice=791&option=1&pwd
Field: Location = [fight.php?ireallymeanit=1499823965]

Retrieved: https://www.kingdomofloathing.com/fight.php?ireallymeanit=1499823965
Encounter: Protector Spectre
Round 0: Veracity wins initiative!
Completely as NOT expected, it then did this:

Code:
Starting consult script: consult.ash
Finished consult script: consult.ash
Starting consult script: consult.ash
Finished consult script: consult.ash
You're on your own, partner.
The first statement in my consult script is a "print" statement.

Looking at the code in FightRequest.java, I see this:

Code:
				File scriptFile = scriptFiles.get( 0 );
				KoLmafiaASH.logScriptExecution( "Starting consult script: ", scriptFile.getName(), consultInterpreter );
				consultInterpreter.execute( "main", parameters );
				KoLmafiaASH.logScriptExecution( "Finished consult script: ", scriptFile.getName(), consultInterpreter );
I don't have the beginning of a clue as to why my consult script was not actually invoked, near as I can tell.

Too bad I didn't do this in Eclipse.

Perhaps it really did "autostop" when it printed "Legend of the Temple in the Hidden City". Perhaps it left the state in a condition such that ASH refused to execute.
 
Last edited:
Yeah, OK. Autostop puts KoLmafia into the "pending" condition, which will stop adventuring if you found a noncombat. But if you are automating, it will not stop you from taking a choice or from going into a fight.

I made FightRequest force you back into "continue" condition before executing a consult script and I got this:

Code:
[792] A Massive Ziggurat
Encounter: Legend of the Temple in the Hidden City
Took choice 791/1: fight Protector Spectre
choice.php?whichchoice=791&option=1&pwd
Encounter: Protector Spectre
Round 0: Veracity wins initiative!
> initround = 1
> monster = Protector Spectre
> page length = 19267
Round 1: Veracity attacks!
Round 2: Protector Spectre takes 66 damage.
> initround = 2
> monster = Protector Spectre
> page length = 18573
Round 2: Veracity attacks!
Round 3: You lose 20 hit points
> initround = 3
> monster = Protector Spectre
> page length = 18464
Round 3: Veracity attacks!
Round 4: Protector Spectre takes 66 damage.
Round 4: Veracity wins the fight!
You acquire an item: psychokinetic energy blob
You acquire an item: ancient amulet
You acquire an item: spectre scepter
After Battle: You gain 37 Muscleboundness
After Battle: You gain 33 Magicalness
After Battle: You gain 70 Cheek
That seems right.

I do wonder what happens if you are in a real "abort" or "error" state and we decide to execute a consult script.

In any case, Revision 18143 has the one-line change that enabled that behavior.
 
Awesome, thanks. Being able to do normal automation there should make new people stop posting new confusion every year or so. :)
 
Quick questions: Is there a way I could make WHAM prioritize my most powerful attacks, instead of my weakest? Or should I just avoid buying the lesser class skills in the first place, when possible?

WHAM is very efficient against lower-level badguys, but tougher ones tend to get the "let's do a 20 round tickle the monster with a feather attack!" approach that often gets me beaten up in areas like Hobopolis or Dreadsylvania. And trying to ferret out all the lesser skills and items that I often have by the time I start adventuring in those areas is migraine-inducing. If there's a way to make WHAM switch priorities, then one could use regular WHAM as intended, and the other version for curb-stomping the things that normal WHAM would allow to curb-stomp us.
 
WHAM is designed to kill the monster in the least expensive way possible. That means that it tends to plink rather than blast. You might want to read the first post in this thread and play around with the following variables:

Code:
zlib WHAM_killit = true or false
zlib WHAM_roundcost_aftercore= <wanted number>
zlib WHAM_roundcost_ronin = <wanted number>

If you aren't already doing so: take advantage of the WHAM relay script that allows you to control what items WHAM will use in resolving combats.
 
Last edited:
WHAM is having a hard time with the wandering monsters this Crimbo. They seem to have some kind of physical resistance. Not 100%, but very high. Soft damage cap? I honestly don't remember how this stuff works.
 
Back
Top