Winterbay's Helpful Automatic Monsterbasher (WHAM)

I think WHAM 3.3 is broked.

[737] Cobb's Knob Treasury
Encounter: Knob Goblin Accountant
Strategy: E:\KoL\ccs\default.ccs [default]
Round 0: Rowah wins initiative!
Expected ), found foe (WHAM.ash, line 356)
Consult script 'WHAM.ash' not found.
You're on your own, partner.
Click here to continue in the relay browser.
 
I'm still getting the occasional "Failed to enqueue" single use skill errors (eg. "Feed" and "Swirl Cloak"), even in the latest version.
 
EDITED: Wrongly thought I had the same error as 3.3 even though I downloaded 3.3.1. Found an accidental 3.3 download in my kolmafia directory that I guess overrode the 3.3.1 inside the scripts directory.
 
Last edited:
Catch-22, that's probably still the standard BatBrain error, not something that can reliably be fixed by Winterbay. If he fixes it for automatic adventuring, it breaks for relay adventuring, because of how BatBrain runs things currently.

Should get fixed whenever the new BatBrain comes out.
 
Yeah... the issue was something like anything that runs in the initial execution has one turn-report, and everything after that uses a different one. Which is why mixed-combat does so weird, and Zarqon with his 'manual' combat never sees the problem. :) Automated combat, however, goes weird... and if the WHAM hack makes it play well with SS, it makes it NOT play well with itself. :)
 
Yeah... the issue was something like anything that runs in the initial execution has one turn-report, and everything after that uses a different one. Which is why mixed-combat does so weird, and Zarqon with his 'manual' combat never sees the problem. :) Automated combat, however, goes weird... and if the WHAM hack makes it play well with SS, it makes it NOT play well with itself. :)

So I'm guessing something was changed recently in an attempt to get WHAM to play nicer with SS?

I'm getting "WHAM: Failed to enqueue Entangling Noodles" now and that was never an issue in older versions. Any tips for me on how to restore the old behaviour until whatever niceties between WHAM and SS can be sorted out?
 
Could you run a fight with verbosity 9 trying to reproduce that? I've not seen that in a while...

Also, you could try this version. I did some minor tweaking to the once-detections which may help.
 
Last edited:
Also, you could try this version. I did some minor tweaking to the once-detections which may help.

Well, I removed "Entangling Noodles" and "Feed" from my dontuse list, and the first combat went for:

Code:
WHAM: The following combat strategy was attempted: 
Rain-Doh blue balls
Feed
Feed
Feed
Feed
Feed

So that bit is still not quite right.

So far I haven't ran into the failure to enqueue "Entangling Noodles" error, but that was only appearing in certain combats (I believe it was vs. unknown ML bugbears where the combat simulation exceeded the WHAM_round_limit, but for some reason I can't find reference to the error in my logs). I've set my unknown_ml to 70 instead of 110 now, but to me that seems like trying to avoid the problem instead of fixing it :p
 
Well, WHAM ignores unknown_ml for the bugbears (unless you set it to 0) in a way to attempt not killing you due to an incorrect unknown_ml when fighting increasingly more difficult bugbears.


Try this one (I really have no idea why it's doing that so I'm testing different things...)? :)
 
Last edited:
Try this one.

Definitely still not working with "Feed". So far this, like the previous version, appears to be working okay with Entangling Noodles.

Edit: Nope.

Here's the most information I can give you.

zlib WHAM_AlwaysContinue = true
zlib WHAM_hitchance = 0.5
zlib WHAM_maxround = 50
zlib WHAM_noitemsplease = false
zlib WHAM_round_limit = 10


