BatBrain -- a central nervous system for consult scripts

@Winterbay: That wouldn't work for the currently 67 monsters which have atypical physical/elemental resistance (about 5% of monsters). Better than what we have now, though.

@heeheehee: monsters.txt is probably easier to parse than batfactors.txt, but either of them could give you that information.

@Theraze: The following are undead monsters with 100% physical resistance:

  • ancient ghost => 1.0
  • Ancient Protector Spirit => 1.0
  • Battlie Knight Ghost => 1.0
  • Chalkdust Wraith => 1.0
  • Claybender Sorcerer Ghost => 1.0
  • contemplative ghost => 1.0
  • Dusken Raider Ghost => 1.0
  • Ghost Miner => 1.0
  • Ghost of Fernswarthy's Grandfather => 1.0
  • lovesick ghost => 1.0
  • Protector Spectre => 1.0
  • Sexy Sorority Ghost => 1.0
  • Space Tourist Explorer Ghost => 1.0
  • Whatsian Commando Ghost => 1.0
  • sleaze ghost => 1.0
  • spooky ghost => 1.0
  • stench ghost => 1.0
  • cold ghost => 1.0
  • hot ghost => 1.0

It looks like they are all monsters which qualify as ghosts. Can everything in this list be Pinched? Conversely, are there any ghosts which do not have 100% physical resistance?
 
Conversely, are there any ghosts which do not have 100% physical resistance?
Yes. the Ghost. I know, I laughed at that too.
Also, the Bugaboo seems to be a ghost with DR. Spading needed.
Ghost of Phil Bunion has physical reduction.
Ghostly pickle factory worker has no reduction listed. It may be rare, buit people will lynch the place, so I'm confident someone would have found it by now.
Groast is a portmanteau of ghost and roast.
Hustled spectre. Natch.
Creatures from The Maelstrom of Lovers.
Mer-kin specter appears as a ghost but pinching doesn't work (bug report submitted by)
Spirit of New Wave
Vengeful turtle spectre

And, of course, MAYOR GHOST! ^^

Edit: Sorry, I had to research this one out. THere's a lot of spading before anything can really be determined. Pinch status currently unknown.
 
Last edited:
Haha, that's awesome. So this makes our Pinchable test become:

PHP:
if (m.phylum == $phylum[undead] && (mres[$element[none]] == 1 || contains_text(to_lower_case(m),"ghost")))

This adds to the list a few more monsters not in the list above: Ghost, Ghostly Pickle Factory Worker, Mayor Ghost, and the ghost of Phil Bunion. Are all of those pinchable? I'm suspecting maybe not on the factory worker.
 
r20 Update

Beginning to add a little support for Dreadsylvania. Added most of the relevant bosses to batfactors today, as well as some special handling to BatBrain:

Unkillable Skeleton (Hard Mode): custom damage formula.
Great Wolf of the Air (Hard Mode): crazy huge attack every other round.
Mayor Ghost (Hard Mode): Disallow healing actions from being added to opts.
Zombie Homeowners' Association: Disallow non-AoE items/skills.
Falls-From-Sky: Autoresponses for his special moves. I was unclear as to whether they also apply to hard mode.

BatBrain now also creates fvars named "woodskisses", "villagekisses", and "castlekisses", respectively, when adventuring in Dreadsylvania. This is presently only used for Drunkula's damage cap, but will almost certainly be useful for the regular monsters as well.
 
Falls-From-Sky: Autoresponses for his special moves. I was unclear as to whether they also apply to hard mode.

They do, but only if you can see his special moves, which basically requires drinking a white lightning for blindness and using a Mini-Adventurer set as a Seal Clubber to remove it mid-fight.
 
Mayor Ghost totally has 100% physical resist, and I believe the banshee librarian counts as a ghost. Also, vengeful turtle spectre does not have "ghost" in its name or any physical resist.

lost: the other popular options for FFS hard-mode are Bandersnatch + lasagna bandages and Pastamancer + vermincelli.
 
I tried to use zlib, batbrain, and wham this morning, for the first time in almost a week, and received the error mentioned in the zlib thread. All scripts are up to date from SVN but the error still occurred. I then used svn delete on zlib and batbrain, then reinstalled. Same error.

