Winterbay's Helpful Automatic Monsterbasher (WHAM)

xKiv

Active member
If you can't use MP outside combat, you'll gain it up to the point where it will be considered

That will take way too long! After the first (few) thousand, having more MP just isn't as important. Usually.
There is some (subjective) value in having stuff now, guaranteed - as opposed to having slightly more stuff later (without knowing when), almost certainly.

On the other hand, are you suggesting that BatBrain should also know everything about possible uses of MP outside combat? Because wow.

Rather, I would suggest that user's don't expect batbrain to know everything, including our current mood, plans for the next 300 turns and future value of yesterday's meat.
If I know that I want to use regenerating MP on combat skills *now*, I use my own macro. It will probably be horribly ineffective compared to best possible, but I am not an oracle for higher either.
 

Crowther

Active member
Just been running into one bug recently where it'll repeatedly kick me to relay for a trivial fight.
If I read the WHAM code correctly, it will only use skills against a Quantum Mechanic that are sure to hit it. If you use attack, there's about a 5% chance you'll fumble. While WHAM checks to see if the Quantum Mechanic can hit you before deciding to stasis or not.
Code:
if (m == $monster[quantum mechanic] && m_hit_chance() > 0.1)
                return page;  // avoid teleportitis
I don't see a similar check for attacking.
Code:
                        case "attack":
                                return ((my_path() != "Avatar of Boris" && no_cunctatitis() && no_teleportitis()) ||
Do you have any skills that are sure to one hit the Quantum Mechanic? Attack isn't a sure thing.
 
If you can't use MP outside combat, you'll gain it up to the point where it will be considered. Which would make combat skills much less costly (and thus more likely to be selected). Which means it considers it as I described.

On the other hand, are you suggesting that BatBrain should also know everything about possible uses of MP outside combat? Because wow.


As an example, say I'm wearing the Clothing of Loathing outfit. I'm at -3 MP per skill and 20-30 MP free and clear per adventure.

WHAM could use candyblast cheaply and get me some junk to sell/use, which is more profit. However, it's using a regular attack (because I'm amazingly buffed up) and I gain 20-30 MP per adventure to use on moods. I end up with 1,000 turns of everything I can cast without much trouble. Around in there mafia doesn't do anything with the MP (because my libram skills are really costly now) and there are times I'm capped on my max MP but WHAM is still using attack, even though mafia isn't extending my buffs.

I don't really need to bank up buffs in aftercore, I just don't want to waste the MP and at that point the librams are too expensive to cast without maximizing for MP.


But, as an end user, I could have had more meat because of candyblast, and still had plenty to run my mood. It may not be a lot, but it does add up.


So, is there something different I should be doing with my mood settings to avoid that? When I'm in a HC ascension, I like banking up some turns of buffs because I may only be running a starfish type familiar for a few adventures. But when I'm in aftercore, if I can keep my mood going easily, why not use the extra into consideration for something potentially profitable, like candyblast?
 

elpasi

New member
If I read the WHAM code correctly, it will only use skills against a Quantum Mechanic that are sure to hit it. If you use attack, there's about a 5% chance you'll fumble. While WHAM checks to see if the Quantum Mechanic can hit you before deciding to stasis or not.
Code:
if (m == $monster[quantum mechanic] && m_hit_chance() > 0.1)
                return page;  // avoid teleportitis
