BatBrain -- a central nervous system for consult scripts

You say "It actually parses from the session log, which is where there's a problem." I have to agree - parsing from the session log, rather than using last_monster(), sounds like it would be a problem.

The Encounter line shows actual name from the page - including names of hobos and dread monsters, for example.
The round-by-round actions show the disambiguated names.

I am certain that one of the arguments to a consult script is the disambiguated name.
I believe that is the case for last_monster(), too.

Why go to the session log?
 
So I see post 1567 explains why.

If BatBrain cannot find "Encounter: "+last_monster() in your session log (which happens fairly often due to monsters with varying names, such as hobos), BatBrain will revert to tracking happenings the old way. I'm considering ignoring the monster and simply checking from the most recent Encounter regardless of monster name, but I'm going to try this "safer" version first.
So zarqon already saw that it wouldn't be sufficient, and already had ideas for changing it in the way I was going to suggest.
 
So yeah, it does this:
Code:
   string log = session_logs(1)[0]; // load today's log
   round = last_index_of(log,"Encounter: "+m);
   if (round == -1) {
      vprint("Encounter with \""+m+"\" not found!  Attempting case-insensitive match...","olive",-3);
      round = last_index_of(to_lower_case(log),"encounter: "+to_lower_case(m));
      if (round == -1) return vprint("This encounter cannot be found by name; logging happenings the old way.",-2);
   }
   log = substring(log,round); // shorten to last combat; fight-finished agnostic
Where m is last_monster(), so... yeah. As lost, Veracity, and Zarqon all said, there are times when the session log name doesn't match the monster due to disambiguated names. There are also times when the character name just has an article or something similar.
 
Updated batfactors based on hee^3's spading info on post 1636 with conservative (1.5*) damage for Roar. If there is better info now, we can update it, but now it at least has multiple attack options.
Also added Curse of Indecision as a 3 turn stunner once per combat.
 
Getting an interesting one today while fighting a vegetable gremlin:

Code:
Expression syntax errors for 'modifier_eval()':
Can't understand fweight+3,10)+floor(sqrt(max(fweight-7,0)))
Expected ,, found
Unexpected end of expr
Expected ), found (zlib.ash, line 188)
 
Updated batfactors based on hee^3's spading info on post 1636 with conservative (1.5*) damage for Roar. If there is better info now, we can update it, but now it at least has multiple attack options.
Also added Curse of Indecision as a 3 turn stunner once per combat.
Heads up! I edited those lines significantly. Spell damage percent, spell damage, and elemental bonuses were not being used. Predicted damage seems to line up with actual damage pretty well now, although I kept it conservative, so it's slightly underestimated.

EDIT: Thanks heeheehee for spading that out. So many variables to determine!
 
Last edited:
I could probably get an Ed to have a high enough buffed mys that I can see individual quantizations and decouple the myst scaling from the base variable damage. 10k buffed mys should do the trick, probably.
 
I could probably get an Ed to have a high enough buffed mys that I can see individual quantizations and decouple the myst scaling from the base variable damage. 10k buffed mys should do the trick, probably.
Ooh, that's a cute trick. If you burned off ronin, there would be lots of ways to boast myst.
 
How do you mark that pinch ghost, while physical, still hurts ghosts? I can't see anything obvious for what needs to happen for fist of the mummy to make BatBrain know that it will work just fine against the chalky wraiths.
 
How do you mark that pinch ghost, while physical, still hurts ghosts? I can't see anything obvious for what needs to happen for fist of the mummy to make BatBrain know that it will work just fine against the chalky wraiths.
I'm not sure WHAM knows pinch ghost hurts ghosts. I think it is used because the jar full of wind has value. Personally, I'm not too worried that fist isn't considered to damage ghosts. Ghosts are uncommon and it's just a few more MP to use another spell, but I do feel for someone who isn't far enough up that tree to have the other spells and has to cast fist manually when WHAM wrongly aborts. I'll look into pinch ghost later tonight.
 
