Winterbay's Helpful Automatic Monsterbasher (WHAM)

Edit: That said, the implementation of the bite wasn't very good since it wouldn't turn anything other than low level monsters anyway so changed it around a bit, should make it not use it as much (unless the best option you have of killing the monster will lead to the monster taking >50% of its HP in damage from the bite) and will probably solve your problem :)
Yeah, that seems reasonable. I can't imagine how the bite+claws synergy could be programmed without something on the order of the knapsack problem. Smooth sailing all day today in the battlefield. I'm doing a slow wossname, so it will be a while before I ascend again.
 
Updated to version 3.6 with the recent changes iterated out here. Uploaded batfactors.txt to the map manager to make sure it gets propagated after first checking that it works with the "real" batbrain.
I've added the updated BatBrain to the first post as well which for now is needed to get the maximum out of bear and zombie skills.
 
WHAM decided to go haywire on me with the rampaging adding machine today:
WHAM: Running SmartStasis
WHAM: Starting evaluation and performing of attack
Round 1: noodlenoob executes a macro!
Round 1: noodlenoob uses the 30669 scroll!
Round 2: noodlenoob uses the 33398 scroll!
You acquire an item: 64067 scroll
Round 3: noodlenoob executes a macro!
Round 3: noodlenoob uses the 64067 scroll!
Round 4: noodlenoob executes a macro!
Round 4: noodlenoob attacks!
Round 5: rampaging adding machine takes 35 damage.
Round 5: noodlenoob attacks!
Round 6: rampaging adding machine takes 35 damage.
Round 6: noodlenoob wins the fight!
Any ideas why it would use the 64067 scroll before creating a 668 scroll?
 
1) I'm amazed it actually did anything at all. Generally Mafia takes over so I'm happy to see that it worked at all...
2) That should only happen if you try to make a 64735 scroll and already have a 668 scroll which it should've enqueued together with your 64067 scroll, which it obviously didn't...

So, somehow the script thought you had one 668 scroll, which you apparently didn't, which is very confusing. It would've been interesting to see that on a verbosity of 8 or 9 to see what it tried to do...
 
The BatBrain in the first post has been updated to work together with Mafia's new name for gorgolok, the infernal seal (the nemesis' lair).
 
Every time I try to run the script, I get this:
Function 'enqueue( advevent, string, string )' undefined. This script may require a more recent version of KoLmafia and/or its supporting scripts. (WHAM.ash, line 745)
Consult script 'WHAM.ash' not found.
I’m running the newest BatBrain.ash, SmartStasis.ash, zlib.ash and WHAM.ash. I’ve also tried it with your BatBrain.ash, with no luck. I can’t actually find this 3‐argument version of enqueue anywhere. What am I doing wrong?
 
Make sure you don't have any old versions lying around anywhere. Line 745 is currently a comment about not being good at using restorers...
 
FYI and sorry if you already knew about this, but WHAM was still Smash & Graaagh'ing for me against things like the spookyraven cellar monsters whose drops aren't stealable. I fixed it by adding this to special_actions():

Code:
	boolean is_pickpocketable(monster mob) {
		int counts;
		foreach num,rec in item_drops_array(mob) {
			if(is_goal(rec.drop) && (rec.type == "n" || rec.type == "c" || rec.type == "b") )
				return false;
		}
		return true;
	}