I don't see a similar check for attacking.
Code:
                        case "attack":
                                return ((my_path() != "Avatar of Boris" && no_cunctatitis() && no_teleportitis()) ||
Do you have any skills that are sure to one hit the Quantum Mechanic? Attack isn't a sure thing.

That seems to be exactly what it is. I'm just using a standard weapon and WHAM is being super smart and precautious, and hiding from me just how much it's doing behind the scenes to take care of me. In that case, it's not a bug at all!
 

digitrev

Member
Bug report

I'm a Disco Bandit with Tricky Knifework and Frankly Mr. Shank equipped. I also have outmoxie the enemies by a considerable amount. For some reason, WHAM keeps telling me that the best course of action is to "13-shot with attack with your weapon, attack with your weapon, ...". It seems that WHAM isn't recognizing that Tricky Knifework makes my Knife a moxie based weapon.
 

Crowther

Active member
Bug report

I'm a Disco Bandit with Tricky Knifework and Frankly Mr. Shank equipped. I also have outmoxie the enemies by a considerable amount. For some reason, WHAM keeps telling me that the best course of action is to "13-shot with attack with your weapon, attack with your weapon, ...". It seems that WHAM isn't recognizing that Tricky Knifework makes my Knife a moxie based weapon.
Hit calculations are done in BatBrain.ash. It looks like it just uses current_hit_stat(). So if there's a bug, it's new content for mafia. I'm not in a place to test it, but you can do "ash current_hit_stat()" and see if mafia reports the right stat and write up a proper "new content" request based on that information. So many new skills came out at once, it's not nice to call them bugs.
 

Crowther

Active member
Just checked, and current_hit_stat() returns moxie for that case. It is not a mafia issue.
I think I found where the problem is, in BatBrain.ash
Code:
   float radj = (equipped_item($slot[weapon]) == $item[none]) ? 0.25 : (ranged ? 0.75 : 1.0);
   res[$element[none]] = max(0,max(0,floor((ranged ? my_stat("Moxie") : my_stat("Muscle"))*ltsadj*radj) - monster_stat("def")) +
I haven't the slightest idea how to fix it. I'm also confused, because radj changes if it's a ranged attack, but then the radj value isn't used if it's a ranged attack.
 

xKiv

Active member
I'm also confused, because radj changes if it's a ranged attack, but then the radj value isn't used if it's a ranged attack.

I think that was part of the 'moxie classes don't need moxious maneuver' change, which made it so that ranged based attacks use 100% of moxie instead of 75% muscle when determining damage.
So 'radj' is only ever used for unarmed attacks (which still use 25% muscle for damage calculation).

The problem seems to be specifically this part:
Code:
ranged ? my_stat("Moxie") : my_stat("Muscle")
which should be 'current_hit_stat()' isntead.
 
Last edited:

Crowther

Active member
I believe you are right, but I'm so confused by KoL's rules there's no way I can tell what the code should actually do. Hopefully zarqon can figure it out.
 

Razorsoup

Member
Still getting this in the gCLI:

The string "1004; attack" is not an integer; returning 1004 (WHAM.ash, line 535)
The string "1032; attack" is not an integer; returning 1032 (WHAM.ash, line 535)
The string "1022; attack" is not an integer; returning 1022 (WHAM.ash, line 535)
The string "1003; attack" is not an integer; returning 1003 (WHAM.ash, line 535)
The string "1033; attack" is not an integer; returning 1033 (WHAM.ash, line 535)
The string "15; attack" is not an integer; returning 15 (WHAM.ash, line 535)

Is this a WHAM issue, BatBrain or something else?
 

Razorsoup

Member
That is an odd error since that means that for some reason the ID-value of your ops-map has been concatenated with "attack". I can't see how that would happen...

It only seems to happen in Bad Moon. I'm getting these messages on two seal clubber and one accordion thief bad moon character. When not in Bad Moon, everything works as expected. I haven't made any changes to WHAM or the related scripts so I'm not really sure what's going on.
 

zarqon

Well-known member
Is this a WHAM issue, BatBrain or something else?

That's a BatBrain bug -- you're evidently using a Black Cat familiar, which has a chance of converting skill use into regular attacks. BatBrain handles this on line 1207 by factoring each skill by 70% and merging it with 30% of your attack action. This results in compound ID's for all your skills -- i.e. "skill 1004; attack" -- which is erroneous, since if you were to attempt to perform skill 1004, it would instead perform that skill and then attack!

I've just fixed that bug, so update BatBrain and you should be set.
 

Razorsoup

Member
That's a BatBrain bug -- you're evidently using a Black Cat familiar, which has a chance of converting skill use into regular attacks. BatBrain handles this on line 1207 by factoring each skill by 70% and merging it with 30% of your attack action. This results in compound ID's for all your skills -- i.e. "skill 1004; attack" -- which is erroneous, since if you were to attempt to perform skill 1004, it would instead perform that skill and then attack!

I've just fixed that bug, so update BatBrain and you should be set.

I am indeed using a Black Cat. Decided to make my first Bad Moon run as painful as possible to try and permanently unlock it. I probably should have mentioned the black cat but didn't realize that would be relevant information. Thank you for the update. I'll update everything tonight after rollover and give it a try. I'll let you know if something else goes wonky.
 
Maybe some values need to be updated so WHAM can figure this out on it's own?

Snap fingers and pop wheelie won me the fight, and I had plenty of MP for them. Sure, I was at +60ML at the time... ;)


Code:
[519] The Haunted Wine Cellar (Southwest)
Encounter: skeletal sommelier
Round 0: chef_rannos wins initiative!
Round 1: chef_rannos casts MUG FOR THE AUDIENCE!
You gain 2 Chutzpah
You lose 46 hit points
ATT: 226 (94% × 50.99, death in 1)
DEF: 199 (8.59% × 23.9, win in 108)
HP: 221, Value: 1,605.36 μ, RES: 0 (-1) (1) (-1)
WHAM: Monster HP is 221.0.
WHAM: Running SmartStasis
Profit per round: ActionProfitDamageOtherbase (0μ)0μ--
WHAM: Starting evaluation and performing of attack
WHAM: Unable to delevel until you can kill the monster without it killing you. Try it yourself.
WHAM: Unable to determine a valid combat strategy. For your benefit here are the numbers for your combat options.
WHAM: Pop Wheelie: 57.00 potential damage (raw damage: 57.00) and a hitchance of 100.00%.
WHAM: photoprotoneutron torpedo: 40.00 potential damage (raw damage: 40.00) and a hitchance of 100.00%.
WHAM: flaregun: 26.40 potential damage (raw damage: 19.80) and a hitchance of 100.00%.
WHAM: plot hole: 22.50 potential damage (raw damage: 22.50) and a hitchance of 100.00%.
WHAM: Attack with your weapon: 13.75 potential damage (raw damage: 13.75) and a hitchance of 8.59%.
WHAM: Smoke Break: 10.00 potential damage (raw damage: 10.00) and a hitchance of 100.00%.
WHAM: Insult: 5.00 potential damage (raw damage: 5.00) and a hitchance of 100.00%.
WHAM: Knob Goblin firecracker: 3.00 potential damage (raw damage: 3.00) and a hitchance of 100.00%.
WHAM: razor-sharp can lid: 2.50 potential damage (raw damage: 2.50) and a hitchance of 100.00%.
WHAM: possessed tomato: 1.00 potential damage (raw damage: 7.00) and a hitchance of 100.00%.
WHAM: Ye Olde Medieval Insult: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: Snap Fingers: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: gob of wet hair: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: wussiness potion: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: inkwell: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: tropical orchid: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: procrastination potion: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: The Big Book of Pirate Insults: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: anti-anti-antidote: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: handful of sawdust: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: T.U.R.D.S. Key: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: Catchphrase: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: chaos butterfly: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: CLEESH: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: Peel Out: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: Space Tours Tripple: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: bottle of Monsieur Bubble: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: fancy bath salts: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: tangle of rat tails: 0.00 potential damage (raw damage: 0.00) and a hitchance of 100.00%.
WHAM: You now have the knowledge needed to go forward and be victorious
Round 2: chef_rannos executes a macro!
KoLmafia thinks it is round 3 but KoL thinks it is round 2
WHAM: Unable to figure out a combat strategy. Helpful information regarding your skills have been printed to the CLI
You're on your own, partner.
Round 3: chef_rannos casts SNAP FINGERS!
KoLmafia thinks it is round 4 but KoL thinks it is round 3
Round 4: chef_rannos casts POP WHEELIE!
KoLmafia thinks it is round 5 but KoL thinks it is round 4
Round 5: skeletal sommelier takes 62 damage.
Round 5: skeletal sommelier drops 34 attack power.
Round 5: skeletal sommelier drops 29 defense.
Round 5: chef_rannos casts POP WHEELIE!
KoLmafia thinks it is round 6 but KoL thinks it is round 5
Round 6: skeletal sommelier takes 58 damage.
Round 6: skeletal sommelier drops 28 attack power.
Round 6: skeletal sommelier drops 26 defense.
Round 6: chef_rannos attacks!
KoLmafia thinks it is round 7 but KoL thinks it is round 6
Round 7: skeletal sommelier takes 56 damage.
Round 7: chef_rannos attacks!
KoLmafia thinks it is round 8 but KoL thinks it is round 7
Round 8: skeletal sommelier takes 58 damage.
Round 8: chef_rannos wins the fight!
You gain 3 hit points
You gain 4 Mojo Points
You gain 100 Meat
You acquire an item: dusty bottle of glassy Pinot Noir
You acquire an item: dusty bottle of vinegar Zinfandel
You gain 16 Strongness
You gain 16 Enchantedness
You gain 40 Cheek

The very next combat it tried to win and got me beaten up. Maybe the value of snap fingers isn't high enough? 5 MP to avoid using 30 MP to restore a lot of health seems like a big win to me.


Code:
[520] The Haunted Wine Cellar (Southwest)
Encounter: skeletal sommelier
Round 0: chef_rannos wins initiative!
ATT: 232 (94% × 54.67, death in 2)
DEF: 205 (8.59% × 23.9, win in 109)
HP: 222, Value: 1,605.36 μ, RES: 0 (-1) (1) (-1)
WHAM: Monster HP is 222.0.
WHAM: Running SmartStasis
Profit per round: ActionProfitDamageOtherbase (0μ)0μ--
WHAM: Starting evaluation and performing of attack
WHAM: We are going to 6-shot with Pop Wheelie, attack with your weapon, attack with your weapon, attack with your weapon, attack with your weapon and attack with your weapon.
Round 1: chef_rannos executes a macro!
Round 1: chef_rannos casts POP WHEELIE!
Round 2: skeletal sommelier takes 58 damage.
Round 2: skeletal sommelier drops 34 attack power.
Round 2: skeletal sommelier drops 31 defense.
You lose 26 hit points
Round 2: chef_rannos attacks!
Round 3: skeletal sommelier takes 34 damage.
You lose 27 hit points
Round 3: chef_rannos attacks!
Round 4: skeletal sommelier takes 31 damage.
You lose 26 hit points
Round 4: chef_rannos attacks!
Round 5: skeletal sommelier takes 33 damage.
You lose 26 hit points
Round 5: chef_rannos attacks!
Round 6: skeletal sommelier takes 30 damage.
You lose 30 hit points
 
Last edited:

heeheehee

Developer
Staff member
Probably snap fingers needs to use audience love in formula. I'm not sure if the exact formula is known at the moment (although it goes something like 2 + love/6).

Also, Smoke break damage is totally wrong. It's 3 rounds of 20-30 stench/stench/hot damage.
 
Top