Winterbay's Helpful Automatic Monsterbasher (WHAM)

On the rare time WHAM ends up failing due to a bad critical, WHAM doesn't appear to realize that combat is over; my script stays 'running' forever. Not sure if there's any good way to show what's going on, but...

Another WHAM problem... not aware of amnesia.

ACtually, it is aware. It's just that the Saucesplash-override isn't aware of that :)
I'll look at that.

Edit: Actually it was unaware, because you got it after act() got called.
 
Last edited:
Yeah, in the first case, it happens when either the first round fails miserably or pre-WHAM actions happen (like Rinn's pirate.ash script throwing the insult book before run_combat() gets called) and dying during the round that gets handed off to WHAM.

In the second case, it happens anytime Amnesia occurs during combat. When it happened, I aborted and did run_combat() again to see what would happen if it started fresh with a new act() from the beginning. Same infinite loop.
 
Ha! Good point. I'll try tomorrow. I couldn't figure out how to tell if ti was SS or WHAM. Silly I didn't just think to try SS alone.

Interesting point in fact: I know that Stasis works because I just stasised with my DB-multi (too much one could say, I have no idea what it was trying to do after round 12 or so) after a report of the same from ferdawoon. Having a cocoabo or Tickle me Emilio as your familiar does that rather quickly.
 
Also, using a NZPR shows you VERY quicky that stasis works... unfortunately it will try to stasis at level 1-2 using saucy salve and ends up killing you, but that's because it thinks stasis is better than success sometimes. Ah, luck. :) And the dangers of HP/MP restoring familiars when you don't actually have enough MP to continue using your healing stasis. Heh.
 
Yeah, setting the stasis-value to 100 may not be the most cost efficient thing I've done, but it definitely saves me a lot of trouble :)
 
2.7 uploaded that should fix most of the weirdness of temporary amnesia (hopefully) and also allow Saucerors to saucesplash again after an interesting bug where it would actually only saucesplash if you couldn't...

Next target: Trying to get MP-restoration into the mix if the script finds you low on MP before killing the monster.
 
I was seeing some confusing behaviour today, and I've finally figured out what's causing it, but I don't know what the best solution would be.
The script was attempting to spam attacks against monsters where I had 5% hit chance or less, until I died (WHAM_hitchance is set to 0.5).
Running it with 10 verbosity correctly listed all the available combat skills. However I got the interesting message:

Code:
[COLOR="#800080"]WHAM: You will kill the monster in 2 rounds with your basic attack.
WHAM: The monster will take 7 rounds to kill you.
rounds_to_kill: 2, round_limit: 10, maxround: 30, die_rounds(): 7, [COLOR="#FF0000"]hitchance("attack"): 1.0[/COLOR]
WHAM: Expected received damage per round: 16.865816338839203, Rounds to kill: 2, Expected damage: 117.5, Hit chance: 1.0
WHAM: Monster is weak. We are just going to bash its head in. It'll take 2 rounds.[/COLOR]

Turns out smartstasis was throwing my operation patriot shield, which makes the next hit a guaranteed crit.
When you have thrown the shield, but not used the crit, batbrain always returns 1.0 from hitchance() (around line 652).
WHAM sees the hitchance is 100%, and doesn't know that it's only valid for the first hit, and so tries to spam it.
 
Oh. Good catch. I'll have to check for happened() on the shield-thing I guess and adjust accordingly.
I'll look at that tomorrow.
 
I'm having difficulty getting WHAM to handle basement monsters for me. It keeps telling me to handle it on my own, because there is some error with funkslinging double ice:

"WHAM: Failed to enqueue shard of double-ice (entry 11 in the strategy)."

Verbosity set to 9, forgive me if that's overkill
Code:
[15027] Fernswarthy's Basement (Level 266)
Encounter: The Beast with 4,966 Eyes
Round 0: the southern dandy loses initiative!
Round 1: the beast with n eyes takes 1 damage.
Round 1: the beast with n eyes takes 3 damage.
Round 1: the beast with n eyes takes 4 damage.
You lose 239 hit points
Running ZLib version: r36 (current)
1 HP costs 3.092μ. ( 6,295 / 6534 )
1 MP costs 12μ. ( 1,184 / 3217 )
Factoring in Scarysauce: (6) damage, retal
Running BatBrain version: 1.23 (current)
Running SmartStasis version: 3.15 (current)
Running WHAM version: 2.7 (current)
WHAM: We currently think that the round number is: 0 and that the turn number is 15026.
WHAM: No need to do anything with this monster.
WHAM: Setting up variables via BatBrain
Value of stat gain: 17,731.62μ
Value of stat gain: 17,731.62μ
ATT: 4,991 (94% × 280.6, death in 24)
DEF: 4,492 (8.59% × 83.06 (15) (45), win in 346)
HP: 4,243, Value: 17,731.62 μ
Parsed round number: 1
Building options...
Options built! (92 actions)
WHAM: We currently think that the round number is: 1 and that the turn number is 15026.
WHAM: You have no profitable MP restoratives.
WHAM: You have no profitable HP restoratives.
WHAM: You are fighting a The Beast with n Eyes. Mafia considers that this monster has an attack of 4991 or 4991 when given a monster name.
WHAM: Mafia further considers that this monster has a defense value of 4492 or 4492 when given a monster name.
WHAM: Mafia further further considers that this monster has a HP value of 4238 or 4246 when given a monster name.
WHAM: Your current ML-adjustment is: 25.
WHAM: Monster HP is 4243.0.
WHAM: WHAM added the following to BatRound: if pastround 29; 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 (0μ)0μ--
Building custom actions...
Custom actions built! (0 actions)
Stasis action chosen: use 5561 (round 1, profit: 711.17)
Value of stat gain: 17,731.62μ
Attack action chosen: use 5048 (round 1, profit: -920.56)
Top of the stasis loop.
Queued: use 5561
Building options...
Options built! (91 actions)
Constructed macro: scrollwhendone; sub batround; if pastround 29; 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 5561; call batround; endsub; call finito; repeat hascombatitem 5561 && (!hpbelow 6295.0 && hpbelow 6534 && !mpbelow 1184.0 && !pastround 45)
Round 1: the southern dandy executes a macro!
Round 1: the southern dandy uses the Rain-Doh indigo cup!
You gain 1,306 hit points
Happened: use 5561
Parsed round number: 2
Building options...
Options built! (91 actions)
Stasis action chosen: use 2678 (round 2, profit: -607.88)
Value of stat gain: 17,731.62μ
Attack action chosen: use 5048 (round 2, profit: -920.56)
This monster is not your huckleberry.
Stasis loop complete.
WHAM: SmartStasis complete.
WHAM: Running SmartStasis took 1.51 seconds.
WHAM: We currently think that the round number is: 2 and that the turn number is 15026.
WHAM: SS did not finish the script off, continuing with script execution. 
WHAM: Starting evaluation and performing of attack
WHAM: We currently think that the round number is: 2 and that the turn number is 15026.
Value of stat gain: 17,731.62μ
Attack action chosen: use 5048 (round 2, profit: -920.56)
Queued: use 5048
Building options...
Options built! (90 actions)
Value of stat gain: 17,731.62μ
Attack action chosen: use 5048 (round 3, profit: -105)
Auto-funk: merging 'use 5048' and 'use 5048'.
Queued: use 5048,5048
Building options...
Options built! (90 actions)
Happened: use 5561
Parsed round number: 2
Building options...
Options built! (91 actions)
WHAM: Evaluating the attack but not performing it took 0.57 seconds.
Queued: skill 3004
Building options...
Options built! (90 actions)
WHAM: Enqueuing a stun to help with the battle
WHAM: We can't Saucesplash.
true, true, true, false, false
WHAM: Enqueueing shard of double-ice (macroid use 5048).
Queued: use 5048
Building options...
Options built! (89 actions)
WHAM: Successfully enqueued shard of double-ice.
WHAM: We can't Saucesplash.
true, true, true, false, true
WHAM: Enqueueing shard of double-ice (macroid use 5048).
Unable to enqueue empty action.
WHAM: Failed to enqueue shard of double-ice (entry 11 in the strategy).
WHAM: The following combat strategy was attempted: 
shard of double-ice
shard of double-ice
WHAM: Aborting now to let you figure this out.
You're on your own, partner.
Click here to continue in the relay browser.
 
Well, obvious first question... do you have multiple shards of double-ice or just one? :)

