Winterbay's Helpful Automatic Monsterbasher (WHAM)

...(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)

You wouldn't happen to be at BMVC (British Machine Vision Conference) would you? :)

Let's see if this version does what it should then...
Unfortunately item stuff in batfactors uses the index "item" not the index "use" (which is what the matcher finds).
Also you are running contains_text() on the whole combat_rec object rather than just it's "special" field. I didn't even realise you could do that for custom types, does it definitely work?

I've attached a version, where I fixed the "use"/"item" confusion in all the places winter added it. I tried to test it quickly this morning but ran out of time, seems like it might possibly work for skills though (maybe).
 

Attachments

  • WHAM.ash
    51.3 KB · Views: 30
Last edited:

Winterbay

Active member
Nope, a kickoff conference for my depatrment after a reorganisation. I'm posting this during a presentation so you can guess how interesting that one is...

1) Totally forgot about the find()thing. I've only copied things around with regex before as well :)

2) Did I really forget to add .special? That's what I gett for programming at 6 in the morning... If we want to change the "use" to "item" I guess the following should work:

Code:
if(contains_text(factors[(optid.group(1) == "use" ? "item" : "skill"), to_int(optid.group(1)].special, "once"))

Completely untested as I'm on my phone atm...
 

Winterbay

Active member
So... I think I've ironed out the problems. Could those with reproducible problems with once per battle items/skills test this version?
 
Last edited:

Catch-22

Active member
So... I think I've ironed out the problems. Could those with reproducible problems with once per battle items/skills test this version?

Still not working quite right for skills, items seem to be under control though.

WHAM: Running SmartStasis
WHAM: Starting evaluation and performing of attack
WHAM: Enqueuing a stun to help with the battle
WHAM: Failed to enqueue Feed (entry 3 in the strategy).
WHAM: The following combat strategy was attempted:
Rain-Doh blue balls
Feed
Feed
Feed
Feed
Feed
Feed
 

hollow2201

New member
I am using the WHAM.ash version posted in #323. Verbosity at 9. Running from relay browser. I was getting the error with the Rain-doh blue balls as well but I can't seem to reproduce that consistently.

Error when using bag o' tricks:
Code:
[698] The Domed City of Ronaldus
Encounter: unlikely survivor
Round 0: Random Thief wins initiative!
Round 1: Item Absinthe lights a cute little string of firecrackers and tosses them on the ground behind your opponent.
Running ZLib version: r37 (current)
1 HP costs 0.32μ. ( 273 / 273 )
1 MP costs 8μ. ( 299 / 415 )
Factoring in Scarysauce: (6) damage, retal
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 697.
WHAM: Checking to see if WHAM sould adjust the unknown_ml for Unlikely Survivor.
WHAM: No need to do anything with Unlikely Survivor.
WHAM: Setting up variables via BatBrain
elven hardtack (25.0 @ +205.0): 30μ * 76.25% = 22.88
elven squeeze (25.0 @ +205.0): 299μ * 76.25% = 227.99
Notes from the Elfpocalypse, Chapter IV (15.0 @ +205.0): 100μ * 45.75% = 45.75
Value of stat gain: 264.69μ
elven hardtack (25.0 @ +205.0): 30μ * 76.25% = 22.88
elven squeeze (25.0 @ +205.0): 299μ * 76.25% = 227.99
Notes from the Elfpocalypse, Chapter IV (15.0 @ +205.0): 100μ * 45.75% = 45.75
Value of stat gain: 264.69μ
ATT: 115 (55% × 2.73, death in 182)
DEF: 124 (57.3% × 31.39, win in 3)
HP: 97.65, Value: 561.3 μ
Parsed round number: 1
Building options...
Options built! (151 actions)
WHAM: We currently think that the round number is: 1 and that the turn number is 697.
WHAM: Current MP = 299 out of 415.
WHAM: You have no profitable MP restoratives.
WHAM: Current HP = 273 out of 273.
WHAM: You have no profitable HP restoratives.
WHAM: You are fighting a Unlikely Survivor. Mafia considers that this monster has an attack of 115 or 115 when given a monster name.
WHAM: Mafia further considers that this monster has a defense value of 124 or 124 when given a monster name.
WHAM: Mafia further further considers that this monster has a HP value of 93 or 93 when given a monster name.
WHAM: Your current ML-adjustment is: 0.
WHAM: Monster HP is 97.65.
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: ActionProfitDamageOtherbase; Astral Badger (0μ)0μ20 (0 μ/dmg)
Building custom actions...
Custom actions built! (0 actions)
Stasis action chosen: use 2678 (round 1, profit: 0.03)
Attack action chosen: skill 7081 (round 1, profit: 0)
This monster is not your huckleberry.
Stasis loop complete.
WHAM: SmartStasis complete.
WHAM: Running SmartStasis took 0.39 seconds.
WHAM: We currently think that the round number is: 1 and that the turn number is 697.
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 697.
WHAM: Attack option chosen: skill 7081 (round 1, profit: 0)
WHAM: No profitable stun option
Queued: skill 7081
Building options...
Options built! (150 actions)
WHAM: Attack option chosen: skill 7081 (round 2, profit: 0)
Queued: skill 7081
Building options...
Options built! (150 actions)
Parsed round number: 1
Building options...
Options built! (151 actions)
WHAM: Evaluating the attack but not performing it took 0.79 seconds.
WHAM: We can't Saucesplash.
false, false, false, false, true
WHAM: Enqueueing Open the Bag o' Tricks (macroid skill 7081).
Queued: skill 7081
Building options...
Options built! (150 actions)
WHAM: Successfully enqueued Open the Bag o' Tricks.
WHAM: We can't Saucesplash.
false, false, false, false, true
WHAM: Enqueueing Open the Bag o' Tricks (macroid skill 7081).
Unable to enqueue empty action.
WHAM: Failed to enqueue Open the Bag o' Tricks (entry 2 in the strategy).
WHAM: The following combat strategy was attempted: 
Open the Bag o' Tricks
Open the Bag o' Tricks
Round 1: Random Thief executes a macro!
KoLmafia thinks it is round 2 but KoL thinks it is round 1
WHAM: Failed to enqueue Open the Bag o' Tricks. There's more detailed information in the gCLI.
You're on your own, partner.

Error when using feed skill from plastic vampire fangs:
Code:
[699] The Domed City of Ronaldus
Encounter: unlikely survivor
Round 0: Random Thief wins initiative!
Round 1: Item Absinthe produces a tubular red firecracker labeled M-46, lights the long fuse, and tosses it behind your opponent.
Running ZLib version: r37 (current)
1 HP costs 0.32μ. ( 273 / 317 )
1 MP costs 8μ. ( 304 / 490 )
Factoring in Scarysauce: (6) damage, retal
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 698.
WHAM: Checking to see if WHAM sould adjust the unknown_ml for Unlikely Survivor.
WHAM: No need to do anything with Unlikely Survivor.
WHAM: Setting up variables via BatBrain
elven hardtack (25.0 @ +229.08099243547832): 30μ * 82.27% = 24.68
elven squeeze (25.0 @ +229.08099243547832): 299μ * 82.27% = 245.99
Notes from the Elfpocalypse, Chapter IV (15.0 @ +229.08099243547832): 100μ * 49.36% = 49.36
Value of stat gain: 286.56μ
elven hardtack (25.0 @ +229.08099243547832): 30μ * 82.27% = 24.68
elven squeeze (25.0 @ +229.08099243547832): 299μ * 82.27% = 245.99
Notes from the Elfpocalypse, Chapter IV (15.0 @ +229.08099243547832): 100μ * 49.36% = 49.36
Value of stat gain: 286.56μ
ATT: 125 (55% × 3.3, death in 151)
DEF: 134 (57.3% × 45.39, win in 4)
HP: 105, Value: 606.59 μ
Parsed round number: 1
Building options...
Options built! (151 actions)
WHAM: We currently think that the round number is: 1 and that the turn number is 698.
WHAM: Current MP = 304 out of 490.
WHAM: You have no profitable MP restoratives.
WHAM: Current HP = 273 out of 317.
WHAM: You have no profitable HP restoratives.
WHAM: You are fighting a Unlikely Survivor. Mafia considers that this monster has an attack of 125 or 125 when given a monster name.
WHAM: Mafia further considers that this monster has a defense value of 134 or 134 when given a monster name.
WHAM: Mafia further further considers that this monster has a HP value of 100 or 100 when given a monster name.
WHAM: Your current ML-adjustment is: 0.
WHAM: Monster HP is 105.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: Running SmartStasis
Profit per round: ActionProfitDamageOtherbase; Green Pixie (0μ)0μ8.06 (0 μ/dmg)
Building custom actions...
Custom actions built! (0 actions)
Stasis action chosen: use 5561 (round 1, profit: 14.08)
Attack action chosen: skill 7116 (round 1, profit: 228.8)
This monster is not your huckleberry.
Stasis loop complete.
WHAM: SmartStasis complete.
WHAM: Running SmartStasis took 0.39 seconds.
WHAM: We currently think that the round number is: 1 and that the turn number is 698.
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 698.
WHAM: Attack option chosen: skill 7116 (round 1, profit: 228.8)
WHAM: No profitable stun option
Queued: skill 7116
Building options...
Options built! (150 actions)
WHAM: Attack option chosen: skill 7116 (round 2, profit: 225.28)
Queued: skill 7116
Building options...
Options built! (150 actions)
Parsed round number: 1
Building options...
Options built! (151 actions)
WHAM: Evaluating the attack but not performing it took 0.79 seconds.
WHAM: We can't Saucesplash.
false, false, false, false, true
WHAM: Enqueueing Feed (macroid skill 7116).
Queued: skill 7116
Building options...
Options built! (150 actions)
WHAM: Successfully enqueued Feed.
WHAM: We can't Saucesplash.
false, false, false, false, true
WHAM: Enqueueing Feed (macroid skill 7116).
Unable to enqueue empty action.
WHAM: Failed to enqueue Feed (entry 2 in the strategy).
WHAM: The following combat strategy was attempted: 
Feed
Feed
Round 1: Random Thief executes a macro!
KoLmafia thinks it is round 2 but KoL thinks it is round 1
WHAM: Failed to enqueue Feed. There's more detailed information in the gCLI.
You're on your own, partner.
 
Last edited:

Catch-22

Active member
I am using the WHAM.ash version posted in #323.

Error when using bag o' tricks:

Error when using feed skill from plastic vampire fangs:

These are related to the single use skills still not quite working. I added both of these skills to dontuse and the script worked for 200 turns without skipping a beat :) including single use items! Hopefully the skill fix will be relatively easy, I might even look at it myself if I have time.
 