Code:
> svn checkout https://svn.code.sf.net/p/batbrain/code

Starting Checkout...
Validating repo...
Repo validated.
G:\software\Kol\svn\batbrain
A https://svn.code.sf.net/p/batbrain/code/dependencies.txt
A https://svn.code.sf.net/p/batbrain/code/scripts
A https://svn.code.sf.net/p/batbrain/code/scripts/BatBrain.ash
https://svn.code.sf.net/p/batbrain/code
At revision 20

Successfully checked out working copy.
Pushing local updates...
BatBrain.ash => G:\software\Kol\scripts\BatBrain.ash
Done.
Requests complete.

Expression syntax errors for 'modifier_eval()':
Expected end, found prismatic (zlib.ash, line 176)
You're on your own, partner.

I've made no modifications to any of the scripts in question and the versions of the scripts are the latest from SVN:

batbrain r20
zlib r13
wham r26
wham beta r21

Any thoughts?
 
Last edited:
@Magus: As of BatBrain r19, the "prismatic" shorthand is no longer permitted in batfactors. I also uploaded a "prismatic"-less batfactors slightly before that, so I suspect if you delete all instances of batfactors.txt from your KoLmafia directory, normal operations shall resume uninterrupted. Also, I may not have confirmed this earlier, but yes, the divine and arcane spells at the same time remark was a D&D (Pathfinder) reference, but an erroneous one. I'd confused Magus (melee spellcaster) with Mystic Theurge (both divine and arcane spells). Silly me!

@Fluxx: Are you saying all of the additional monsters you listed are pinchable ghosts (aside from the Mer-kin specter which is evidently not pinchable)? Or are you listing possible ghosts to be spaded? I don't have any characters with Pinch Ghost permed, so unable to test at the moment. Also, Mayor Ghost's resistance got added in the last update. Will add the ghost of Phil right now!
 
Batfactors hadn't been updated since August 9th. That makes sense as I've been spending time in Dreadsylvania. I wonder why it didn't auto-update this morning when BatBrain ran? Deleting the old version fixed the problem. Thank you both.
 
These are the current differences between mafia's knowledge and batfactors regarding physical resistance:

  • ancient ghost - mafia:0; batfactors:100
  • Bee Thoven - mafia:0; batfactors:50
  • BRICKO Cathedral - mafia:50; batfactors:0
  • Clancy - mafia:0; batfactors:25
  • Claybender Sorcerer Ghost - mafia:0; batfactors:100
  • contemplative ghost - mafia:0; batfactors:100
  • Frosty - mafia:0; batfactors:100
  • Gorgolok, the Infernal Seal (Volcanic Cave) - mafia:0; batfactors:25
  • Hodgman, The Hoboverlord - mafia:0; batfactors:25
  • Hulking Construct - mafia:0; batfactors:100
  • lovesick ghost - mafia:0; batfactors:100
  • Mayor Ghost - mafia:0; batfactors:100
  • Mayor Ghost (Hard Mode) - mafia:0; batfactors:100
  • moister oyster - mafia:0; batfactors:25
  • Queen Bee - mafia:0; batfactors:50
  • reanimated baboon skeleton - mafia:100; batfactors:0
  • reanimated bat skeleton - mafia:100; batfactors:0
  • reanimated demon skeleton - mafia:100; batfactors:0
  • reanimated giant spider skeleton - mafia:100; batfactors:0
  • reanimated serpent skeleton - mafia:100; batfactors:0
  • reanimated wyrm skeleton - mafia:100; batfactors:0
  • Servant of Lord Flameface - mafia:0; batfactors:100
  • Sexy Sorority Ghost - mafia:0; batfactors:100
  • Sexy Sorority Werewolf - mafia:0; batfactors:50
  • Somerset Lopez, Demon Mariachi - mafia:0; batfactors:40
  • Somerset Lopez, Dread Mariachi (Volcanic Cave) - mafia:0; batfactors:25
  • Spaghetti Demon - mafia:0; batfactors:40
  • Spirit of New Wave (Volcanic Cave) - mafia:0; batfactors:25
  • Stella, the Demonic Turtle Poacher - mafia:0; batfactors:40
  • Stella, the Turtle Poacher (Volcanic Cave) - mafia:0; batfactors:25
  • Swarm of Knob Lice - mafia:50; batfactors:0
  • War Frat Mobile Grill Unit - mafia:0; batfactors:25
  • X-dimensional Horror - mafia:90; batfactors:0
  • Yog-Urt, Elder Goddess of Hatred - mafia:0; batfactors:100
  • the ghost of Phil Bunion - mafia:0; batfactors:100