Ha, yes, I double checked that. Plenty of double ice. Even if I didn't have those, I'd assume WHAM would come up with a different solution, like a Divine item, Spectral Snapper, etc.
 
I think the problem is that WHAM is trying to enqueue one thing at a time while batbrain tries to autofunkify things and that somehow messes things up. I'll add that to the list of things I need to look at :)
 
I've been meaning to add, WHAM did a great job in the basement this last run. When it aborted, the output was very helpful for figuring a strategy, then I buffed more and moved on. No lost fights at all, if I remember right.
 
Thanks Winterbay. This is my first time scripting the basement, and it has been amazing for the first 250 levels or so, but now it stops at every battle due to the double ice thing. Maybe I'll just take them out of inventory to try to get it to use spectral snapper or something instead.

Still, this has been a MUCH better basement experience so far due your WHAM script and your adopted basement script, so much thanks.

EDIT - I closeted my double ice shards, and now it funkslings divine noisemakers with no issue. so it must be an issue with the shards specifically
 
Last edited:
I tried yesterday to get the script to funksling shards but it picked 1 shard and 1 love song each time instead, which worked fine and so couldn't look into it.

That said I have some nice changes coming up, but I wanted to check one thing with those who have the Operation Patriot Shield:
When you are automating with it, how do you expect it to be used?