Code:
Running ZLib version: r37 (current)
1 HP costs 0.253μ. ( 215 / 247 )
1 MP costs 2.45μ. ( 427 / 427 )
Running BatBrain version: 1.25 (current)
Running SmartStasis version: 3.15 (current)
Running WHAM version: 3.3 (current)
WHAM: We currently think that the round number is: 0 and that the turn number is 2431.
WHAM: Checking to see if WHAM sould adjust the unknown_ml for trendy bugbear chef.
WHAM: Setting up variables via BatBrain
Value of stat gain: 65.47μ
Value of stat gain: 745.16μ
ATT: 300 (94% × 67.9, death in 4)
DEF: 270 (8.59% × 61.9 (45), win in 17)
HP: 301, Value: 745.16 μ
Parsed round number: 1
Building options...
Value of stat gain: 2.36μ
Options built! (139 actions)
WHAM: We currently think that the round number is: 1 and that the turn number is 2431.
WHAM: You have no profitable MP restoratives.
WHAM: You have no profitable HP restoratives.
WHAM: You are fighting a trendy bugbear chef. Mafia considers that this monster has an attack of 0 or 0 when given a monster name.
WHAM: Mafia further considers that this monster has a defense value of 0 or 0 when given a monster name.
WHAM: Mafia further further considers that this monster has a HP value of 0 or 0 when given a monster name.
WHAM: Your current ML-adjustment is: 0.
WHAM: Monster HP is 301.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: Running SmartStasis
Profit per round: ActionProfitDamageOtherbase; Rogue Program (0μ)0μ9.41 (0 μ/dmg)MP: 9.41
Building custom actions...
Custom actions built! (0 actions)
Value of stat gain: 2.36μ
Stasis action chosen: use 5561 (round 1, profit: 8.11)
Value of stat gain: 2.36μ
Value of stat gain: 745.16μ
Attack action chosen: use 5676 (round 1, profit: -217.17)
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 2431.
WHAM: SS did not finish the fight, 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 2431.
Value of stat gain: 2.36μ
Value of stat gain: 745.16μ
WHAM: Attack option chosen: use 2068 (round 1, profit: -166.17)
Value of stat gain: 2.36μ
Stun option chosen: skill 3004 (round 1, profit: 0)
Queued: skill 3004
Building options...
Value of stat gain: 2.36μ
Options built! (138 actions)
Value of stat gain: 745.16μ
WHAM: Attack option chosen: use 5557 (round 2, profit: -30)
Queued: use 5557
Building options...
Value of stat gain: 2.36μ
Options built! (138 actions)
Value of stat gain: 745.16μ
WHAM: Item option chosen: use 2613 (round 3, profit: -75)
Auto-funk: merging 'use 5557' and 'use 2613'.
Queued: use 5557
Queued: use 2613
Building options...
Value of stat gain: 2.36μ
Options built! (138 actions)
Value of stat gain: 745.16μ
WHAM: Attack option chosen: skill 7056 (round 3, profit: 0)
Queued: skill 7056
Building options...
Value of stat gain: 2.36μ
Options built! (138 actions)
Value of stat gain: 745.16μ
WHAM: Attack option chosen: skill 7056 (round 4, profit: 0)
Queued: skill 7056
Building options...
Value of stat gain: 2.36μ
Options built! (138 actions)
Value of stat gain: 745.16μ
WHAM: Attack option chosen: skill 7056 (round 5, profit: -16.17)
Queued: skill 7056
Building options...
Value of stat gain: 2.36μ
Options built! (138 actions)
Value of stat gain: 745.16μ
WHAM: Attack option chosen: skill 7056 (round 6, profit: -16.17)
Queued: skill 7056
Building options...
Value of stat gain: 2.36μ
Options built! (138 actions)
WHAM: Attack option chosen: use 5560 (round 7, profit: 0)
Queued: use 5560
Building options...
Value of stat gain: 2.36μ
Options built! (137 actions)
Value of stat gain: 745.16μ
WHAM: Item option chosen: use 2678 (round 8, profit: 0.28)
Auto-funk: merging 'use 5560' and 'use 2678'.
Queued: use 5560
Queued: use 2678
Building options...
Value of stat gain: 2.36μ
Options built! (137 actions)
Value of stat gain: 744.02μ
WHAM: Attack option chosen: skill 7056 (round 8, profit: 0)
Queued: skill 7056
Building options...
Value of stat gain: 2.36μ
Options built! (137 actions)
WHAM: Reached WHAM_round_limit while looking for a way to kill the monster. Executing the current strategy and continuing from there.
WHAM: Enqueuing a stun to help with the battle
Unable to enqueue empty action.
KoLmafia thinks it is round 4 but KoL thinks it is round 1
WHAM: Failed to enqueue Entangling Noodles. Aborting to let you figure this out.
You're on your own, partner.

Edit 2: Perhaps even stranger, I added "Entangling Noodles" to dontuse and it still fails to enqueue "Entangling Noodles", one would assume it should not even attempt to do such a thing.
 
Last edited:
It continued to use the Noodles since that part of the script used the original opts, rather than myoptions which is the trimmed version which I've now fixed locally. Thanks for finding that bug :)

Just for completeness: Do you run WHAM automatically or from the Relay browser? Not that it should matter, but just, you know...

Also, could you try running this as a consult script and report the output back? It shouldn't do any actual adventuring so no damage done... :)

Code:
import WHAM.ash;

