Winterbay's Helpful Automatic Monsterbasher (WHAM)

Winterbay

Active member
Hmmm... Since the uneffect happened before running SS it would appear to be Mafia doing the removal for you. As such the problem is most likely with batbrain since that should really pick up that we are not poisoned any more...

What's your verbosity set to?
 

Crowther

Active member
I decided to give 2.4 a try, since it sounded like most of the bugs have been worked out. I made it to level 11 before noticing any serious problems. For some reason, it's having trouble with ancient protector spirits.
Code:
Encounter: ancient protector spirit
Round 0: Crowther wins initiative!
 > BCC: Run_Combat() being used normally.
 > WHAM: Running SmartStasis
Round 2: Crowther executes a macro!
Round 2: Crowther casts INTIMIDATING BELLOW!
 > WHAM: Monster is weak. We are just going to bash its head in. It'll take 1 rounds.
Round 3: Crowther executes a macro!
Round 3: Crowther casts MIGHTY AXING!
After than, it continues to use mighty axing until I get beaten up. I have no source of elemental damage, so mighty axing only does 1 damage per attack.

I've been doing a lot of 100 turn basement runs and this script has been a big help deciding how to defeat those monster. 1.9.6 worked well, but was painfully slow because I've got way too many skills for it to consider. I'm excited about trying 2.4 and seeing how much faster it runs.
 
Last edited:

Winterbay

Active member
I decided to give 2.4 a try, since it sounded like most of the bugs have been worked out. I made it to level 11 before noticing any serious problems. For some reason, it's having trouble with ancient protector spirits.
Code:
Encounter: ancient protector spirit
Round 0: Crowther wins initiative!
 > BCC: Run_Combat() being used normally.
 > WHAM: Running SmartStasis
Round 2: Crowther executes a macro!
Round 2: Crowther casts INTIMIDATING BELLOW!
 > WHAM: Monster is weak. We are just going to bash its head in. It'll take 1 rounds.
Round 3: Crowther executes a macro!
Round 3: Crowther casts MIGHTY AXING!
After than, it continues to use mighty axing until I get beaten up. I have no source of elemental damage, so mighty axing only does 1 damage per attack.

I've been doing a lot of 100 turn basement runs and this script has been a big help deciding how to defeat those monster. 1.9.6 worked well, but was painfully slow because I've got way too many skills for it to consider. I'm excited about trying 2.4 and seeing how much faster it runs.

I'm a bit at a loss here since it really shouldn't do that, it should abort and let your figure out the best way to move forward. And also, I'm a bit confused as to why you do not have heroic belch at that point :)
 

Crowther

Active member
I'm a bit at a loss here since it really shouldn't do that, it should abort and let your figure out the best way to move forward. And also, I'm a bit confused as to why you do not have heroic belch at that point :)
My apologies, I always forget to include enough information. I had all 30 Boris skills and enough fullness for belch. I probably should have grabbed a more verbose log, but at the time I was just happy WHAM made it that far. Only later did I realized it might be nice to tell others. I just checked my logs and once I took over by hand, it only took one bellow and two belches to kill all the spirits.

I guess it doesn't really matter if it's Boris specific. Now that I've got the skill, I'm not planning on doing another Boris run. The new challenge path is a few days out and we'll all be distracted by that.

I tried 2.4 in the basement today and some monsters never solved. I waited for half and hour on one. Now, it's probably my fault, because I really should have been more buffed. The first long pause, I lost playing by hand. The second, I won, but it was so close, I'm going to say it was luck. On a few monsters, WHAM used inexpensive combat items to kick ass. Items I didn't even know existed!

I have to say, I really miss the days when I could just use snowclone on everything down there. Lucky for me, I got my full telescope before that bug fix.
 

hesuchia

Member
I'm powerlevelling/candyblasting in space at the moment as a sauceror. Once the monster got weak, the script decided to bash its head in instead, which didn't work so well since I'm a myst class with a chefstave ;). Candyblast woulda killed him in time but it ran out of rounds since phys attacks weren't high enough. This only happened in 2.4. In 2.3 it said it would bash his head in, but kept using Candyblast anyway.
 

Winterbay

Active member
Could you run 1 such combat at first verbosity 10 and then 9 and copy the result here? That'll help me debug the issue a lot better.
 

fronobulax