Currently I've set it up to only execute 1 action when the shield-crit hasn't happened yet but it won't throw the shield itself. Is it always a good thing to throw it before the first action? Or is there some other interesting synergy I could look into?
 
Version 2.8 has been released and contains numerous things:
* Readd the WHAM_AlwaysContinue option as a way to tell if the script should try to fight as best as it can despite the odds
* Remove will_attack() since attack is considered among the other options anyway and the hitchance is taken into account when setting up options
* Significantly improve stunning logic
* Create the quit()-function to collect all exiting into one place
* Rudimentary handling of the Operation Patriot Shield
* Fix a couple of infinite loops


Comments and posts of failures are always welcome since they help make the script better.
 
When using 2.8 I'm getting almost constant aborts in Cobb's Knob when WHAM tries and fails to enqueue entangling noodles. If I adventure manually I'm one-hitting everything in the harem.

Edit: It's failing everywhere when trying to enqueue entangling noodles.

Code:
[106] Cobb's Knob Harem
Encounter: Knob Goblin Harem Guard
Strategy: E:\software\Kol\ccs\default.ccs [default]
Round 0: Arbos wins initiative!
Running ZLib version: r36 (current)
1 HP costs 3.2μ. ( 33 / 37 )
1 MP costs 8μ. ( 80 / 99 )
Running BatBrain version: 1.23 (current)
Running SmartStasis version: 3.15 (current)
Running WHAM version: 2.8 (current)
WHAM: We currently think that the round number is: 0 and that the turn number is 105.
WHAM: No need to do anything with this monster.
WHAM: Setting up variables via BatBrain
Knob Goblin deluxe scimitar (10.0 @ +96.16590118408203): 55μ * 19.616590118408205% = 10.789124565124512
Knob nuts (15.0 @ +96.16590118408203): 500μ * 29.424885177612303% = 147.12442588806152
Value of stat gain: 102.81μ
Knob Goblin deluxe scimitar (10.0 @ +96.16590118408203): 55μ * 19.616590118408205% = 10.789124565124512
Knob nuts (15.0 @ +96.16590118408203): 500μ * 29.424885177612303% = 147.12442588806152
Value of stat gain: 102.81μ
ATT: 35 (94% × 6.23, death in 6)
DEF: 32 (97.73% × 54.2 (3) (3) (3) (18) (5), win in 1)
HP: 31.5, Value: 260.73 μ
Parsed round number: 1
Building options...
Options built! (23 actions)
WHAM: We currently think that the round number is: 1 and that the turn number is 105.
WHAM: You have no profitable MP restoratives.
WHAM: You have no profitable HP restoratives.
WHAM: You are fighting a Knob Goblin Harem Guard. Mafia considers that this monster has an attack of 35 or 35 when given a monster name.
WHAM: Mafia further considers that this monster has a defense value of 32 or 32 when given a monster name.
WHAM: Mafia further further considers that this monster has a HP value of 30 or 30 when given a monster name.
WHAM: Your current ML-adjustment is: 10.
WHAM: Monster HP is 31.5.
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 (0μ)0μ--
Building custom actions...
Custom actions built! (0 actions)
Stasis action chosen: skill 4014 (round 1, profit: -19.2)
Knob Goblin deluxe scimitar (10.0 @ +96.16590118408203): 55μ * 19.616590118408205% = 10.789124565124512
Knob nuts (15.0 @ +96.16590118408203): 500μ * 29.424885177612303% = 147.12442588806152
Value of stat gain: 102.81μ
Attack action chosen: attack (round 1, profit: -0.07)
This monster is not your huckleberry.
Stasis loop complete.
WHAM: SmartStasis complete.
WHAM: Running SmartStasis took 0.95 seconds.
WHAM: We currently think that the round number is: 1 and that the turn number is 105.
WHAM: SS did not finish the script off, continuing with script execution. 
WHAM: Starting evaluation and performing of attack
WHAM: We currently think that the round number is: 1 and that the turn number is 105.
Knob Goblin deluxe scimitar (10.0 @ +96.16590118408203): 55μ * 19.616590118408205% = 10.789124565124512
Knob nuts (15.0 @ +96.16590118408203): 500μ * 29.424885177612303% = 147.12442588806152
Value of stat gain: 102.81μ
WHAM: Attack option chosen: attack (round 1, profit: -0.07)
Stun option chosen: skill 3004 (round 1, profit: -24)
Queued: skill 3004
Building options...
Options built! (22 actions)
Queued: attack
Building options...
Options built! (22 actions)
Parsed round number: 1
Building options...
Options built! (23 actions)
WHAM: Evaluating the attack but not performing it took 3.00 seconds.
Stun option chosen: skill 3004 (round 1, profit: -24)
WHAM: Enqueuing a stun to help with the battle
Queued: skill 3004
Building options...
Options built! (22 actions)
WHAM: We can't Saucesplash.
false, false, false, true, true
WHAM: Enqueueing Entangling Noodles (macroid skill 3004).
Unable to enqueue empty action.
WHAM: Failed to enqueue Entangling Noodles (entry 01 in the strategy).
WHAM: The following combat strategy was attempted: 
Entangling Noodles
Entangling Noodles
Round 1: Arbos executes a macro!
KoLmafia thinks it is round 2 but KoL thinks it is round 1
WHAM: Failed to enqueue Entangling Noodles. There's more detailed information in the gCLI.
You're on your own, partner.
Click here to continue in the relay browser.
 