and later changing:
Code:
	if(has_option($skill[Smash & Graaagh]) && (has_goal(m) > 0 && has_goal(m) < 1 && [b]!is_conditional[/b](m)) && (kill_rounds(attack_option().dmg) < die_rounds() - 1 || (contains_text(to_string(m), "Filthworm") && m != $monster[The Queen Filthworm]))) {

to

Code:
	if(has_option($skill[Smash & Graaagh]) && (has_goal(m) > 0 && has_goal(m) < 1 && [b]is_pickpocketable[/b](m)) && (kill_rounds(attack_option().dmg) < die_rounds() - 1 || (contains_text(to_string(m), "Filthworm") && m != $monster[The Queen Filthworm]))) {
 
Last edited:
I did in fact not know that so thanks. Even though I think I'll keep it as more than one function in case another case comes up where only one is interesting...
 
Okay, so Kodiak Moment has still been problematic for me with these updates, but I believe I've solved it proper. I took out the "spooky, stench" being added to the attack, and instead modified regular() in BatBrain. Not sure if it's your version or the main one that's calling it with Kodiak as -1, but I changed the last line and added a second, from this:

Code:
if (ts [b]>[/b] 0) foreach el in $elements[] if (numeric_modifier(el+" Damage") > 0) res[el] = numeric_modifier(el+" Damage");

to this:

Code:
if (ts [b]!=[/b] 0) foreach el in $elements[] if (numeric_modifier(el+" Damage") > 0) res[el] = numeric_modifier(el+" Damage");
[b]if ((ts == -1) && (my_path() == "Zombie Slayer")) { res[$element[stench]]+=res[$element[none]]/3;res[$element[spooky]]+=res[$element[none]]/3;res[$element[none]]=0; }[/b]

Since a zombie's Kodiak just seems to convert damage to stench & spooky this seems to turn out pretty accurate. Otherwise leaving "regular" in batfactors seems to make it assume all damage is physical, even with the "spooky, stench" added.

The != 0 is needed because Kodiak does in fact take into account bonus elemental damage.. and now that I think about it, this will convert bonus regular damage to spooky/stench and I'm not sure if that's accurate.

After a bit of testing, yes it does convert bonus physical also, but the estimate still ends up at the very high end of the range.. changed the damage conversion from 1/2 to 1/3 and that puts it on the low end but I guess that's the preferred option.
 
Last edited:
Thanks. I'll go with that for now, it's at least more true than what was there before :)

Also, the WHAM should not try to smash for things that cannot be pickpocketed.
 
Thanks. I'll go with that for now, it's at least more true than what was there before :)

Also, the WHAM should not try to smash for things that cannot be pickpocketed.
Cool. I'd like to add that WHAM's been treating me pretty darn well recently as I race through SCZ runs with bear arms. I've still got hugs disabled, for my own reasons, but between all the new skills I'm getting and WHAM using them well, it's getting darn easy. Thanks!
 
So I'm using the latest version of WHAM and I have Candyblast setup to not be used in WHAM_dontuse but it is still using it :/ Any ideas?

[372] Barrrney's Barrr
Encounter: tipsy pirate
Round 0: boxwhore wins initiative!
Running ZLib version: r37 (current)
1 HP costs 0.4μ. ( 176 / 200 )
1 MP costs 2.667μ. ( 54 / 66 )
Factoring in Scarysauce: (6) damage, retal
Factoring in plastic pumpkin bucket: (8.14) damage,
Running BatBrain version: 1.25 (current)
Running SmartStasis version: 3.15 (current)
Running WHAM version: 3.6.1 (current)
WHAM: We currently think that the round number is: 0 and that the turn number is 371.
WHAM: Checking to see if WHAM sould adjust the unknown_ml for Tipsy Pirate.
WHAM: No need to do anything with Tipsy Pirate.
WHAM: Setting up variables via BatBrain
bottle of rum (20.0 @ +137.29164564412514): 35μ * 47.46% = 16.61
bottle of rum (15.0 @ +137.29164564412514): 35μ * 35.59% = 12.46
cocktail napkin (10.0 @ +137.29164564412514): 25μ * 23.73% = 5.93
rum barrel charrrm (5.0 @ +137.29164564412514): 60μ * 11.86% = 7.12
tip jar (5.0 @ +137.29164564412514): 140μ * 11.86% = 16.61
Value of stat gain: 525μ
bottle of rum (20.0 @ +137.29164564412514): 35μ * 47.46% = 16.61
bottle of rum (15.0 @ +137.29164564412514): 35μ * 35.59% = 12.46
cocktail napkin (10.0 @ +137.29164564412514): 25μ * 23.73% = 5.93
rum barrel charrrm (5.0 @ +137.29164564412514): 60μ * 11.86% = 7.12
tip jar (5.0 @ +137.29164564412514): 140μ * 11.86% = 16.61
Value of stat gain: 525μ
ATT: 79 (94% × 8.53, death in 22)
DEF: 75 (97.73% × 60.1, win in 2)
HP: 74.5, Value: 646.73 μ
Parsed round number: 1
Building options...
Options built! (68 actions)
WHAM: We currently think that the round number is: 1 and that the turn number is 371.
WHAM: Current MP = 54 out of 66.
WHAM: You have no profitable MP restoratives.
WHAM: Current HP = 176 out of 200.
WHAM: You have no profitable HP restoratives.
WHAM: You are fighting a Tipsy Pirate. Mafia considers that this monster has an attack of 79 or 80 when given a monster name.
WHAM: Mafia further considers that this monster has a defense value of 75 or 72 when given a monster name.
WHAM: Mafia further further considers that this monster has a HP value of 71 or 70 when given a monster name.
WHAM: Your current ML-adjustment is: 0.
WHAM: Monster HP is 74.5.
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: [TABLE="width: 100%"]
[TR]
[TH] Action [/TH]
[TH] Profit [/TH]
[TH] Damage [/TH]
[TH] Other [/TH]
[/TR]
[TR]
[TD="align: left"] base; plastic pumpkin bucket (0μ) [/TD]
[TD="align: right"] [/TD]
[TD="align: center"] -- [/TD]
[TD="align: center"] [/TD]
[/TR]
[/TABLE]