I'm still a bit hungover from the conference banquet, and I've only had like 20 minutes to play with it.
It looks like the problem now is, the matcher on line 432 finds "skill " and "use " with trailing spaces.
The big comparison on line 435 looks for them without trailing spaces.

I added a print, when the id was 7116 (feed) and it showed that "chef" had been chosen for that skill.
Interestingly, I also added one for 5560 (blue balls) which showed "chef" had been chosen for that item.
Doesn't seem to fit with catch-22 getting it to work for him.

Changing 435 to:
Code:
if(aid.group(1) != "attack" && contains_text(factors[(aid.group(1) == "use " ? "item" : (aid.group(1) == "skill " ? "skill" : "chef")), (aid.group(1) != "jiggle" ? to_int(aid.group(2)) : to_int(equipped_item($slot[weapon])))].special, "once") && happened(a.id))
and the same change on line 564 and 620, seems like it might work.
I've attached a version but have to run before I can test it properly.
 

Attachments

  • WHAM.ash
    50.7 KB · Views: 26

Winterbay

Active member
Good catch. I've added the trailing spaces to this version. I only wish I had an item like that to test with so I didn't have to get you all to do it for me, would've been much quicker... :)

Edit: It is possible that the reason why items worked is because they were not considered as optimal for more than one use anyway and that made the problem not show up. Possibly :)
 