Developer
Staff member
FWIW either WHAM or SS is not really sure how to deal with a Stab Bat as a familiar. I don't recall the mechanics of when it bites me but I'm not sure prolonging the combat is always the best or even a reasonable strategy.

WHAM seems to be going off into LaLa land for me, never actually initiating the combat. I think what is happening is that the only thing that can damage the monster is a spell (and I am a DB) but I only have enough MP to cast it once. WHAM never seems to give up the idea that there is something else it could do after the spell.

I have played with verbosity but I can't make any sense of what I am being told so a specific recommendation would be helpful, although not necessarily useful since the character is now high enough that the spell one shots and the MP restore, when set, allows for multiple casts.
 

Winterbay

Active member
Yeha, I need to play around with aborts and suchlike when it can't find a good way to kill the monster. I've got stuck in some infinite loops recently but am not sure exactly what casued them.

That said version 2.5 is uploaded with a bunch of additions for Bugbear-hunting and a very late fix for the banishing in Boris-core.
 

morgad

Member
wham 2.5/zlib r36/mafia 11043

first time I have noticed this ...
Code:
[493] Giant's Castle
Encounter: Furry Giant
Strategy: /home/fit/.kolmafia/ccs/default.ccs [default]
Round 0: morgad wins initiative!
WHAM: Running SmartStasis
3/6 monsters drop goals here.
This monster is the best source of goals (0.6800000071525574)!
Round 1: morgad executes a macro!
Round 1: morgad tries to steal an item!
You acquire an item: furry fur
You lose 29 hit points
Round 2: morgad casts ENTANGLING NOODLES!
Round 3: morgad casts SAUCY SALVE!
You gain 14 hit points
Map modified within foreach (WHAM.ash, line 416)
You're on your own, partner.
Click here to continue in the relay browser.

best regards
Dave
 

Winterbay

Active member
Yeah, I got that today as well. I have no idea why it happened, but it appears to be when it tried to delevel the enemy but failed. The interesting thing is that I don't modify a map anywhere near there so I've no idea what's going on.
I have a local copy that works, but it also contains some untested elements that I'd like to test out more tomorrow before uploading for "real". I'll attach it to this post so that there's at least a working version out there...

Edit: Attachment removed. New version has been posted in the first post instead.
 
Last edited:

morgad

Member
there seemed to be a correlation with me about to get the crap kicked out of me, and only with Goth Giants :), will switch to your new version for tommorrows run

Dave
 

Crowther

Active member
I too have been having trouble and in both directions. I've been getting the crap beaten out of me by stasising high level monsters and I've been failing to stasis low level monsters. The middle seems okay. I've been trying to figure out how to make a decent bug report, but the system is very complex and I have trouble recreating things when I've the time to mess about.

Anyway, today I was basement diving and getting beaten up, so I tried turning up the verbosity (which fixed everything for a while, ha!)

I think I finally got a useful log. Here two rounds were spent in stasis, then on round three it was decided winning was impossible. Usually, I get beaten up. This time it aborted and I won playing manually (noodles and harpoon).

