Winterbay's Helpful Automatic Monsterbasher (WHAM)

There's no case when it wouldn't return true. So you might as well cut out the salamanderity check and make things a bit cleaner.

Better yet, the "default" (there's no explicit default case, so it's the line after the switch) is "return true;", so the *entire* case can be commented out (or deleted).
 
Ok i have deleted mafia, redownloaded, readded all my scripts when i attempt to use the script button in the relay browser for WHAM to execute i get this message on any fight I do

Function 'tower_items( boolean )' undefined. This script may require a more recent version of Kolmafia and/or its
supporting scripts (WHAM.ash, line 464)
 
If you update WHAM it should now work again. At least it verifies now :)

I hope I can get back to actively playing again soon but atm life and work is way too busy. If any future things break WHAM and I do not appear to have noticed it would be most appreciated if someone could drop me an email at peter dot mohlin at gmail dot com.
 
Just a minute or two ago I posted a fairly major BatBrain update that severely broke WHAM. Due to Winterbay's post above, I figured I'd be helpful and post a version of WHAM that accounts for the changes in BatBrain, before I even write up my update posts. Hopefully this will pre-empt the error reports flowing in here.
 

Attachments

Just a minute or two ago I posted a fairly major BatBrain update that severely broke WHAM. Due to Winterbay's post above, I figured I'd be helpful and post a version of WHAM that accounts for the changes in BatBrain, before I even write up my update posts. Hopefully this will pre-empt the error reports flowing in here.

Thanks! :)
I note you commented out the times_happened-function. This was deliberately added because BatBrain tried to over-use skills with the Haiku Katana. Are you 100% sure that's been fixed?
 
I believe the reason you listed in the comments for that function existing was something like "we need this to check if actions are still valid". WHAM should, theoretically, not have to check action validity at all. If an action is present in opts[], it's an action available to you which you can take. So I commented it out, which was the easy way to getting a version of WHAM that verifies for your users.

Now, that's all just in theory, of course. In practice I'm not sure at all whether the haiku katana is handled, in fact if you ran into troubles with it I suspect that it's not. I'll have a look at making sure that's handled in BatBrain.
 
Not sure where to ask the question. WHAM seems to have recently started to fail to find a combat strategy for me. In the specific example below it does not even seem to consider spells even though the character is a Level 143 Pastamancer who can usually one-shot just about anything with Weapon of the Pastalord as manually doing so after WHAM gives up illustrates.

r15468, the version of WHAM zarqon posted above.

882517] The Secret Government Laboratory
Encounter: creepy little girl
Round 0: fronobulax wins initiative!
You lose 163 hit points
Round 1: SshoDomogonododononononono slaps your opponent repeatedly in the face with noodly tentacles, preventing her attack. "Agh, cut that out!" she yells, annoyed.
WHAM: Running SmartStasis
WHAM: Starting evaluation and performing of attack
WHAM: Unable to delevel until you can kill the monster without it killing you. Try it yourself.
WHAM: Unable to determine a valid combat strategy. For your benefit here are the numbers for your combat options.
WHAM: Jiggle your chefstaff: 23.50 potential damage (raw damage: 23.50) and a hitchance of 100.00%.
WHAM: Attack with your weapon: 1.21 potential damage (raw damage: 1.21) and a hitchance of 12.41%.
WHAM: Harold's bell: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: molybdenum magnet: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: strange goggles: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: anti-anti-antidote: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: palm-frond fan: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: Knob Goblin superseltzer: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: bottle of Monsieur Bubble: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: soggy used band-aid: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: You now have the knowledge needed to go forward and be victorious
Round 1: fronobulax executes a macro!
KoLmafia thinks it is round 2 but KoL thinks it is round 1
WHAM: Unable to figure out a combat strategy. Helpful information regarding your skills have been printed to the CLI
You're on your own, partner.
Round 2: fronobulax casts WEAPON OF THE PASTALORD!
KoLmafia thinks it is round 3 but KoL thinks it is round 2
Round 3: creepy little girl takes 477 damage.
Round 3: You hear PeggyLee chanting behind you, and feel stronger than before. Hopefully he didn't just sell your soul to some weird old god.
You gain 5 hit points
You gain 4 Mana Points
Round 3: creepy little girl drops 3 attack power.
Round 3: creepy little girl drops 5 defense.
Round 3: fronobulax wins the fight!
After Battle: PeggyLee surveys the scene from your back and sighs.
After Battle: PeggyLee bends its brim into an approximation of a smile. (+26 Stats)
You gain 44 Fortitude
You gain 88 Wizardliness
You gain 37 Sarcasm

