Winterbay's Helpful Automatic Monsterbasher (WHAM)

Winterbay

Active member
It already doesn't... At least mine hasn't been attacking at all in a long while, not even when back farming at really low level areas... The "attack"-case should contain
Code:
my_path() != "Avatar of Jarlsberg"
at the beginning which, unless I am very mistaken, should disallow attacking as Jarlsberg.
What verbosity was that running at? Must've been lower than 3 in order to get no printout at all...
 
Yeah I got beaten up again...

Code:
[864] Haunted Ballroom
Encounter: floating platter of hors d'oeuvres
Strategy: /~/.kolmafia/ccs/WHAM.ccs [default]
Round 0: chef_rannos wins initiative!
Round 1: chef_rannos attacks!
You lose 1 hit point
Round 2: chef_rannos attacks!
You lose 23 hit points
Round 3: chef_rannos attacks!
You lose 25 hit points
Round 4: chef_rannos attacks!
You lose 23 hit points

I'll try setting the verbosity higher and see if I can capture it again.
 

Theraze

Active member
Could try my suggestion to set BatBrain to be aware that attacks while in AoJ will always miss...

Basically, open BatBrain and put
Code:
   if (my_class() == $class[Avatar of Jarlsberg] && id == "attack") return 0.0;
into hitchance. Mine looks like this:
Code:
float hitchance(string id) {        // HITCH-nce
   if (id == "jiggle") return 1.0;
   if (my_class() == $class[Avatar of Jarlsberg] && id == "attack") return 0.0;
   if (have_equipped($item[operation patriot shield]) && happened($skill[throw shield]) && !happened("shieldcrit")) return 1.0;
 

Winterbay

Active member
Could try my suggestion to set BatBrain to be aware that attacks while in AoJ will always miss...

Basically, open BatBrain and put
Code:
   if (my_class() == $class[Avatar of Jarlsberg] && id == "attack") return 0.0;
into hitchance. Mine looks like this:
Code:
float hitchance(string id) {        // HITCH-nce
   if (id == "jiggle") return 1.0;
   if (my_class() == $class[Avatar of Jarlsberg] && id == "attack") return 0.0;
   if (have_equipped($item[operation patriot shield]) && happened($skill[throw shield]) && !happened("shieldcrit")) return 1.0;

But, WHAM should already do that for you so, in theory, it shouldn't help with chef_rannos issue. A higher verbosity would be useful though.
 

Theraze

Active member
Unless it's SmartStasis using attack for partial-stasis. In which case, excluding it from WHAM won't help, but my fix does... ;)
 

Winterbay

Active member
Nope, WHAM runs its own stasis-function which calls stasis_option (not stasis_action) which calls ok() which as stated above removes attack as an option unless that doesn't work for some reason and I've not had any problems with using attack so it is possibly something else :)
 
I've had WHAM try to enqueue Rain-Doh blue balls twice in a row despite being a once-per-fight item. It looks like it's being chosen both as a stun and as an attack.