Code:
[1050] Fernswarthy's Basement (Level 63)
Encounter: The Beast with 662 Ears
Strategy: /root/.kolmafia/ccs/Destroy.ccs [default]
Round 0: Crowther wins initiative!
Running ZLib version: r36 (current)
1 HP costs 0.5400000214576721μ. ( 316 / 374 )
1 MP costs 4μ. ( 200 / 377 )
Factoring in Mer-kin hookspear: 0 damage, meat 
monstermeat*((zone(sea)+1)*0.125+0.05), oncrit
Running BatBrain version: 1.23 (current)
Running SmartStasis version: 3.15 (current)
Running WHAM version: 2.5 (current)
WHAM: We currently think that the round number is: 0 and that the turn 
number is 1049.
WHAM: No need to do anything with this monster.
WHAM: Setting up variables via BatBrain
Value of stat gain: 1,840.780029296875μ
Value of stat gain: 1,840.780029296875μ
ATT: 687 (94% × 124.51000213623047, death in 3)
DEF: 619 (35.18000030517578% × 487.1199951171875 (15) (15), win in 3)
HP: 592, Value: 1,840.780029296875 μ
Parsed round number: 1
Building options...
Options built! (263 actions)
WHAM: We currently think that the round number is: 1 and that the turn 
number is 1049.
WHAM: You have no profitable MP restoratives.
WHAM: You have no profitable HP restoratives.
WHAM: You are fighting a The Beast with n Ears. Mafia considers that this 
monster has an attack of 687 or 687 when given a monster name.
WHAM: Mafia further considers that this monster has a defense value of 619 
or 619 when given a monster name.
WHAM: Mafia further further considers that this monster has a HP value of 
587 or 587 when given a monster name.
WHAM: Your current ML-adjustment is: 25.
WHAM: Monster HP is 592.0.
WHAM: WHAM added the following to BatRound: if pastround 49; abort 
"Stopping fight because it has gone on for too long (set WHAM_maxround to a 
higher value if you think this was in error)"; endif; 
WHAM: Running SmartStasis
Profit per round: ActionProfitDamageOtherbase; Mini-Hipster 
(27μ)73.37000274658203μ0 (51.630001068115234) (51.630001068115234) Actual: 
103.25 (-0.25999999046325684 μ/dmg)Att: -0.5 (-0.11999999731779099 DPR) 
Def: -0.5 HP: -10.199999809265137 MP: 10.199999809265137
Building custom actions...
Custom actions built! (0 actions)
Stasis action chosen: use 2678 (round 1, profit: 26.770000457763672)
Value of stat gain: 1,840.780029296875μ
Attack action chosen: skill 1005 (round 1, profit: 41.369998931884766)
Top of the stasis loop.
Queued: use 2678
Building options...
Options built! (263 actions)
Constructed macro: scrollwhendone; sub batround; if pastround 49; abort 
"Stopping fight because it has gone on for too long (set WHAM_maxround to a 
higher value if you think this was in error)"; endif; endsub; sub finito; 
use 2678; call batround; endsub; call finito; repeat hascombatitem 2678 && 
(!hpbelow 316.0 && hpbelow 374 && !mpbelow 200.0 && !pastround 46)
Round 1: Crowther executes a macro!
Round 1: Crowther uses the spectre scepter!
You gain 3 Sarcasm
You lose 126 hit points
Happened: use 2678
Parsed round number: 2
Happened: hipster_stats
Building options...
Options built! (263 actions)
Stasis action chosen: use 2678 (round 2, profit: 27.559999465942383)
Value of stat gain: 1,840.780029296875μ
Attack action chosen: skill 1005 (round 2, profit: 41.369998931884766)
Top of the stasis loop.
Queued: use 2678
Building options...
Options built! (263 actions)
Constructed macro: scrollwhendone; sub batround; if pastround 49; abort 
"Stopping fight because it has gone on for too long (set WHAM_maxround to a 
higher value if you think this was in error)"; endif; endsub; sub finito; 
use 2678; call batround; endsub; call finito; repeat hascombatitem 2678 && 
(!hpbelow 190.0 && hpbelow 374 && !mpbelow 200.0 && !pastround 46)
Round 2: Crowther executes a macro!
Round 2: Crowther uses the spectre scepter!
You gain 5 hit points
You gain 24 hit points
You gain 39 Mojo Points
You lose 118 hit points
Happened: use 2678
Parsed round number: 3
Building options...
Options built! (263 actions)
Stasis action chosen: skill 5023 (round 3, profit: -20)
Value of stat gain: 1,840.780029296875μ
Attack action chosen: skill 1005 (round 3, profit: 41.369998931884766)
Your huckleberry will kill you.
Stasis loop complete.
WHAM: SmartStasis complete.
WHAM: Running SmartStasis took 7.453000068664551 seconds.
WHAM: We currently think that the round number is: 3 and that the turn 
number is 1049.
WHAM: SS did not finish the script off, continuing with script execution. 
Happened: use 2678
Parsed round number: 3
Building options...
Options built! (263 actions)
WHAM: Starting evaluation and performing of attack
WHAM: We currently think that the round number is: 3 and that the turn 
number is 1049.
No valid attacks.
No valid attacks.
Queued: use 2575
Building options...
Options built! (263 actions)
Map modified within foreach (WHAM.ash, line 416)
You're on your own, partner.
Click here to continue in the relay browser.
My work around is to just buff more, but I'm hoping I can be helpful. I really wish I could catch a log when it's failing to stasis on monsters I totally outclass, but that's always day one ascension when I barely have time to keep up with the game.
 

Winterbay

Active member
there seemed to be a correlation with me about to get the crap kicked out of me, and only with Goth Giants :), will switch to your new version for tommorrows run

Dave