Where either one has a value and the other doesn't, I'm inclined to believe the one with a value. However, since the framework is already in place for batfactors to simply override the default knowledge on an element-by-element basis, BatBrain can simply add mafia's physical resistance knowledge to its default info. This means that several monsters at least can be removed from batfactors, without us losing any information.
 
These are the current differences between mafia's knowledge and batfactors regarding physical resistance:
Just for giggles, here's what the wiki lists in the data section for these monsters.

ancient ghost Physical resistance - 100%
Bee Thoven Physical resistance -*?
BRICKO Cathedral not listed
Clancy not listed
Claybender Sorcerer Ghost not listed
contemplative ghost Physical resistance - 100%
Frosty Physical resistance - 100%
Gorgolok, the Infernal Seal (Volcanic Cave) not listed
Hodgman, The Hoboverlord not listed
Hulking Construct Physical resistance - 100%
lovesick ghost Physical resistance - 100%
Mayor Ghost not listed
Mayor Ghost (Hard Mode) not listed
moister oyster Physical, 25% Elemental
Queen Bee not listed
reanimated baboon skeleton Physical resistance - 100%
reanimated bat skeleton Physical resistance - 100%
reanimated demon skeleton Physical resistance - 100%
reanimated giant spider skeleton Physical resistance - 100%
reanimated serpent skeleton Physical resistance - 100%
reanimated wyrm skeleton Physical resistance - 100%
Servant of Lord Flameface not listed
Sexy Sorority Ghost Physical resistance - 100% physical
Sexy Sorority Werewolf Physical resistance - 50% physical, 50% elemental
Somerset Lopez, Demon Mariachi not listed
Somerset Lopez, Dread Mariachi (Volcanic Cave) not listed
Spaghetti Demon not listed
Spirit of New Wave (Volcanic Cave) not listed
Stella, the Demonic Turtle Poacher not listed
Stella, the Turtle Poacher (Volcanic Cave) not listed
Swarm of Knob Lice not listed
War Frat Mobile Grill Unit not listed
X-dimensional Horror Physical resistance - none
Yog-Urt, Elder Goddess of Hatred not listed
the ghost of Phil Bunion not listed
 
For many of the monsters you show the Wiki as having "not listed", physical resistance is mentioned in the Notes. Most of the data in batfactors was scraped by yours truly directly from the Wiki, after all, so there should be very few discrepancies there.

EDIT: There were only three monsters where mafia had physical resistance information and batfactors didn't: BRICKO Cathedral, Swarm of Knob Lice, and X-dimensional Horror. For now, I have added the resistance for the first two to batfactors for consistency's sake. I'm not sure where mafia got its 90% resistance figure from for the Horror -- the Wiki simply mentions "physical attacks" (by which it seems to mean melee attacks) failing against it.
 
Last edited:
I was trying to add the KOHLS-combat items to the temp_blacklist but I'm not sure I did it correct.
Code:
    if(my_path() == "KOLHS")
        foreach i in $ints[6653,6656,6370,6374,6379,6382,6384,6385,6387]
            temp_blacklist_inc("use " + i, 0);

Can you, with the temp_blacklist()-function, blacklist all of an item? If so, what would the code look like?
 
The blacklist increment function is for raising the amount blacklisted -- but only if it's not already totally blacklisted (value of 0). So change your last line to

blacklist["use "+i] = 0;

and that ought to work as you intended.
 
As reported in the WHAM-thread there is a slight problem with the order of operations in bratbrain when it comes to gear (and possibly effects) which do perfect damage:

BatBrain starts by calling set_monster() which in turn calls a lot of functions. First load_factors(), nothing problematic there. The it calls fxngear() which tries to print how much damage your equipment and effects do. Only it can't do that for the "perfect" stuff since that doesn't get interpreted for another 31 lines in parse_factors().
I'm not sure if the correct solution is to move parse_factors() up or fxngear() down but one of them is needed.
 
Back
Top