Special note re: fist: Fist of the Mummy actually bypasses physical resistance (but not damage mitigation). You can confirm this by using it with a lot of ML running, with no ML running, with negative ML running, and against your winged yeti :P I haven't checked how Pinch Ghost works, but I suspect it'd be something similar.

todo: run a bajillion ML against a banshee librarian, try pinch ghost, check damage.
 
I'll look into pinch ghost later tonight.
Tomorrow? Good weather, good friends and the clickyness of Ed kept me from getting to this. Tomorrow I'm smoking pork butt, so I'll be tied to the house. I really doubt I'll be able to come up with code to make it work right, but I'd like to define clearly how pinch ghost currently works.

BTW, the new formulas have been working really well. The amount of MP it saves me is small (over hard coding storm), but significant, because I'm normally MP starved in Ed even when dying twice to get the most MP out of my bugs.
 
Tomorrow I'm smoking pork butt

Should we ever meet face to face I'm going to ask you to buy me a cup of coffee to replace the one I just spilled because I was laughing so hard. For people of a certain age, barbeque is not the first thing that phrase brings to mind.
 
Should we ever meet face to face I'm going to ask you to buy me a cup of coffee to replace the one I just spilled because I was laughing so hard. For people of a certain age, barbeque is not the first thing that phrase brings to mind.
I can't deny that wasn't intentional. And I've side tracked another thread! Sadly they're renaming pork and beef cuts to make more sense, so stores are starting to label it as shoulder which is where it comes from.

Anyway, back to physical spells and ghosts especially physical spells that override a ghosts physical damage resistance. Not all ghosts (as defined by those you can pinch) resist physical damage. That confused me for a bit. WHAM/BatBrain do not know that Pinch Ghost will do 50 damage against Chalk Wraths. So a method for dealing with this problem does not already exist. The upside is, if someone figures it out, Pinch Ghost will become useful to WHAM for those not under Type69.
 
Some initial spading regarding Roar of the Lion, at 5k myst because I got impatient:

http://pastebin.com/9q2BBJtB

I got a few other values:
Code:
9619, 7596

This suggests damage looks like ceil(rand(1.5,2) * buffedmyst), when combined with my low-level testing.

Unfortunately Storm of the Scarab requires a bit more manual intervention on my behalf, since I'll need to record damage ranges manually (Mafia collapses all damage from a single hit into a single value in the logs). I'll see what I can do about getting that
 
Storm of the Scarabs damage, adjusted for spell damage and the one time I got a crit.

http://pastebin.com/2uH2XN8i

I also gained a mysticality point at the end of the first combat that exceeded 3000 damage :/
This looks tentatively like the total damage scales like rand(0.4-0.6ish*myst) (there's a few data points that suggest the upper bound is slightly higher than 60%), then damage is distributed uniformly at random between the elements (on average, 0.08-0.12 per element as earlier estimated) (based on the variance in each sample).

I'm not sure what's up with the upper bound. There's about a 3.5% chance it's 0.62 or higher.
I have some more data from later, when I stopped paying attention to the individual element damage.

No base damage, as can be verified at low mysticality (i.e. beginning of a run).

Remember that spell damage is applied to each element, so it counts essentially 5-fold on a skill like this.


It looks like any ceiling on spell damage happens at the very end (i.e. after spell% is applied).
 
Batbrain is complaining about the following:

Code:
Encounter with "Cbzzter the Grisly Bear" not found! Attempting case-insensitive match...

It's in monsters.txt as:

Code:
Cbzzter the Grisly Bear

but it displays in the gCLI as:

Code:
C<i>bzzt</i>er the Grisly Bear

and the session log as:

Code:
Encounter: C<i>bzzt</i>er the Grisly Bear

I don't know whether this is a BatBrain issue or a KoLmafia issue. I'm hoping that someone with more knowledge can tell me which it is.

Thank you.
 
Back
Top