I too have been having trouble and in both directions. I've been getting the crap beaten out of me by stasising high level monsters and I've been failing to stasis low level monsters. The middle seems okay. I've been trying to figure out how to make a decent bug report, but the system is very complex and I have trouble recreating things when I've the time to mess about.

Anyway, today I was basement diving and getting beaten up, so I tried turning up the verbosity (which fixed everything for a while, ha!)

I think I finally got a useful log. Here two rounds were spent in stasis, then on round three it was decided winning was impossible. Usually, I get beaten up. This time it aborted and I won playing manually (noodles and harpoon).

Code:
[1050] Fernswarthy's Basement (Level 63)
Encounter: The Beast with 662 Ears
Strategy: /root/.kolmafia/ccs/Destroy.ccs [default]
Round 0: Crowther wins initiative!
Running ZLib version: r36 (current)
1 HP costs 0.5400000214576721μ. ( 316 / 374 )
1 MP costs 4μ. ( 200 / 377 )
Factoring in Mer-kin hookspear: 0 damage, meat 
monstermeat*((zone(sea)+1)*0.125+0.05), oncrit
Running BatBrain version: 1.23 (current)
Running SmartStasis version: 3.15 (current)
Running WHAM version: 2.5 (current)
WHAM: We currently think that the round number is: 0 and that the turn 
number is 1049.
WHAM: No need to do anything with this monster.
WHAM: Setting up variables via BatBrain
Value of stat gain: 1,840.780029296875μ
Value of stat gain: 1,840.780029296875μ
ATT: 687 (94% × 124.51000213623047, death in 3)
DEF: 619 (35.18000030517578% × 487.1199951171875 (15) (15), win in 3)
HP: 592, Value: 1,840.780029296875 μ
Parsed round number: 1
Building options...
Options built! (263 actions)
WHAM: We currently think that the round number is: 1 and that the turn 
number is 1049.
WHAM: You have no profitable MP restoratives.
WHAM: You have no profitable HP restoratives.
WHAM: You are fighting a The Beast with n Ears. Mafia considers that this 
monster has an attack of 687 or 687 when given a monster name.
WHAM: Mafia further considers that this monster has a defense value of 619 
or 619 when given a monster name.
WHAM: Mafia further further considers that this monster has a HP value of 
587 or 587 when given a monster name.
WHAM: Your current ML-adjustment is: 25.
WHAM: Monster HP is 592.0.
WHAM: WHAM added the following to BatRound: if pastround 49; abort 
"Stopping fight because it has gone on for too long (set WHAM_maxround to a 
higher value if you think this was in error)"; endif; 
WHAM: Running SmartStasis
Profit per round: ActionProfitDamageOtherbase; Mini-Hipster 
(27μ)73.37000274658203μ0 (51.630001068115234) (51.630001068115234) Actual: 
103.25 (-0.25999999046325684 μ/dmg)Att: -0.5 (-0.11999999731779099 DPR) 
Def: -0.5 HP: -10.199999809265137 MP: 10.199999809265137
Building custom actions...
Custom actions built! (0 actions)
Stasis action chosen: use 2678 (round 1, profit: 26.770000457763672)
Value of stat gain: 1,840.780029296875μ
Attack action chosen: skill 1005 (round 1, profit: 41.369998931884766)
Top of the stasis loop.
Queued: use 2678
Building options...
Options built! (263 actions)
Constructed macro: scrollwhendone; sub batround; if pastround 49; abort 
"Stopping fight because it has gone on for too long (set WHAM_maxround to a 
higher value if you think this was in error)"; endif; endsub; sub finito; 
use 2678; call batround; endsub; call finito; repeat hascombatitem 2678 && 
(!hpbelow 316.0 && hpbelow 374 && !mpbelow 200.0 && !pastround 46)
Round 1: Crowther executes a macro!
Round 1: Crowther uses the spectre scepter!
You gain 3 Sarcasm
You lose 126 hit points
Happened: use 2678
Parsed round number: 2
Happened: hipster_stats
Building options...
Options built! (263 actions)
Stasis action chosen: use 2678 (round 2, profit: 27.559999465942383)
Value of stat gain: 1,840.780029296875μ
Attack action chosen: skill 1005 (round 2, profit: 41.369998931884766)
Top of the stasis loop.
Queued: use 2678
Building options...
Options built! (263 actions)
Constructed macro: scrollwhendone; sub batround; if pastround 49; abort 
"Stopping fight because it has gone on for too long (set WHAM_maxround to a 
higher value if you think this was in error)"; endif; endsub; sub finito; 
use 2678; call batround; endsub; call finito; repeat hascombatitem 2678 && 
(!hpbelow 190.0 && hpbelow 374 && !mpbelow 200.0 && !pastround 46)
Round 2: Crowther executes a macro!
Round 2: Crowther uses the spectre scepter!
You gain 5 hit points
You gain 24 hit points
You gain 39 Mojo Points
You lose 118 hit points
Happened: use 2678
Parsed round number: 3
Building options...
Options built! (263 actions)
Stasis action chosen: skill 5023 (round 3, profit: -20)
Value of stat gain: 1,840.780029296875μ
Attack action chosen: skill 1005 (round 3, profit: 41.369998931884766)
Your huckleberry will kill you.
Stasis loop complete.
WHAM: SmartStasis complete.
WHAM: Running SmartStasis took 7.453000068664551 seconds.
WHAM: We currently think that the round number is: 3 and that the turn 
number is 1049.
WHAM: SS did not finish the script off, continuing with script execution. 
Happened: use 2678
Parsed round number: 3
Building options...
Options built! (263 actions)
WHAM: Starting evaluation and performing of attack
WHAM: We currently think that the round number is: 3 and that the turn 
number is 1049.
No valid attacks.
No valid attacks.
Queued: use 2575
Building options...
Options built! (263 actions)
Map modified within foreach (WHAM.ash, line 416)
You're on your own, partner.
Click here to continue in the relay browser.
My work around is to just buff more, but I'm hoping I can be helpful. I really wish I could catch a log when it's failing to stasis on monsters I totally outclass, but that's always day one ascension when I barely have time to keep up with the game.