Code:
[964] Video Game Level 1
Encounter: burning gopher fodder
Round 0: bigevildan wins initiative!
Running ZLib version: r37 (current)
1 HP costs 6.667μ. ( 156 / 156 )
1 MP costs 3.077μ. ( 77 / 194 )
Running BatBrain version: 1.31.1 (current)
Running SmartStasis version: 3.18 (current)
Running WHAM version: 4.8.1 (current)
WHAM: We currently think that the round number is: 0 and that the turn number is 963.
WHAM: Checking to see if WHAM sould adjust the unknown_ml for Video Game Minion (weak).
WHAM: No need to do anything with Video Game Minion (weak).
WHAM: Setting up variables via BatBrain
Value of stat gain: 550μ
Value of stat gain: 550μ
ATT: 160 (71.5% × 10.41, death in 21)
DEF: 90 (97.73% × 37.53 (2) (2), win in 2)
HP: 67, Value: 550 μ, RES: 0
Parsed round number: 1
Building options...
Options built! (161 actions)
WHAM: We currently think that the round number is: 1 and that the turn number is 963.
WHAM: Current MP = 77 out of 194.
WHAM: Your most profitable mp-restoring option is use 1788.
WHAM: Your most profitable mp-restoring option is use 1788.
WHAM: Your best MP restoring option available is: use 1788
WHAM: Current HP = 156 out of 156.
WHAM: You have no profitable HP restoratives.
WHAM: You are fighting a Video Game Minion (weak). Mafia considers that this monster has an attack of 160 or 160 when given a monster name.
WHAM: Mafia further considers that this monster has a defense value of 90 or 90 when given a monster name.
WHAM: Mafia further further considers that this monster has a HP value of 67 or 67 when given a monster name.
WHAM: Your current ML-adjustment is: 10.
WHAM: Monster HP is 67.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: Attack option chosen: use 5560 (round 1, profit: 0)
WHAM: Running SmartStasis
Profit per round: ActionProfitDamageOtherbase (0μ)0μ--
Building custom WHAM actions...
WHAM: This monster does not drop a goal item
Custom WHAM actions built! (0 actions)
Building custom actions...
Custom actions built! (0 actions)
WHAM: Stasis option chosen: use 5561 (round 1, profit: 0)
WHAM: Attack option chosen: use 5560 (round 1, profit: 0)
This monster is not your huckleberry.
Stasis loop complete.
WHAM: SmartStasis complete.
WHAM: Running SmartStasis took 1.46 seconds.
WHAM: SS did not finish the fight, continuing with script execution. 
WHAM: We currently think that the round number is: 1 and that the turn number is 963.
WHAM: Starting evaluation and performing of attack
WHAM: We currently think that the round number is: 1 and that the turn number is 963.
WHAM: Attack option chosen: use 5560 (round 1, profit: 0)
WHAM: Stun option chosen: use 5560 (round 1, profit: 0)
Monster HP is 67 according to Mafia and 67.0 according to BatBrain
Queued: use 5560
Building options...
Options built! (160 actions)
Queued: use 5560
Building options...
Options built! (160 actions)
Value of stat gain: 550μ
WHAM: Item option chosen: use 3114 (round 3, profit: 0)
Auto-funk: merging 'use 5560' and 'use 3114'.
Queued: use 5560
Queued: use 3114
Building options...
Options built! (160 actions)
Value of stat gain: 536.25μ
WHAM: Attack option chosen: skill 3022 (round 3, profit: 27.54)
Queued: skill 3022
Building options...
Options built! (160 actions)
Parsed round number: 1
Building options...
Options built! (161 actions)
WHAM: Evaluating the attack but not performing it took 2.09 seconds.
WHAM: Enqueuing a stun to help with the battle
Queued: use 5560
Building options...
Options built! (160 actions)
WHAM: We can't Saucesplash.
true, false, false, true, true
WHAM: Enqueueing Rain-Doh blue balls (macroid use 5560). Estimated damage: 0.0.
Unable to enqueue empty action.
WHAM: Failed to enqueue Rain-Doh blue balls (entry 2 in the strategy).
WHAM: The following combat strategy was attempted: 
Rain-Doh blue balls
Rain-Doh blue balls
Miniborg Destroy-O-Bot
Candyblast
Round 1: bigevildan executes a macro!
KoLmafia thinks it is round 2 but KoL thinks it is round 1
WHAM: Failed to enqueue Rain-Doh blue balls. There's more detailed information in the gCLI.
You're on your own, partner.
Click here to continue in the relay browser.
 

fronobulax

Developer
Staff member
Seeing things like the following a lot. Doesn't seem to actually cause a problem but perhaps worth mentioning. Black Cat Bad Moon Disco Bandit with latest versions of everything and BCCAscend.

The string "5021; attack" is not an integer; returning 5021 (wham.ash, line 449)
The string "7008; attack" is not an integer; returning 7008 (wham.ash, line 449)
The string "5003; attack" is not an integer; returning 5003 (wham.ash, line 449)