Last edited:
Ehh yes, that's the problem with doing last minute changes. Since you were the only one to download 2.8 so far I've just reuploaded a fixed version that should 1) not do that and b) not enqueue the stun-action twice...
 
I just tried the updated 2.8 and things are better but it still failed in the same way.

Code:
[147] Dark Elbow of the Woods
Encounter: G imp
Strategy: E:\software\Kol\ccs\default.ccs [default]
Round 0: Arbos wins initiative!
Running ZLib version: r36 (current)
1 HP costs 2.041μ. ( 38 / 42 )
1 MP costs 7.143μ. ( 99 / 112 )
Running BatBrain version: 1.23 (current)
Running SmartStasis version: 3.15 (current)
Running WHAM version: 2.8 (current)
WHAM: We currently think that the round number is: 0 and that the turn number is 146.
WHAM: No need to do anything with this monster.
WHAM: Setting up variables via BatBrain
hot wing (30.0 @ +55.0): 32μ * 46.5% = 14.88
Imp Ale (30.0 @ +55.0): 25μ * 46.5% = 11.625
leather mask (5.0 @ +55.0): 65μ * 7.75% = 5.0375
Value of stat gain: 148.75μ
hot wing (30.0 @ +55.0): 32μ * 46.5% = 14.88
Imp Ale (30.0 @ +55.0): 25μ * 46.5% = 11.625
leather mask (5.0 @ +55.0): 65μ * 7.75% = 5.0375
Value of stat gain: 148.75μ
ATT: 56 (94% × 16.86, death in 3)
DEF: 51 (16.88% × 48.7 (3) (3) (3) (24) (5), win in 4)
HP: 58.8, Value: 240.56 μ
Parsed round number: 1
Building options...
Options built! (25 actions)
WHAM: We currently think that the round number is: 1 and that the turn number is 146.
WHAM: You have no profitable MP restoratives.
WHAM: You have no profitable HP restoratives.
WHAM: You are fighting a G Imp. Mafia considers that this monster has an attack of 56 or 56 when given a monster name.
WHAM: Mafia further considers that this monster has a defense value of 51 or 51 when given a monster name.
WHAM: Mafia further further considers that this monster has a HP value of 56 or 56 when given a monster name.
WHAM: Your current ML-adjustment is: 10.
WHAM: Monster HP is 58.8.
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 (0μ)0μ--
Building custom actions...
Custom actions built! (0 actions)
Stasis action chosen: skill 4020 (round 1, profit: -32.34)
hot wing (30.0 @ +55.0): 32μ * 46.5% = 14.88
Imp Ale (30.0 @ +55.0): 25μ * 46.5% = 11.625
leather mask (5.0 @ +55.0): 65μ * 7.75% = 5.0375
Value of stat gain: 148.75μ
Attack action chosen: skill 2015 (round 1, profit: -28.57)
This monster is not your huckleberry.
Stasis loop complete.
WHAM: SmartStasis complete.
WHAM: Running SmartStasis took 0.63 seconds.
WHAM: We currently think that the round number is: 1 and that the turn number is 146.
WHAM: SS did not finish the script off, continuing with script execution. 
WHAM: Starting evaluation and performing of attack
WHAM: We currently think that the round number is: 1 and that the turn number is 146.
hot wing (30.0 @ +55.0): 32μ * 46.5% = 14.88
Imp Ale (30.0 @ +55.0): 25μ * 46.5% = 11.625
leather mask (5.0 @ +55.0): 65μ * 7.75% = 5.0375
Value of stat gain: 148.75μ
WHAM: Attack option chosen: skill 3023 (round 1, profit: -92.86)
Queued: skill 3023
Building options...
Options built! (25 actions)
hot wing (30.0 @ +55.0): 32μ * 46.5% = 14.88
Imp Ale (30.0 @ +55.0): 25μ * 46.5% = 11.625
leather mask (5.0 @ +55.0): 65μ * 7.75% = 5.0375
Value of stat gain: 148.75μ
WHAM: Attack option chosen: skill 4020 (round 2, profit: 0)
Queued: skill 4020
Building options...
Options built! (25 actions)
Parsed round number: 1
Building options...
Options built! (25 actions)
WHAM: Evaluating the attack but not performing it took 3.30 seconds.
Stun option chosen: skill 3004 (round 1, profit: -21.43)
WHAM: Enqueuing a stun to help with the battle
WHAM: We can't Saucesplash.
false, false, false, true, false
WHAM: Enqueueing Entangling Noodles (macroid skill 3004).
Queued: skill 3004
Building options...
Options built! (24 actions)
WHAM: Successfully enqueued Entangling Noodles.
WHAM: We can't Saucesplash.
false, false, false, true, false
WHAM: Enqueueing Entangling Noodles (macroid skill 3004).
Unable to enqueue empty action.
WHAM: Failed to enqueue Entangling Noodles (entry 11 in the strategy).
WHAM: The following combat strategy was attempted: 
Entangling Noodles
Entangling Noodles
Salsaball
Round 1: Arbos executes a macro!
KoLmafia thinks it is round 2 but KoL thinks it is round 1
WHAM: Failed to enqueue Entangling Noodles. There's more detailed information in the gCLI.
You're on your own, partner.
Click here to continue in the relay browser.
 
Last edited:
Back
Top