Yeah, the new version in 134 should abort properly when it can't figure out a way to kill the monster without you dying and also should not crash on deleveling. I'm not sure about what is happening at the lower end.

It also sets unknown_ml for the bugbears to levels which appeared to work for me yesterday (that's the experimental part) as well as sorting the printout of skills and damage in falling damage order when it aborts.
 

Theraze

Active member
Apparently if you successfully steal before the recalculation, it repeats it, a bunch...
You acquire an item: toast
Round 13: Theraze casts SUCKERPUNCH!
Round 14: fallen archfiend takes 1 damage.
Round 14: fallen archfiend drops 1 attack power.
Round 14: fallen archfiend drops 1 defense.
Look! You found 1 toast (14μ)!
Look! You found 1 toast (14μ)!
Look! You found 1 toast (14μ)!
WHAM: Monster is weak. We are just going to bash its head in. It'll take 2 rounds.
I mean, I'd take the triple-toasting. But for some reason, I can't find the other two... :)
 

Winterbay

Active member
Apparently if you successfully steal before the recalculation, it repeats it, a bunch...I mean, I'd take the triple-toasting. But for some reason, I can't find the other two... :)

I do feel that that is more of a batbrain issue than a WHAM issue...

However version 2.6 has been released which should no longer enter infinite loops when running out of MP. yay!
It also tries to set unknown_ml dynamically for the new bugbears which workd out fine for me during my latest run and so I hope people are somewhat happy with the numbers I've chosen.
 

Theraze

Active member
And here I was thinking it was because, on failing to kill successfully, we do this:
Code:
		if(finished() || contains_text(page, "WINWINWIN")) { //Exit the script if SS ended the fight
			vprint("WHAM: SS has finished the fight. Aborting script execution. ", "purple", 9);
			exit;
		} else {
			vprint("WHAM: SS did not finish the script off, continuing with script execution. ", "purple", 9);
[i]			act(page); //Re-initialize all variables to be sure we are in a correct state[/i]
		}

		vprint("WHAM: Starting evaluation and performing of attack", "purple", 8);

		//Debug info
		vprint("WHAM: We currently think that the round number is: " + round + " and that the turn number is " + my_turncount() + ".", "purple", 9);
	
[i]		page = Evaluate_Options();[/i]
Evaluate_Options, of course, has this:
Code:
	kill_it = Calculate_Options(monster_stat("hp")); //Set up the damage dealt
and Calculate_Options has:
Code:
		reset_queue();
		act(page);
but... maybe repeatedly calling act() is irrelevant? :)

TLDR: Can probably scrap the act() in failing to kill because it gets called in Evaluate_Options anyways.
 
Top