In case I have screwed up my versioning, 449 is a vprint in allMyOptions.
 

Winterbay

Active member
The thing is it exices away "use " leaving "<number>; attack". So, somehow the opt.id has become "use <number>; attack" which makes very limited sense...
 

Crowther

Active member
I have a problem with my balls . . .
Code:
> adv 1 out knob

Running ZLib version: r37 (current)
1 HP costs 5.1.. ( 114 / 114 )
1 MP costs 17.. ( 14 / 82 )
You have plastic pumpkin bucket equipped: (4.2) damage,
You have V for Vivala mask equipped: 2.48 (2.48) damage, stun 0.33, oncrit
Running BatBrain version: 1.31.1 (current)
Running SmartStasis version: 3.18 (current)
Running WHAM version: 4.8.1 (current)
WHAM: We currently think that the round number is: 0 and that the turn number is 2.
WHAM: Checking to see if WHAM sould adjust the unknown_ml for Knob Goblin Barbecue Team.
WHAM: No need to do anything with Knob Goblin Barbecue Team.
WHAM: Setting up variables via BatBrain
bowl of cottage cheese (60.0 @ +58.0): 31. * 94.8% = 29.39
Knob Goblin pants (8.0 @ +58.0): 30. * 12.64% = 3.79
Knob Goblin tongs (20.0 @ +58.0): 25. * 31.6% = 7.9
Value of stat gain: 340.31.
bowl of cottage cheese (60.0 @ +58.0): 31. * 94.8% = 29.39
Knob Goblin pants (8.0 @ +58.0): 30. * 12.64% = 3.79
Knob Goblin tongs (20.0 @ +58.0): 25. * 31.6% = 7.9
Value of stat gain: 340.31.
ATT: 67 (94% � (30.54), death in 6)
DEF: 66 (18.57% � 45.52 (5) (11) (25), win in 2)
HP: 40, Value: 404.93 ., RES: 0 (1) (-1) (-1)
Parsed round number: 2
Building options...
Options built! (37 actions)
WHAM: We currently think that the round number is: 2 and that the turn number is 2.
WHAM: Current MP = 14 out of 82.
WHAM: You have no profitable MP restoratives.
WHAM: Current HP = 114 out of 114.
WHAM: You have no profitable HP restoratives.
WHAM: You are fighting a Knob Goblin Barbecue Team. Mafia considers that this monster has an attack of 67 or 67 when given a monster name.
WHAM: Mafia further considers that this monster has a defense value of 66 or 66 when given a monster name.
WHAM: Mafia further further considers that this monster has a HP value of 40 or 67 when given a monster name.
WHAM: Your current ML-adjustment is: 65.
WHAM: Monster HP is 40.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: Attack option chosen: use 5560 (round 2, profit: 0)
WHAM: Running SmartStasis
Profit per round: ActionProfitDamageOtherbase; plastic pumpkin bucket (0.)0.0 (4.2) Actual: 4.2 (0 ./dmg)
Building custom WHAM actions...
WHAM: This monster does not drop a goal item
Custom WHAM actions built! (0 actions)
Building custom actions...
Custom actions built! (0 actions)
WHAM: Stasis option chosen: use 5561 (round 2, profit: 0)
WHAM: Attack option chosen: use 5560 (round 2, profit: 0)
This monster is not your huckleberry.
Stasis loop complete.
WHAM: SmartStasis complete.
WHAM: Running SmartStasis took 0.13 seconds.
WHAM: SS did not finish the fight, continuing with script execution.
WHAM: We currently think that the round number is: 2 and that the turn number is 2.
WHAM: Starting evaluation and performing of attack
WHAM: We currently think that the round number is: 2 and that the turn number is 2.
WHAM: Attack option chosen: use 5560 (round 2, profit: 0)
WHAM: Stun option chosen: use 5560 (round 2, profit: 0)
Monster HP is 40 according to Mafia and 40.0 according to BatBrain
Queued: use 5560
Building options...
Options built! (36 actions)
Auto-funk: merging 'use 5560' and 'use 5560'.
Queued: use 5560
Queued: use 5560
Building options...
Options built! (36 actions)
Parsed round number: 2
Building options...
Options built! (37 actions)
WHAM: Evaluating the attack but not performing it took 0.13 seconds.
WHAM: Enqueuing a stun to help with the battle
Queued: use 5560
Building options...
Options built! (36 actions)
WHAM: We can't Saucesplash.
true, false, false, true, false
WHAM: Enqueueing Rain-Doh blue balls (macroid use 5560). Estimated damage: 0.0.
WHAM: Enqueueing Rain-Doh blue balls (macroid use 5560). Estimated damage: 0.0.
Unable to enqueue empty action.
WHAM: Failed to enqueue Rain-Doh blue balls (entry 2 in the strategy).
WHAM: The following combat strategy was attempted:
Rain-Doh blue balls
Rain-Doh blue balls
Round 7: Crowther executes a macro!

