Winterbay's Helpful Automatic Monsterbasher (WHAM)

Could that be propagated to the SVN? It almost sounds like a bug fix, to be honest.
I'm not sure that's the right choice for everyone. Other people will have to chime in. However, one of the great things about SVN is you can make your own changes. You can edit "svn/winterbay-mafia-wham/scripts/WHAM.ash" and do "svn sync" and you'll have the change all for yourself. Future changes to the script are automatically merged. Although changes to the same area might cause a merge failure. I'm not sure how that works, since I haven't had one with mafia's built in svn.
 
Done, thanks.

EDIT: Getting this error on failing combat math, now:

Expression syntax errors for 'modifier_eval()':
Can't understand songduration-10)/3
Expected ), found (zlib.ash, line 188)
You're on your own, partner.
 
Last edited:
Done, thanks.

EDIT: Getting this error on failing combat math, now:

Expression syntax errors for 'modifier_eval()':
Can't understand songduration-10)/3
Expected ), found (zlib.ash, line 188)
You're on your own, partner.
That's likely a BatBrain/batfactors problem. Are you using a weapon that lets you cast accordion bash, but mafia doesn't know it's an accordion?
 
One OCRS tweak... stasis is more dangerous than you might expect, and so I tweaked my profitforstasis line as such:
Code:
	while ((to_profit(plink) > ((my_path() == "One Crazy Random Summer" ? 5 : 1) * to_float(vars["BatMan_profitforstasis"])) + (can_interact() ? WHAM_roundcost_aftercore : WHAM_roundcost_ronin) || is_our_huckleberry() || train_skills()) &&
Basically, if you're in OCRS, consider it 5* more expensive to stasis than normal. This means I don't need to mess with my variables - Cocoabo might still be nice, but with solid gold monsters you don't need its meat as much - but I don't die as often.

YMMV.
 
Feature Request for WHAM: Provide a user toggle that determines whether WHAM aborts when it cannot figure out what to do or just exits, thus passing control to the next line in a user CCS.

Comment: I would apply this just to the case where WHAM can't figure out what to do. If WHAM wants to abort because of the round count or other conditions it should still be allowed to do so without regard to this new toggle.

Extra Credit: If the toggle is implemented and set in favor of continuing, log the monster encountered plus the options WHAM considered and found unsatisfactory by appending to a file WHAM_Spade_Opportunities.txt I suspect that would increase the number of people who are willing to help improve WHAM (and implicitly BatBrain's data) by reporting failures with enough information to make an after the fact diagnosis feasible.

I have added this, or at least I think so, to WHAM Beta (very limited testing and I don't want to break WHAM with my lack of time). At first run it should set a new boolean zlib-setting WHAM_Continue_CCS which defaults to false.

It does compile, but it's not tested any further than that.
 
Having now run, since I had logged in to verify the script, my first turns in like forever I can say that it appears to have had no negative side effects of running a lazy farming script on a level 34 Sacueror :)
 
Right. My time to code and play is getting even more limited (kid number two was born on Friday) and so I have added Crowther as a maintainer as well now that Sourceforge is back up.
If anyone else is willing to help out maintaining the script please send me a message with your Sourceforge userID and I'll see if I can't add more people.
 
I tried to convince Winterbay that "New girlfriend" was a good enough excuse to say "No", but "New baby" is one hell of a trump card. I have none of my own, but have friends, family and lovers who are parents all say the same thing. It's the best thing they've ever done. Thanks for planning in advance instead of just going away. Take good care of your family.

I really enjoy this script. I remember looking forward to more than one weekend of digging into why it wasn't exactly optimal. I don't foresee having that time again, but you never know. I've never once committed a change to Sourceforge, so if that time comes, please be nice.
 
You could adjust your custom combat script to recognize certain modifiers and CLEESH automatically.

A little while ago I tried to match OCRS modifiers in my CCS, but it didn't work. User error? Is this new functionality?

Also, WHAM aborts for me in any combats that immediately follow a fight with an "optimal" opponent. When I looked into it, it appeared that it was unable to tell that a new combat had started. Is this a known issue? I've been manually finishing the combats & re-starting my scripts, but it is somewhat annoying.

Edit: I just tried it again, and it certainly doesn't work if I just add a section with the name of the OCRS attribute.

Oh, and: I tried setting "zlib verbosity = 9". Is this relevant to the fight-after-optimal issue that I see?
Code:
[4269] The Haunted Library
Encounter: tie-dyed, wet writing desk
Round 0: grep wins initiative!
1 HP costs 0.12μ. ( 113 / 141 )
1 MP costs 2.655μ. ( 61 / 136 )
WHAM: We currently think that the round number is: 0 and that the turn number is 4268.
WHAM: Checking to see if WHAM sould adjust the unknown_ml for writing desk.
WHAM: No need to do anything with writing desk.
WHAM: Setting up variables via BatBrain

note that the turn number doesn't match.

Also, I happened to run into one other thing that WHAM sometimes does. (Sorry, verbose was back off again) I am fighting without a weapon. (I have a frosty halo equipped instead, for item drops.) Why does it decide to attack with weapon in the fight below?? (Especially since it also seems to expect to cast Concerto de los Muertos, which could finish the fight in a few rounds, if done first. In fact, the more I look at this, the more I think it planned reasonably, but then reversed the order of its actions before executing them. Is that possible?)

Code:
Request 10 of 50 (Manor1: The Haunted Library) in progress...

[4280] The Haunted Library
Encounter: restless, wet bookbat
Strategy: /media/weston/A4D3-141C/kol/kolmafia/ccs/fight_optimizer.ccs [default]
Round 0: grep wins initiative!
WHAM: Running SmartStasis
Round 1: grep executes a macro!
Round 1: grep tries to steal an item!
Round 2: You lose 27 hit points
WHAM: Starting evaluation and performing of attack
WHAM: We are going to 7-shot with attack with your weapon, attack with your weapon, attack with your weapon, attack with your weapon, beehive, Wassail and Concerto de los Muertos.
Round 2: grep executes a macro!
Round 2: grep attacks!
Round 3: bookbat takes 4 damage.
Round 3: You lose 27 hit points
Round 3: grep attacks!
Round 4: You lose 28 hit points
Round 4: grep attacks!
Round 5: bookbat takes 4 damage.
Round 5: You lose 28 hit points
Round 5: grep attacks!
Round 6: You lose 27 hit points
 
Last edited:
A little while ago I tried to match OCRS modifiers in my CCS, but it didn't work. User error? Is this new functionality?
I've seen reports of other people doing it (with native macros I think), but I never tried myself.

Also, WHAM aborts for me in any combats that immediately follow a fight with an "optimal" opponent. When I looked into it, it appeared that it was unable to tell that a new combat had started. Is this a known issue? I've been manually finishing the combats & re-starting my scripts, but it is somewhat annoying.
I've seen this issue with other free fights (goth kid) and it only seems to happen if the next monster is the same as the previous one. It started happening after Winterbay did that major rewrite to avoid scanning the session log. I kept expecting to have time to look into it, but haven't. It was a regular issue for me when I had time to do OCRS.
 
That's what I get for not checking.
And not remembering that LFM's intro text triggers my "annoying" abort (because it's "one of the most annoying, ...").
 
Not sure whether this is WHAM or SmartStasis or guyy's auto-trick-or-treat script at work, but something weird is happening when I run the auto-trick-or-treat script. It looks like it thinks SmartStasis killed the monster and then gave up? This is verbosity 9 output.

Code:
Encounter: kid who is too old to be Trick-or-Treating
Round 0: DancingMAD wins initiative!
Round 0: DancingMAD casts CURSE OF WEAKSAUCE! (auto-attack)
Battle! House #3 contains a kid who is too old to be Trick-or-Treating.
1 HP costs 0.136μ. ( 716 / 817 )
1 MP costs 2.439μ. ( 199 / 1839 )
WHAM: We currently think that the round number is: 0 and that the turn number is 5554.
WHAM: Checking to see if WHAM sould adjust the unknown_ml for kid who is too old to be Trick-or-Treating.
WHAM: No need to do anything with kid who is too old to be Trick-or-Treating.
WHAM: Setting up variables via BatBrain
Setting monster to kid who is too old to be Trick-or-Treating...
bottle of whiskey (15.0 @ +246.75): 35μ * 52.01% = 18.2
Effermint™ tablets (10.0 @ +246.75): 165μ * 34.67% = 57.21
sturdy cane (5.0 @ +246.75): 101μ * 17.34% = 17.51
Value of stat gain: 716.04μ
Staggers have a 8% chance of being blocked.
Factoring in Jalapeño Saucesphere: 3 damage, retal
Factoring in Scarysauce: (6) damage, retal
Events created: Jalapeño Saucesphere, Scarysauce
Base round: damage, player damage, 0 meat
ATT: 299 (6% × 9.05, death in 716)
DEF: 297 (95.45% × 250.18 (10), win in 2)
HP: 199, Value: 808.97 μ, RES: 0.43 (0.23) (0.23) (0.23) (0.23) (0.23), Happenings: 3, ID: 1449
Parsed round number: 0 (real: 1)
WHAM: We currently think that the round number is: 31 and that the turn number is 5554.
WHAM: Current MP = 199 out of 1839.
WHAM: You have no profitable MP restoratives.
WHAM: Current HP = 817 out of 817.
WHAM: You have no profitable HP restoratives.
WHAM: You are fighting a kid who is too old to be Trick-or-Treating. Mafia considers that this monster has an attack of 299 or 308 when given a monster name.
WHAM: Mafia further considers that this monster has a defense value of 297 or 308 when given a monster name.
WHAM: Mafia further further considers that this monster has a HP value of 199 or 231 when given a monster name.
WHAM: Your current ML-adjustment is: 58.
WHAM: You have muscle = 623, mysticality = 897, and moxie = 620
WHAM: Monster HP is 199.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; 
Events created: attack
Base round: damage, player damage, 0 meat
WHAM: No valid attack options (Best option, '', not good enough)
WHAM: Running SmartStasis
Profit per round: ActionProfitDamageOtherbase (0μ)0μ--
Building custom WHAM actions...
Custom WHAM actions built! (0 actions)
Skipping since it is not ok.
WHAM: No valid attack options (Best option, '', not good enough)
This monster is not your huckleberry.
Stasis loop complete.
WHAM: SmartStasis complete.
WHAM: Running SmartStasis took 0.03 seconds.
WHAM: SS has finished the fight. Aborting script execution. 
1 HP costs 0.136μ. ( 716 / 817 )
1 MP costs 2.439μ. ( 199 / 1839 )
WHAM: We currently think that the round number is: 0 and that the turn number is 5554.
WHAM: Checking to see if WHAM sould adjust the unknown_ml for kid who is too old to be Trick-or-Treating.
WHAM: No need to do anything with kid who is too old to be Trick-or-Treating.
WHAM: Setting up variables via BatBrain
Setting monster to kid who is too old to be Trick-or-Treating...
bottle of whiskey (15.0 @ +246.75): 35μ * 52.01% = 18.2
Effermint™ tablets (10.0 @ +246.75): 165μ * 34.67% = 57.21
sturdy cane (5.0 @ +246.75): 101μ * 17.34% = 17.51
Value of stat gain: 716.04μ
Staggers have a 8% chance of being blocked.
Factoring in Jalapeño Saucesphere: 3 damage, retal
Factoring in Scarysauce: (6) damage, retal
Events created: Jalapeño Saucesphere, Scarysauce
Base round: damage, player damage, 0 meat
ATT: 299 (6% × 9.05, death in 716)
DEF: 297 (95.45% × 250.18 (10), win in 2)
HP: 199, Value: 808.97 μ, RES: 0.43 (0.23) (0.23) (0.23) (0.23) (0.23), Happenings: 3, ID: 1449
Parsed round number: 0 (real: 1)
WHAM: We currently think that the round number is: 31 and that the turn number is 5554.
WHAM: Current MP = 199 out of 1839.
WHAM: You have no profitable MP restoratives.
WHAM: Current HP = 817 out of 817.
WHAM: You have no profitable HP restoratives.
WHAM: You are fighting a kid who is too old to be Trick-or-Treating. Mafia considers that this monster has an attack of 299 or 308 when given a monster name.
WHAM: Mafia further considers that this monster has a defense value of 297 or 308 when given a monster name.
WHAM: Mafia further further considers that this monster has a HP value of 199 or 231 when given a monster name.
WHAM: Your current ML-adjustment is: 58.
WHAM: You have muscle = 623, mysticality = 897, and moxie = 620
WHAM: Monster HP is 199.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; 
Events created: attack
Base round: damage, player damage, 0 meat
WHAM: No valid attack options (Best option, '', not good enough)
WHAM: Running SmartStasis
Profit per round: ActionProfitDamageOtherbase (0μ)0μ--
Building custom WHAM actions...
Custom WHAM actions built! (0 actions)
Skipping since it is not ok.
WHAM: No valid attack options (Best option, '', not good enough)
This monster is not your huckleberry.
Stasis loop complete.
WHAM: SmartStasis complete.
WHAM: Running SmartStasis took 0.02 seconds.
WHAM: SS has finished the fight. Aborting script execution. 
You're on your own, partner.
Click here to continue in the relay browser.
 
Nope. WHAM just believes combat is over for some reason. See?
Parsed round number: 0 (real: 1)
WHAM: We currently think that the round number is: 31 and that the turn number is 5554.
Possibly because you're using an auto-attack rather than doing it through mafia, it's deciding that combat has already expired. The combination of round 0 with prior actions...
 
Back
Top