Building custom actions...
Custom actions built! (1 actions)
bottle of rum (20.0 @ +137.29164564412514): 35μ * 47.46% = 16.61
bottle of rum (15.0 @ +137.29164564412514): 35μ * 35.59% = 12.46
cocktail napkin (10.0 @ +137.29164564412514): 25μ * 23.73% = 5.93
rum barrel charrrm (5.0 @ +137.29164564412514): 60μ * 11.86% = 7.12
tip jar (5.0 @ +137.29164564412514): 140μ * 11.86% = 16.61
Value of stat gain: 525μ
Attack action chosen: skill 3022 (round 1, profit: 26.79)
Stun action chosen: skill 7133 (round 1, profit: 8)
Stun action chosen: skill 7133 (round 1, profit: 8)
Custom action: use 2947 (stun first with skill 7133)
Stun action chosen: skill 7133 (round 1, profit: 8)
Queued: skill 7133
Building options...
Options built! (67 actions)
Queued: use 2947
Building options...
Options built! (67 actions)
Stasis action chosen: skill 3022 (round 3, profit: 22.23)
bottle of rum (20.0 @ +137.29164564412514): 35μ * 47.46% = 16.61
bottle of rum (15.0 @ +137.29164564412514): 35μ * 35.59% = 12.46
cocktail napkin (10.0 @ +137.29164564412514): 25μ * 23.73% = 5.93
rum barrel charrrm (5.0 @ +137.29164564412514): 60μ * 11.86% = 7.12
tip jar (5.0 @ +137.29164564412514): 140μ * 11.86% = 16.61
Value of stat gain: 652.97μ
Attack action chosen: skill 3022 (round 3, profit: 22.23)
Top of the stasis loop.
Queued: skill 3022
Building options...
Options built! (67 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; skill 7133; call batround; use 2947; call batround; sub finito; skill 3022; call batround; endsub; call finito; repeat hasskill 3022 && (!hpbelow 196.0 && hpbelow 200 && !mpbelow 54.0 && mpbelow 66 && !pastround 22)
Round 1: boxwhore executes a macro!
Round 1: boxwhore casts BEAR-BACKRUB!
You gain 35 hit points
Round 2: boxwhore uses the The Big Book of Pirate Insults!
You acquire an effect: Embarrassed (duration: 1 Adventure)
Round 3: Buckenstein can't think of a nasty trick to pull, so settles for kicking him square in his most sensitive area -- that's right, his ego -- and does 18 damage.
Round 3: tipsy pirate takes 18 damage.
Round 3: tipsy pirate takes 8 damage.
You lose 8 hit points
Round 3: boxwhore casts CANDYBLAST!
Round 4: tipsy pirate takes 13 damage.
Round 4: Buckenstein can't think of a good trick to play on your opponent, and resorts to just hitting him with the plastic bucket. It's not very imaginative, but it deals 30 damage.
Round 4: tipsy pirate takes 30 damage.
Round 4: tipsy pirate takes 10 damage.
You lose 15 hit points
Round 4: boxwhore wins the fight!
You gain 60 Meat
After Battle: Buckenstein jumps up and does the splits, pausing afterward to restitch his left leg.Buckenstein holds out the plastic pumpkin bucket, hoping for extra goodies.
You acquire an item: bottle of rum
You acquire an item: cocktail napkin
You gain 10 Muscleboundness
You gain 3 Enchantedness
You gain 8 Smarm
Happened: skill 7133
Happened: use 2947
Happened: skill 3022
Parsed round number: 0
Look! You found 1 bottle of rum (35μ)!
Look! You found 1 cocktail napkin (25μ)!
Stasis loop complete.
WHAM: SmartStasis complete.
WHAM: Running SmartStasis took 1.36 seconds.
WHAM: We currently think that the round number is: 31 and that the turn number is 372.
WHAM: SS has finished the fight. Aborting script execution.
Running ZLib version: r37 (current)
Running relay WHAM dontuse version: 0.1 (current)
 
Yeah, the problem is that SmartStasis decided to use it for some obscure reason so WHAM's wonderful protection never fired. I'm probably going to have to start looking at duplicating many of the SS functions in WHAM to allow for the dont_use-settings to be more universally useful which is a shame.
 
Any easy way I can disable SS from doing that then? >_> *tired of all this candy piling up*
 
It looks like WHAM isn't considering my base attack. At the moment here I was backfarming to get a guitar and so I had 242 muscle at the moment (Zombie run with both bear arms and all skills mastered, so tons of base attack/crit/etc and bear arm skills). I did have 0 horde at the moment, which is why it didn't consider zombie skills but it could have used my bear arms or just a regular attack.

Code:
Request 1 of 42 (Island: Belowdecks) in progress...

[997] Belowdecks
Encounter: grungy pirate
Strategy: /home/bhanes/.kolmafia/ccs/WHAM.ccs [default]
Round 0: chef_rannos wins initiative!
Round 1: Dead Items sticks out his foot and trips your opponent
Round 1: grungy pirate drops 17 attack power.
Round 1: grungy pirate drops 17 defense.
BCC: Monster HP is 140
Please fight the remainder of the fight yourself. You will be seeing this because you do not have a spell powerful enough to even four-shot the monster.
You're on your own, partner.
Click here to continue in the relay browser.


Round 1: chef_rannos attacks!
Round 2: grungy pirate takes 278 damage.
Round 2: chef_rannos wins the fight!
You gain 5 hit points
You gain 105 Meat
After Battle: Dead Items does a few breakdancing moves, barely slowing down to reattach an elbow mid-break.
You acquire an item: acoustic guitarrr
You acquire an item: good brain
You gain 23 Strengthliness
You gain 6 Enchantedness
You gain 13 Sarcasm
 
WHAM may or may not have missed that, but the fact is that that abort message is from the consultMyst function in BCA. I recommend you setting your settings to "do myst as ccs" or whatever it is called if you want WHAM to handle myst-runs in BCA as well :)
 