[3] Outskirts of The Knob
KoLmafia thinks it is round 8 but KoL thinks it is round 2
WHAM: Failed to enqueue Rain-Doh blue balls. There's more detailed information in the gCLI.
You're on your own, partner.
Click here to continue in the relay browser.
I believe this is caused by blue balls being chosen for both stunning and attacking (cut from above):
Code:
WHAM: Attack option chosen: use 5560 (round 2, profit: 0)
WHAM: Stun option chosen: use 5560 (round 2, profit: 0)
I hacked my WHAM to never attack with blue balls, because that was the best I could come up with and that seemed to work.
 

Winterbay

Active member
I think one solution may be to change line 747 to
Code:
if(killer.id == "" || killer.id == stun.id)
so that if killer and stun action is the same it'll recalculate. It's not perfect since that will disallow any stun-option from also being an attack-option even if it is reusable, but it's better than aborting :)
 

Crowther

Active member
I think one solution may be to change line 747 to
Code:
if(killer.id == "" || killer.id == stun.id)
so that if killer and stun action is the same it'll recalculate. It's not perfect since that will disallow any stun-option from also being an attack-option even if it is reusable, but it's better than aborting :)
Dang it. That's so obviously better now that I see it. In my defense, I seem to have caught whatever bug is going around here.

EDIT: That worked pretty well!
 
Last edited:

Crowther

Active member
EDIT2: Heads up. Like the basement WHAM has lots of problem in the sea, which is the new black.

EDIT3: Dang it. That wasn't intended to be a new post. Still, it reminds me of the problems with deep basement dives.
 
Last edited:

Winterbay

Active member
That's interesting. I'll have to watch my multi that generally farms the sea to see if there's any trouble. ANy specifics you can give?
 

Winterbay

Active member
Ahh yes, also WHAM will probably kill you against a Mine Crab (my multi has special handling in its CCS for that monster for this reason). I tried getting it to work but could not.
 

Crowther

Active member
That's interesting. I'll have to watch my multi that generally farms the sea to see if there's any trouble. ANy specifics you can give?
Some mer-kins heal, which really bad for WHAM

It's more when you're somewhat outmatched that the problems start. I'm level 15 and even with equalization, tomato juice and gr8tness, WHAM loses most fights. Often it tried to be too efficient. I'm able to win every fight with noodles, blue balls, and summon levitation. Sure, that's expensive, but the point is, I can win. WHAM stuns then tries cheaper spells, often candyblast and clobber until I've lost.

I was sick all weekend, so things are a bit blurry. Like Bale I was thinking maybe a fast kill option would help.

Like I said, it reminds me of the basement. If you want to be similarly outmatched, just dive until WHAM loses a fight. However, last time I looked, it seems like there was lots of little problems that get you killed, not one big one. That was a while ago.

I figured basement diving was a special case, but now the sea might become more popular for people at level 13, so it might be a bigger problem. I don't know if I'll have time to debug. The weather outside is getting really nice.
 
Top