I wondered about batfactors and I deleted it from my data directory. Nothing seems to notice that it is missing and tries to reload so the problem maybe as simple as batfactors being missing.
 
P.S. - I forced a batfactors update and the behavior did not change (#1768) and as I now recall, WHAM had similar problems with an ascending softcore Pastamancer although I just played manually and forgot to gather data.
 
WHAM is not working for me either.

Code:
 [1808] The Castle in the Clouds in the Sky (Top Floor)
Encounter: Goth Giant
Round 0: Xenthes wins initiative!
WHAM: Running SmartStasis
Round 1: Xenthes executes a macro!
Round 1: Xenthes casts POCKET CRUMBS!
You gain 11 Meat.
You gain 99 Meat.
WHAM: Starting evaluation and performing of attack
WHAM: Unable to delevel until you can kill the monster without it killing you. Try it yourself.
WHAM: Unable to determine a valid combat strategy. For your benefit here are the numbers for your combat options.
WHAM: Attack with your weapon: 110.58 potential damage (raw damage: 110.58) and a hitchance of 8.59%.
WHAM: dinner roll: 78.48 potential damage (raw damage: 78.48) and a hitchance of 100.00%.
WHAM: cold mashed potatoes: 78.48 potential damage (raw damage: 78.48) and a hitchance of 100.00%.
WHAM: whole turkey leg: 78.48 potential damage (raw damage: 78.48) and a hitchance of 100.00%.
WHAM: tequila grenade: 75.86 potential damage (raw damage: 75.86) and a hitchance of 100.00%.
WHAM: molotov cocktail cocktail: 62.78 potential damage (raw damage: 62.78) and a hitchance of 100.00%.
WHAM: water pipe bomb: 56.68 potential damage (raw damage: 56.68) and a hitchance of 100.00%.
WHAM: beer bomb: 56.68 potential damage (raw damage: 56.68) and a hitchance of 100.00%.
WHAM: rocky raccoon: 47.96 potential damage (raw damage: 47.96) and a hitchance of 100.00%.
WHAM: bottle of alcohol: 47.96 potential damage (raw damage: 47.96) and a hitchance of 100.00%.
WHAM: short calculator: 46.83 potential damage (raw damage: 46.83) and a hitchance of 100.00%.
WHAM: ferret bait: 45.78 potential damage (raw damage: 45.78) and a hitchance of 100.00%.
WHAM: bus pass: 40.98 potential damage (raw damage: 40.98) and a hitchance of 100.00%.
WHAM: firebomb: 39.24 potential damage (raw damage: 39.24) and a hitchance of 100.00%.
WHAM: chipotle wasabi cilantro aioli: 39.24 potential damage (raw damage: 39.24) and a hitchance of 100.00%.
WHAM: photoprotoneutron torpedo: 34.88 potential damage (raw damage: 34.88) and a hitchance of 100.00%.
WHAM: imp air: 32.70 potential damage (raw damage: 32.70) and a hitchance of 100.00%.
WHAM: paint bomb: 32.70 potential damage (raw damage: 32.70) and a hitchance of 100.00%.
WHAM: adder: 30.52 potential damage (raw damage: 30.52) and a hitchance of 100.00%.
WHAM: Air Dirty Laundry: 26.16 potential damage (raw damage: 26.16) and a hitchance of 100.00%.
WHAM: miniature boiler: 26.16 potential damage (raw damage: 26.16) and a hitchance of 100.00%.
WHAM: old-school beer pull tab: 21.80 potential damage (raw damage: 21.80) and a hitchance of 100.00%.
WHAM: pygmy blowgun: 21.80 potential damage (raw damage: 21.80) and a hitchance of 100.00%.
WHAM: frigid ninja stars: 19.18 potential damage (raw damage: 19.18) and a hitchance of 100.00%.
WHAM: flaregun: 17.27 potential damage (raw damage: 17.27) and a hitchance of 100.00%.
WHAM: stick of dynamite: 15.26 potential damage (raw damage: 15.26) and a hitchance of 100.00%.
WHAM: tin snips: 7.85 potential damage (raw damage: 7.85) and a hitchance of 100.00%.
WHAM: ancient poisoned dart: 6.98 potential damage (raw damage: 6.98) and a hitchance of 100.00%.
WHAM: crazy hobo notebook: 6.10 potential damage (raw damage: 6.10) and a hitchance of 100.00%.
WHAM: baseball: 6.10 potential damage (raw damage: 6.10) and a hitchance of 100.00%.
WHAM: Colon Annihilation Hot Sauce: 6.10 potential damage (raw damage: 6.10) and a hitchance of 100.00%.
WHAM: sonar-in-a-biscuit: 5.23 potential damage (raw damage: 5.23) and a hitchance of 100.00%.
WHAM: leftovers of indeterminate origin: 4.80 potential damage (raw damage: 4.80) and a hitchance of 100.00%.
WHAM: spectre scepter: 3.71 potential damage (raw damage: 3.71) and a hitchance of 100.00%.
WHAM: cinnamon troll doll: 3.49 potential damage (raw damage: 3.49) and a hitchance of 100.00%.
WHAM: grape troll doll: 3.49 potential damage (raw damage: 3.49) and a hitchance of 100.00%.
WHAM: blue raspberry troll doll: 3.49 potential damage (raw damage: 3.49) and a hitchance of 100.00%.
WHAM: Knob Goblin firecracker: 2.62 potential damage (raw damage: 2.62) and a hitchance of 100.00%.
WHAM: razor-sharp can lid: 2.18 potential damage (raw damage: 2.18) and a hitchance of 100.00%.
WHAM: Suckerpunch: 1.00 potential damage (raw damage: 1.00) and a hitchance of 100.00%.
WHAM: Talk About Politics: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: smoke grenade: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: unbearable light: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: Consume Burrowgrub: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: The Big Book of Pirate Insults: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: spider web: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: anti-anti-antidote: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: disease: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: handful of sand: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: wussiness potion: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: barbed-wire fence: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: patchouli incense stick: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: wand of pigification: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: Knob Goblin seltzer: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: ornate picture frame: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: clutch of dodecapede eggs: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: DNA extraction syringe: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: bronzed locust: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: Tom's of the Spanish Main Toothpaste: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: handful of sawdust: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: 30669 scroll: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: inkwell: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: 8-ball: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: Ye Olde Medieval Insult: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: powdered organs: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: filthy poultice: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: gauze garter: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: killing jar: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: tongue depressor: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: fabric softener: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: gas balloon: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: T.U.R.D.S. Key: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: gob of wet hair: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: meat vortex: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: fancy bath salts: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: hand grenegg: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: Space Tours Tripple: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: bottle of Monsieur Bubble: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: bowling ball: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: divine cracker: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: black pepper: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: tattered scrap of paper: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: green smoke bomb: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: disposable instant camera: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: scented massage oil: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: pumpkin bomb: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: 64067 scroll: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: pufferfish spine: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: Spooky Putty sheet: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: You now have the knowledge needed to go forward and be victorious
Round 2: Xenthes executes a macro!
KoLmafia thinks it is round 3 but KoL thinks it is round 2
WHAM: Unable to figure out a combat strategy. Helpful information regarding your skills have been printed to the CLI
You're on your own, partner.
 
It's probably the _spec changes of 15461, since when I had this problem yesterday I fixed it by reverting to 15460. It's a BatBrain issue which will be fixed when all of its _spec calls are changed to Generated:_spec after you update to 15467. Which means that BatBrain's since probably needs to update to that as well.
 
As I said, it's not a WHAM problem. Update your BatBrain manually to replace _spec with Generated:_spec or ask for fixes on that thread.
 
I've checked in Zarqon's version above. Please note that this removed custom handling for the Haiku Katana. If you use this please keep a lookout for any problems. It is very possible that the problem has been resloved and the special code is no longer needed, but it's still in there (commented out) in case it needs to be reinstated.
 
For some reason WHAM thinks that the anti-antidote deals damage and as such I have to pretty much finish every combat manually because the script just gets in an endless loop.

Example of the output (everything after the cut is repetition until it breaks):

Code:
[454] The Goatlet
Encounter: dairy goat
Round 0: DeathPhoenyx wins initiative!
Round 1: DeathPhoenyx casts TRANSCENDENT OLFACTION!
KoLmafia thinks it is round 2 but KoL thinks it is round 1
WHAM: Running SmartStasis
Round 2: DeathPhoenyx executes a macro!
Round 2: DeathPhoenyx casts SUMMON LOVE SCARABS!
KoLmafia thinks it is round 3 but KoL thinks it is round 2
Round 3: dairy goat takes 10 damage.
You gain 3 Mana Points
WHAM: Starting evaluation and performing of attack
WHAM: Enqueuing a stun to help with the battle
WHAM: We are going to 3-shot with Summon Love Gnats, Summon Love Stinkbug and anti-anti-antidote.
Round 3: DeathPhoenyx executes a macro!
Round 3: DeathPhoenyx casts SUMMON LOVE GNATS!
KoLmafia thinks it is round 4 but KoL thinks it is round 3
Round 4: DeathPhoenyx casts SUMMON LOVE STINKBUG!
Round 5: dairy goat takes 6 damage.
Round 5: DeathPhoenyx uses the anti-anti-antidote!
WHAM: Starting evaluation and performing of attack
WHAM: We are going to 1-shot with anti-anti-antidote.
Round 6: DeathPhoenyx executes a macro!
Round 6: DeathPhoenyx uses the anti-anti-antidote!
KoLmafia thinks it is round 7 but KoL thinks it is round 4
WHAM: Starting evaluation and performing of attack
WHAM: We are going to 1-shot with anti-anti-antidote.
Round 7: DeathPhoenyx executes a macro!
Round 7: DeathPhoenyx uses the anti-anti-antidote!
KoLmafia thinks it is round 8 but KoL thinks it is round 4

(I am ascending as Ed btw, in case that matters)

[EDIT]

now that I have progressed in my ascension a little bit more, I got the book of pirate insults, now WHAM alternates between the book and the antidote in thinking they somehow deal damage
 
Last edited:
For some reason WHAM thinks that the anti-antidote deals damage. . .

Code:
Round 5: dairy goat takes 6 damage.
Round 5: DeathPhoenyx uses the anti-anti-antidote!
The monster did take damage the round WHAM used an anti-anti-antidote, from the stink bugs. Then WHAM used them again, but you likely don't have any, because the KoL round is no longer advancing. So the infinite loop is not doing anything, but wasting server resources. I ran WHAM in Ed hundreds of times and never saw this, so it's likely you have different. Here's my WHAM settings:
Code:
> zlib WHAM

Copy/paste/modify/enter any of the following lines in the CLI to edit settings:

zlib WHAM_AlwaysContinue = false
zlib WHAM_happymediumglow =
zlib WHAM_hitchance = 0.5
zlib WHAM_killit = false
zlib WHAM_maxround = 25
zlib WHAM_noitemsplease = false
zlib WHAM_round_limit = 15
zlib WHAM_roundcost_aftercore = 50
zlib WHAM_roundcost_inrun = notused
zlib WHAM_roundcost_ronin = 40
zlib WHAM_safetymargin = 0
zlib WHAM_UseSeaLasso = true
The one I wonder most about is WHAM_roundcost_ronin. Also, a higher verbosity (zlib verbosity = #) would be helpful. I run at 5 all the time. If you can abort mid combat and restart and it still uses them, then try aborting and switching to 10 and restarting. That output would be the most useful.

Normally I get into debugging bad WHAM's choices, but sadly I'll be pressed for time soon and I'm likely not going back to Ed. Hopefully the above will help get things started and someone else will figure it out.
 
the script actually tries to keep using the items until it reaches the max # of turns (25 in my settings, IIRC), I snipped it because as I mentioned in my post, everything after that it is just repeating that same message from that last turn until it crashes. I can understand that it is somehow thinking that the antidote deals damage because it tried to use it one round and the stinkybug dealt damage then and it attributed it to the antidote, but why on earth would it even try to use the antidote if I am not poisoned? the same happens with the book of pirate insults, the script tries to use it against non-pirates thinking it deals damage somehow.
 
At verbosity 10, the script only prints information, information which someone can use to actually fix something (that's what you're hoping for, correct?). So that's probably what you should do.
 
I was wondering if you have considered making this script work with Ed the undying so that it recognizes that monsters can have flyers used on them three times per combat and recognize that HP is much less important than MP in the first two fights?
 
Back
Top