Last edited:

Catch-22

Active member
I only wish I had an item like that to test with so I didn't have to get you all to do it for me, would've been much quicker... :)

Lord Flameface's cloak also gives you a single use skill, if you had that :)

I'll give the new script a try soonish perhaps.
 

Winterbay

Active member
Lord Flameface's cloak also gives you a single use skill, if you had that :)

I'll give the new script a try soonish perhaps.

Yeah, but then I would need to be out of hardcore (solvable I know) :)
I should be out of my zombie run tomorrow so will be able to test it then (should probably also get the MP somewhat lowish as to avoid other skills).
 

Winterbay

Active member
Ok, I cannot get it to enqueue Swirl Cloak more than once in a battle so unless someone complains about it not working as intended (i.e. multi-enqueueing once-items/skills) in ~9 hours I'll bump the version to 3.4 and upload it to the first post.
 

hollow2201

New member
Rain-doh blue balls, bag o' tricks, feed, and swirl cloak all work for me now.

Thank you for your fast response and especially for making WHAM in the first place.
 

Bazaaretw

Member
I'm just getting this error in kol.

You don't have or can't use skill #7022, macro aborted.

But all Richards help skills are available to use.

Code:
[1769] Exposure Esplanade
Encounter: Fresh-From-The-Refrigerator Del, the Earl of Frostbite
Round 0: Bazaaretw wins initiative!
Updating pluralMonsters.txt from '2011-06-09T02:13:59-05:00' to '2012-01-22T22:44:50-06:00'...
...pluralMonsters.txt updated.
WHAM: Running SmartStasis
WHAM: Starting evaluation and performing of attack
WHAM: Enqueuing a stun to help with the battle
Round 1: Bazaaretw executes a macro!
KoLmafia thinks it is round 2 but KoL thinks it is round 1
WHAM: Starting evaluation and performing of attack
WHAM: Enqueuing a stun to help with the battle
Round 2: Bazaaretw executes a macro!
KoLmafia thinks it is round 3 but KoL thinks it is round 1
WHAM: Starting evaluation and performing of attack
WHAM: Enqueuing a stun to help with the battle
Round 3: Bazaaretw executes a macro!
KoLmafia thinks it is round 4 but KoL thinks it is round 1
WHAM: Starting evaluation and performing of attack
WHAM: Enqueuing a stun to help with the battle
Round 4: Bazaaretw executes a macro!
KoLmafia thinks it is round 5 but KoL thinks it is round 1
WHAM: Starting evaluation and performing of attack
WHAM: Enqueuing a stun to help with the battle
Round 5: Bazaaretw executes a macro!
KoLmafia thinks it is round 6 but KoL thinks it is round 1
WHAM: Starting evaluation and performing of attack
WHAM: Enqueuing a stun to help with the battle
Round 6: Bazaaretw executes a macro!
KoLmafia thinks it is round 7 but KoL thinks it is round 1
 