Does WHAM know it can use miniborg robots multiple times in a combat?

It used 2 in a combat (I have a pair of them) and then later in that combat used a Toy Mercenary...which AFAIK does about the same damage but costs me meat (I have 2 of those as well).


Example:
Code:
[1363] Giant's Castle
Encounter: Alphabet Giant
Round 0: chef_rannos wins initiative!
Round 1: Items-Meat produces a tubular red firecracker labeled M-54, lights the long fuse, and tosses it behind your opponent.
 > WHAM: Running SmartStasis
Round 1: chef_rannos executes a macro!
Round 1: chef_rannos casts SAUCY SALVE!
You gain 13 hit points
Round 2: chef_rannos casts CANDYBLAST!
Round 3: alphabet giant takes 71 damage.
 > WHAM: Starting evaluation and performing of attack
 > WHAM: Reached WHAM_round_limit while looking for a way to kill the monster. Executing the current strategy and continuing from there.
Round 3: chef_rannos executes a macro!
Round 3: chef_rannos uses the Miniborg Destroy-O-Bot!
Round 4: alphabet giant takes 27 damage.
Round 4: alphabet giant drops 4 attack power.
Round 4: alphabet giant drops 5 defense.
Round 4: chef_rannos uses the Miniborg Destroy-O-Bot and uses the Gnomitronic Hyperspatial Demodulizer!
Round 5: alphabet giant takes 25 damage.
Round 5: alphabet giant drops 4 attack power.
Round 5: alphabet giant drops 3 defense.
Round 5: alphabet giant takes 8 damage.
Round 5: alphabet giant takes 54 damage.
Round 5: chef_rannos uses the toy mercenary!
Round 6: alphabet giant takes 32 damage.
Round 6: chef_rannos wins the fight!
After Battle: Items-Meat lights a miniature Catherine wheel and dances in the shower of sparks.  How cute!
You gain 5 hit points
You gain 3 Mana Points
After Battle: Items-Meat says, "there seems to be a beat, now. I can feel it in my feet, now." He winks at you and starts dancing.
You gain 663 Meat
You acquire an item: heavy D
You acquire an item: original G
You gain 13 Muscleboundness
You gain 44 Enchantedness
You gain 6 Cheek

I added Toy Mercenary to the don't use, so hopefully it doesn't waste meat that way (as insignificant as an amount it is, it'll add up over time).
 
Back
Top