BatBrain -- a central nervous system for consult scripts

I seem to recall that using a double-ice shard against him failed to have the desired effect as well, but that was some time ago and my memory isn't really the best...
 
@Winterbay: I took a look at that as well. The most likely reason is that KoL uses "chefstaff" rather than "jiggle" on the page showing the results of the jiggle. Can you look at the HTML after submitting a jiggle macro and tell me what the HTML comment says? It'll say something like "<!-- macroaction: chefstaff/jiggle -->". How are you jiggling the staff? From a relay script, or from WHAM? The word "chefstaff" doesn't appear in BatBrain other than as an item_type() check, so it either comes from KoL itself or another source, such as a non-BatBrain-generated macro being submitted prior to BatBrain parsing the page. It sounds like the former, but the latter is a possibility.

It was from a macro generated by WHAM (which took care of the entire fight) where it tried to do "jiggle, jiggle, jiggle, attack" or something (I can look it up in my session logs later).

That said: Why do you replace the .special field for the skills that zombify completely? This means that any other information in there gets overwritten, such as in "bear" and "once" which WHAM uses to correctly handle those skills. Wouldn't a += ", !! zombify" work better to keep the other information in there? (or for that matter add "!! zombify" to batfactors for those two skills and skip the addition of it in the script?
 
Edit: Wehh? Downloaded a newer daily build. Errors resolved....but are now occurring in smartStasis. Batbrain seems all good for nows~~ ...now if only SS was updated :(

OP for posterity:
Recently downloaded the newest version, getting some odd little errors here:
Bad monster value: "x-dimensional horror" (BatBrain.ash, line 817)

When I edit the script at that line to be n-dimensional horror, the error goes away...but then I get:
Bad monster value: "naughty sorceress" (BatBrain.ash, line 845)

I'm not sure what to re-name this one too, and whether there are any others after that...
 
Last edited:
Recently downloaded the newest version, getting some odd little errors here:
Bad monster value: "x-dimensional horror" (BatBrain.ash, line 817)

When I edit the script at that line to be n-dimensional horror, the error goes away...but then I get:
Bad monster value: "naughty sorceress" (BatBrain.ash, line 845)

I'm not sure what to re-name this one too, and whether there are any others after that...

http://builds.kolmafia.us/ for an updated version of mafia. Though I expect I will release 15.8 later today.
 
Ah, bingo. Heh, you guys beat me to my edit :P
That does seem to have done the trick (latest daily broke my ability to launch relay browser in Firefox, and now SmartStasis appears to be behind on updates, but those are no fault of Batbrain :D)
 
SmartStasis as released doesn't verify? Oops! Will update that now.

@Winterbay: Using a += results in the data source map being appended multiple times. Probably a better way, just need to think of it.
 
I'm pretty sure I also recall when fighting Groar that mafia wasn't aware his defense and/or attack element is cold. Can anyone confirm this?

To confirm this:
Code:
You gingerly pick up the shard of double-ice with tongs and toss it at your opponent.  He freezes in place and takes [COLOR=blue][B]1[/B][/COLOR] damage.

This was the first action in the fight, so he is clearly cold-aligned.

Edit:
Also, there is a bug in regular() which makes Moxious Maneuver less appetizing than it should be. When using MoxMan your Moxie is used to calculate chance to hit as well as damage dealt while a ranged attack only uses moxie to see if you hit or not. Regular does not take this into account unless you make the following change:

Code:
// regular attack (also other attack skills with related damage formulae)
spread regular(int ts) {  // 0) moxman, 1) norm, 2) thrust-smack / axing, 3) lts, 5) bashing slam smash / cleave, -1) Kodiak Moment
   spread res;
   if (ts != 0 && m == $monster[a x-dimensional horror]) return res;
   float ltsadj = (ts == 3) ? 1.25 + 0.05*to_int(my_class() == $class[seal clubber]) : (ts == 5) ? 1.4 : 1.0;
   boolean ranged = (weapon_type(equipped_item($slot[weapon])) == $stat[moxie] && ts > 0);
   float radj = (ranged) ? 0.75 : 1.0;
   if (equipped_item($slot[weapon]) == $item[none]) radj = 0.25 + 0.75*to_int(ts == 0);
   res[$element[none]] = max(0,max(0,floor((ts != 0 ? my_stat("Muscle") : my_stat("Moxie"))*ltsadj*radj) - monster_stat("def")) +
      max(1,numeric_modifier("Weapon Damage") + 0.5) * ((ts == -1 && (have_equipped($item[left bear arm]) && have_equipped($item[right bear arm])) ? 1.0 : critchance()) + 1.0) * max(1.0,ts) +
      to_int(ranged)*numeric_modifier("Ranged Damage")) * (100 + numeric_modifier("Weapon Damage Percent") +
      to_int(ranged)*numeric_modifier("Ranged Damage Percent"))/100;
   if (have_skill($skill[double-fisted]) && to_slot(equipped_item($slot[offhand])) == $slot[weapon])
      res[$element[none]] += 0.15*get_power(equipped_item($slot[offhand])) + 0.5;
   if (unarmed() && have_skill($skill[master of the surprising fist])) res[$element[none]] += 10;
   if (ts != 0) foreach el in $elements[] if (numeric_modifier(el+" Damage") > 0) res[el] = numeric_modifier(el+" Damage");
   if ((ts == -1) && (my_path() == "Zombie Slayer")) { res[$element[stench]]+=res[$element[none]]/2;res[$element[spooky]]+=res[$element[none]]/2;res[$element[none]]=0; }
   return (have_equipped($item[skeletal scabbard]) && item_type(equipped_item($slot[weapon])) == "sword") ? factor(res,2) : res;
}

I.e. change my_stat("muscle") to (ts != 0 ? my_stat("Muscle") : my_stat("Moxie")). This makes my level 56 DB actually use mox man to kill the crimbo monsters (as is obviously the best option for a high level moxie class, or any moxie class really) rather than expensive combat items or 120MP hobopolis skills like before.
 
Last edited:
A lowbie problem caused by monster manuel... and 'accurate' stats:
> monster_defense sleeping knob goblin guard

Returned: 0

> monster_attack sleeping knob goblin guard

Returned: 0
Apparently this guard does actually have stats of 0. That means BatBrain believes him to be unknown, and WHAM aborts because he can't safely be killed.
 
I modified BatBrain a while back to ignore all stat adjustments (including HP variance) if you have actual stats from Manuel. Based on your report, that must not have made it into the release yet. I'll spin a release when I get home today.
 
By that, I mean that the official stats for the sleeping guard is 0/0/1. Which currently matches the BatBrain unknown monster check. I made a FReq to set unknown monster values to -1 instead, so that it's differentiated from actual 0-statted monsters.
 
Perhaps monster_hp( ) == 0? If that is true, either the monster is unknown or the monster is dead so we don't really care if its stats are known.
 
1.29 Update

Happy new year everyone! A couple important fixes today.

  • First, I'm pretty sure I've solved the Salve/Lasagna Bandages issue. When simulating a round, all actions were being merged into a single round event. But even in a single round, actions happen sequentially, not simultaneously. So BatBrain now caps gains to HP/MP from player actions first, before applying the monster action. This will make healing/restoring actions appear much less valuable when you are at or near max. I'm very happy to finally have done with that rather frustrating issue.
  • Second, if Manuel is providing you with stats, BatBrain now uses his supplied stats without making any adjustments for unknown stats or HP variance. This still doesn't completely solve the issue Theraze mentioned for monsters with actual stats of 0, since players without Manuel will still be treating those stats as unknown, but it solves a large number of other issues for players who have Manuel.
  • Third, the fix to Moxious Maneuver that Winterbay posted above.

Enjoy!


Re: unknown stats. In this update, I also changed the bit that checks to see if the stats are 0 to use the raw_<stat> fields of the monster proxy record, which doesn't include ML adjustments, from gear or otherwise. If unknown stats were then changed to be -1, checking (m.raw_attack == -1) could then only mean that the stat is unknown. Presently, for monsters with actual stats of 0, there isn't a good way to differentiate this for players without Manuel.

@Bale: BatBrain is checking each stat separately, because there are some monsters where only one or two of the stats are unknown. Assuming the entire monster is unknown just because the HP is unknown would actually be a step backwards.
 
there are some monsters where only one or two of the stats are unknown.
Which monsters are those? I was under the impression that we've updated all of the monsters with what Manuel tells us. If I'm wrong about that, please identify the ones which still need to be updated.

Thanks.
 
My sentence should have said "there were some monsters", because that was the original reason for checking each one separately, but it seems that nearly all of those cases have been eliminated. A brief test for monsters with at least one zero and at least one nonzero:

Big Creepy Spider att: 1, def: 0, hp: 1
Completely Different Spider att: 1, def: 0, hp: 1
Crate att: 0, def: 0, hp: 1
Drunken Half-Orc Hobo att: 1, def: 0, hp: 1
Fiendish Can of Asparagus att: 2, def: 0, hp: 1
Fluffy Bunny att: 1, def: 0, hp: 1
Hung-over Half-Orc Hobo att: 1, def: 0, hp: 1
Knob Goblin Assistant Chef att: 2, def: 0, hp: 1
Ninja Snowman Assassin att: 150, def: 135, hp: 0
Possessed Can of Tomatoes att: 1, def: 0, hp: 1
Rushing Bum att: 1, def: 0, hp: 1
Sleeping Knob Goblin Guard att: 0, def: 0, hp: 1
The Master of Thieves att: 70, def: 0, hp: 0
The Temporal Bandit att: 0, def: 0, hp: 50

Looks like the Ninja Snowman Assassin and an ultra-rare monster or two may be the only ones left.
 
Last edited:
Actually, only the Ultra-rare monsters lack complete stats. I just checked with Manuel and he insists that the Ninja Snowman Assassin is so fragile that breathing on him will actually kill him if your breath is warm enough to melt a snowflake.
 
1.30 Update

  • Thanks to a recent mafia update, we can now properly differentiate unknown monster stats from both scaling monsters and monsters with actual stats of 0.
  • Properly remove items for Mother Slime and Chester. The previous code for this was being called before we knew which monster we were facing.
  • For some reason, the previous text for excising the skills bit of the page wasn't matching right, despite being copied from the source. I discovered this when haiku katana skills showed up in BatMan RE's Actions Table despite not showing up in KoL's form. Turns out have_skill($skill[summer siesta]) was returning true, despite the katana not being equipped anymore. Now that we're matching the skills form properly, skills not present in KoL's skills form will be correctly disallowed.
  • Ignore mafia's "Found in this fight" message when parsing items. This should eliminate the confusing double items messages reported in the BatMan RE thread.

And some love for Seal Clubbers:

  • Track seal pup wailing in happenings ("sealwail"). The next SS release will then consider seal pups huckleberries until they wail.
  • The Sledgehammer of the Valealylkerlyl seems to count as a 2-handed club for purposes of SC skills hitchance. I changed this accordingly because it always worked.
  • When facing mother hellseals, remove all skills that don't deal weapon damage (and Clobber), and damage-dealing items. BatBrain-powered combat scripts will now avoid actions that would destroy your seal parts.

It seems like the persistent haiku katana skills thing may be a bug, but I need to figure out how to duplicate it -- and its extent. Does it happen for all equipment-granted skills? Does it happen when unequipping these items via CLI, via relay, or via anything? Not enough information yet.

Enjoy!
 
Back
Top