Last edited:

Winterbay

Active member
I think the problem there is a bug in KoL with macros and the Richard skills which cannot be referenced by number (like all other skills), but needs to be forced to name. Zarqon has refused to add fixes for that in batbrain since it's a KoL bug and without rebuliding the entire enqueue-system in WHAM I can't fix that. My only tips is to add those skills to the dontuse-field.
 

Catch-22

Active member
Just wanted to say thanks to Winterbay et al. for fixing up the single use issues :)

I haven't been on in the past few days, but I'm running 3.4 now and so far it seems to be working pretty well.
 

Catch-22

Active member
Hmm the special_actions() function appears to no longer be working correctly.

Specifically what was happening to me was that quantum nanopolymer spider webs were not being used on the bugbear scientists (after automating all of my turns, I now have 217 in my inventory :().

I also remember having to do the rampaging adding machine manually a few days ago, I believe in the past WHAM has done this for me.

It's also quite possible that none of the Transcendent Olfaction has been done for this run and I hadn't noticed (I automate virtually everything).
 

BladeLight

Member
Hmm the special_actions() function appears to no longer be working correctly.

Specifically what was happening to me was that quantum nanopolymer spider webs were not being used on the bugbear scientists (after automating all of my turns, I now have 217 in my inventory :().

I also remember having to do the rampaging adding machine manually a few days ago, I believe in the past WHAM has done this for me.

It's also quite possible that none of the Transcendent Olfaction has been done for this run and I hadn't noticed (I automate virtually everything).

WHAM just Olfacted a Goth Giant for me about 1 hour ago.
 

Winterbay

Active member
The special section for the RAM has actually never worked since there is no way for a consult script to take over from Mafia's internal handling for that one. It's there in case it starts to work (and because I thought it actually would work when I did it) :)

The olfaction of "normally good things" are done by SS according to the ftf_olfact-setting so is not really up to WHAM at the moment. I had no problem olfacting things last bugbear run I did, but it is very possible that the throwing of webs and similar isn't working since I've been running most of my turns via bumcheekascned which has internal handling for that so...
 

Catch-22

Active member
I had no problem olfacting things last bugbear run I did, but it is very possible that the throwing of webs and similar isn't working since I've been running most of my turns via bumcheekascned which has internal handling for that so...

I'm also running bcasc. I run bcasc with the custom combat script preference enabled, though. I know that definitely the wrong strategy was being used for the bugbears, because I ended up with so many webs. I don't know if it's because of bcasc though.
 
Top