void main(int initround, monster foe, string pg) {
    act(pg);
    print("Feed has " + (happened("skill 7116") ? "been enqueued." : "not been enqueued."));
    print("Feed has happened " + times_happened("skill 7116") + " times.");
    enqueue($skill[Feed]);
    print("Feed has " + (happened("skill 7116") ? "been enqueued." : "not been enqueued."));
    print("Feed has happened " + times_happened("skill 7116") + " times.");
    enqueue($skill[Feed]);
    print("Feed has " + (happened("skill 7116") ? "been enqueued." : "not been enqueued."));
    print("Feed has happened " + times_happened("skill 7116") + " times.");
    abort();
}
 
Just for completeness: Do you run WHAM automatically or from the Relay browser? Not that it should matter, but just, you know...

Also, could you try running this as a consult script and report the output back? It shouldn't do any actual adventuring so no damage done... :)

I run WHAM automatically, only go to the relay browser if WHAM fails (which is a lot for me lately :(). I appreciate your help in trying to get it sorted.

Here's what the consult script does.
Code:
Feed has not been enqueued.
Feed has happened 0 times.
Feed has been enqueued.
Feed has happened 1 times.
Feed has been enqueued.
Feed has happened 1 times.
KoLmafia declares world peace.
You're on your own, partner.
 
Hmm... So, Batbrain obviously doesn't allow enqueueing of more than one of that skill, so the problem is then that WHAM tries to do this and thinks it works. This version should, in case it fails to enqueue a certain skill/item remove that from future consideration. Hopefully...

Try it? :)
 
Last edited:
I just popped back to the forums to see if a clever fix had appeared for the one time use stuff.
Seems like it's still being dealt with, and it also seems my last post might have been lost in the midst of the Dr. Awkward discussion.
Or more likely, I just explained things badly. I'll try and give a briefer description of what I found, using the time-honored debugging technique of "Stick Print Commands Everywhere".

In the version of WHAM from your last post, on line 431, you check the note field of the advevent under consideration for "once".
Under no circumstances will the "note" field ever contain "once".
For the feed skill, it is empty.
If you look in batbrain, line 225, you find where zarqon fills the note field, when he creates an advevent. He fills it with anything that comes after "!!".
If you take a look in data/batfactors.txt (at least my version) these are plaintext comments like "!! more dmg spading required".
It doesn't look like the "once" modifier is added into advevents at all, it's only present in the "special" field of "combat_recs" objects, which is a comma separated list loaded from batfactors.txt.

Zarqon deals with it in batbrain on line 832 for items and 893 for skills. He does it by checking the combat_recs for every skill, before he makes advevents out of them and sticks them into opts.

My knowledge of both WHAM and batbrain is pretty poor, so I'm not sure how best to solve the problem. Perhaps you can lookup from the advevent you are considering, back into factors, by adding something like this to the switch case on line 448 of WHAM:
Code:
if(contains_text(factors["skill",to_int(a.id)].special,"once") && happened(a.id))
    return false;
And similarly for items (and removing the check on line 431). But maybe that's slow? I have no idea, and I can't even test if it works right now.

... and again I've failed to make a concise post. Hopefully it helps anyway.
 
Last edited:
I just popped back to the forums to see if a clever fix had appeared for the one time use stuff.
Seems like it's still being dealt with, and it also seems my last post might have been lost in the midst of the Dr. Awkward discussion.
Or more likely, I just explained things badly. I'll try and give a briefer description of what I found, using the time-honored debugging technique of "Stick Print Commands Everywhere".

In the version of WHAM from your last post, on line 431, you check the note field of the advevent under consideration for "once".
Under no circumstances will the "note" field ever contain "once".
For the feed skill, it is empty.
If you look in batbrain, line 225, you find where zarqon fills the note field, when he creates an advevent. He fills it with anything that comes after "!!".
If you take a look in data/batfactors.txt (at least my version) these are plaintext comments like "!! more dmg spading required".
It doesn't look like the "once" modifier is added into advevents at all, it's only present in the "special" field of "combat_recs" objects, which is a comma separated list loaded from batfactors.txt.

Zarqon deals with it in batbrain on line 832 for items and 893 for skills. He does it by checking the combat_recs for every skill, before he makes advevents out of them and sticks them into opts.

My knowledge of both WHAM and batbrain is pretty poor, so I'm not sure how best to solve the problem. Perhaps you can lookup from the advevent you are considering, back into factors, by adding something like this to the switch case on line 448 of WHAM:
Code:
if(contains_text(factors["skill",to_int(a.id)].special,"once") && happened(a.id))
    return false;
And similarly for items (and removing the check on line 431). But maybe that's slow? I have no idea, and I can't even test if it works right now.

... and again I've failed to make a concise post. Hopefully it helps anyway.

I did read it but couldn't find it again when I started looking for it. Thanks for reposting. Let's see if this version does what it should then...
(I'm at a conference the entire day and tomorrow so may not be able to look into any success/failure reports for ~48 hours)
 
Back
Top