BatBrain -- a central nervous system for consult scripts

Theraze

Active member
And there's a ton of other changes for that whole class and its skills. Including a new 'gallons of fury' stat which mafia will eventually want to track... but it affects all sorts of other skills, which will make SC tracking very weird for a while.
 

Sputnik1

Member
Tongue of the Otter was replaced with Blubber Up in the revamp. Just replace the two instances of Otter with Blubber Up and it works.
 
Last edited:

Theraze

Active member
Uh, no. Blubber Up is +5 moxie. Tongue of the Otter is removing beaten up. You can do so, but you WILL end up with the script giving you bad advice if you now have blubber up. Especially if you don't also have Tongue of the Walrus to actually get rid of beaten up for you.
 

zarqon

Well-known member
I've been sick, just crawled to the computer to try to avoid wasting my third consecutive day's worth of turns.

Sure enough, there were a huge pile of KoL changes that broke all my scripts again.

Fixed the validation error and added a speed improvement I'd put in before I got sick, but haven't looked into anything else yet. There will need to be some skills added to batfactors eventually as well, which we'll probably want a "fury" fvar for.
 

Fluxxdog

Active member
Don't quite know how to make the changes to have it work properly, so hopefully someone can make the adjustments.

HOA citation pad can only be used once per combat, yet BatMan_RE keep popping it up to be used multiple times. It behaves similarly to the Great Wolf's lice and Mayor Ghosts's scissors.

On a side note: It suggest for stasis the Rain-doh indigo cup, but it keeps trying to use it multiple times in a row when it can only be used once in combat.
 

Sputnik1

Member
Uh, no. Blubber Up is +5 moxie. Tongue of the Otter is removing beaten up. You can do so, but you WILL end up with the script giving you bad advice if you now have blubber up. Especially if you don't also have Tongue of the Walrus to actually get rid of beaten up for you.

Sorry Theraze, that was my bad. I just looked up Tongue on the wiki and it said "This skill was replaced by Blubber Up with the Seal Clubber skill revamp on September 27, 2013." so I just assumed that it was similar without actually looking at the skill details.
 

Winterbay

Active member
I've been working on getting procedurally generating skeleton handling into WHAM and while I have a work-around for many of the things it woudl be a lot better if it was handled by BatBrain.
My current function looks like this:
Code:
//Set information for the procedurally generated skeletons
void set_skeleton_info() {
    if(contains_text(to_string(last_monster()), "acurate")) {
        vprint("WHAM: Accurate skeletons don't miss.", "green", 5);
        nomiss = true;
    }
    if(contains_text(to_string(last_monster()), "blazing")) {
        vprint("WHAM: Blazing skeletons deal hot AoE damage.", "green", 5);        
        //Blazing ones deal Hot Damage every round by area effect.
        //The heat coming off of this thing is nearly unbearable. You should probably get out of its kitchen. Or, y'know, kill it. (hot damage) 
    }
    if(contains_text(to_string(last_monster()), "charred")) {
        vprint("WHAM: Charred skeletons are resistant to hot damage.", "green", 5);
        mres = get_resistance($element[hot]);
    }
    if(contains_text(to_string(last_monster()), "dancing")) {
        vprint("WHAM: Dancing skeletons are ignores items.", "green", 5);
        noitems = 100;
    }
    if(contains_text(to_string(last_monster()), "deadly")) {
        vprint("WHAM: Deadly skeletons have higher attack than normal (handled by Manuel if you have one).", "green", 5);
        //Handled by Manuel, impossible to do atm in any other way
    }
    if(contains_text(to_string(last_monster()), "disorienting")) {
        vprint("WHAM: Disorienting skeletons blocks skills some times (assuming 50%).", "green", 5);
        noskills = 50;
    }
    if(contains_text(to_string(last_monster()), "foul-smelling")) {
        vprint("WHAM: Foul-smelling skeletons are resistant to stench damage.", "green", 5);
        mres = get_resistance($element[stench]);
    }
    if(contains_text(to_string(last_monster()), "frigid")) {
        vprint("WHAM: Frigid skeletons deal cold AoE damage.", "green", 5);    
        //Blazing ones deal Cold Damage every round by area effect.
        //Just being near this thing chills you to the bone. In the cold way, not the scary way. (cold damage) 
    }
    if(contains_text(to_string(last_monster()), "frozen")) {
        vprint("WHAM: Frozen skeletons are resistant to cold damage.", "green", 5);
        mres = get_resistance($element[cold]);
    }
    if(contains_text(to_string(last_monster()), "ghostly")) {
        vprint("WHAM: Ghostly skeletons are resistant to physical damage.", "green", 5);
        mres[$element[none]] = 1;
    }
    if(contains_text(to_string(last_monster()), "giant")) {
        vprint("WHAM: Giant skeletons have higher attack and defense (handled by Manuel if you have one).", "green", 5);
        //Handled by Manuel, impossible to do atm in any other way
        //Giant ones have 40% more Monster Attack and Defense.
    }
    if(contains_text(to_string(last_monster()), "greasy")) {
        vprint("WHAM: Greasy skeletons are resistant to sleaze damage.", "green", 5);
        mres = get_resistance($element[sleaze]);
    }
    if(contains_text(to_string(last_monster()), "lascivious")) {
        vprint("WHAM: Lascivious skeletons deal sleaze AoE damage.", "green", 5);    
        //Blazing ones deal Sleaze Damage every round by area effect.
        //You really don't like the way this skeleton is looking at you. (sleaze damage)
    }
    if(contains_text(to_string(last_monster()), "nimble")) {
        vprint("WHAM: Nimble skeletons have higher defense (handled by Manuel if you have one).", "green", 5);
        //Handled by Manuel, impossible to do atm in any other way
        //Giant ones have 40% more Monster Defense.
    }
    if(contains_text(to_string(last_monster()), "scary")) {
        vprint("WHAM: Scary skeletons are resistant to spooky damage.", "green", 5);        
        mres = get_resistance($element[spooky]);
    }
    if(contains_text(to_string(last_monster()), "shifty")) {
        vprint("WHAM: Shifty skeletons sometimes block attacks.", "green", 5);
        //Shifty ones sometimes avoid regular attacks.
        //The skeleton is too shifty, and your attack misses. Dangit! 
        //Can we handle that?
    }
    if(contains_text(to_string(last_monster()), "shimmering")) {
        vprint("WHAM: Shimmering skeletons are resistant to elemental damage.", "green", 5);
        foreach el in $elements[]
            mres[el] = 1;
    }
    if(contains_text(to_string(last_monster()), "shiny")) {
        vprint("WHAM: Shiny skeletons reduce spell damage to 1.", "green", 5);
        //Shiny ones reduce spell damage to 1.
        //Handled in ok()
    }
    if(contains_text(to_string(last_monster()), "terrifying")) {
        vprint("WHAM: Terrifying skeletons deal spooky AoE damage.", "green", 5);    
        //Terrifying ones deal Spooky Damage every round by area effect.
        //The aura of terror surrounding this skeleton is palpable. You'd palp it, but you're too scared. (spooky damage) 
    }
    if(contains_text(to_string(last_monster()), "thick")) {
        vprint("WHAM: Thick skeletons have more HP than normal (handled by Manuel if you have one).", "green", 5);
        //Handled by Manuel, impossible to do atm in any other way
        //Giant ones have 50% more HP.
    }    
    if(contains_text(to_string(last_monster()), "thorny")) {
        vprint("WHAM: Thorny skeletons deal physical damage when hit with a melee attack.", "green", 5);
        //Thorny ones deal physical damage when you hit them with a melee attack.
        //Handled in ok()
    }
    if(contains_text(to_string(last_monster()), "unstoppable")) {
        vprint("WHAM: Unstoppable skeletons cannot be staggered nor stunned.", "green", 5);
        nostun = true; nomultistun = true;
    }        
    if(contains_text(to_string(last_monster()), "unwashed")) {
        vprint("WHAM: Unwashed skeletons deal stench AoE damage.", "green", 5);    
        //Unwashed ones deal Stench Damage every round by area effect.
        //Man. This skeleton hasn't had a bath in centuries! (stench damage) 
    }
    if(contains_text(to_string(last_monster()), "vicious")) {
        vprint("WHAM: Vicious skeletons deal bonus damage. Currently not handled.", "green", 5);
        //Vicious ones deal bonus damage (500 at 1100 monster attack, compared to a deadly doing ~90 damage at 1600 monster attack). 
    }
    build_options();
}

This should probably be handled by setmonster() (since the names vary way too much to work in batfactors)
The stat-increases are already handled if you have Manuel. I don't think the stats are in Mafia yet. Some things I've had to handle in ok() and some things are not handled (mainly due to not being spaded enough).
 

xKiv

Active member
From my_stat:
Code:
      case "Muscle":
      case "Mysticality":
      case "Moxie": return numeric_modifier("_spec","Buffed "+which);

Is this right? I have a heap of dreadsylvanian debuffs, effective buffed stats 2,1,1, but my_stat returns them as -3761, -221, -2136 ... and then calculations after that are wrong.
Not to mention that first run of batman RE showed damages as if I had very *high* buffed stats.
 

Uli

Member
I am copying Rinn's #1428 post from the WHAM thread as the error turns out to be in BatBrain:

WHAM is having trouble when I have a plastic pumpkin bucket equipped. If I modify the line for ppb to replace 'perfect' with an element it works fine. May also be an issue for the moveable feast.

Code:
[18979] The     Haunted Library
Encounter: bookbat
Strategy:     /Users/Rinn/Library/Application Support/KoLmafia/ccs/[COLOR=#2cae33]epicgamer[/COLOR]-farming.ccs     [default]
Round 0: [COLOR=#2cae33]Epicgamer[/COLOR] wins     initiative!
[COLOR=black]Updating batfactors.txt to     '2013-09-20T12:32:37-05:00'...[/COLOR]
[COLOR=black]...batfactors.txt     updated.[/COLOR]
[COLOR=red]Expression syntax errors for     'modifier_eval()':
Expected end, found perfect (zlib.ash, line 176)[/COLOR]
[COLOR=red]You're     on your own, partner.[/COLOR]
[URL="http://kolmafia.us/main.php"]Click     here to continue in the relay browser.[/URL]


[COLOR=olive]>     zlib verbosity = 10[/COLOR]

Previous value of verbosity: 3
Changed     to 10.

[COLOR=olive]> ash run_combat()[/COLOR]

[COLOR=#880000]1     HP costs 0.044μ. ( 891 / 1270 )[/COLOR]
[COLOR=#000088]1 MP     costs 1.653μ. ( 508 / 1829 )[/COLOR]
[COLOR=purple]WHAM: We     currently think that the round number is: 0 and that the turn number is     18978.[/COLOR]
[COLOR=purple]WHAM: Checking to see if WHAM sould     adjust the unknown_ml for bookbat.[/COLOR]
[COLOR=purple]WHAM: No     need to do anything with bookbat.[/COLOR]
[COLOR=purple]WHAM:     Setting up variables via BatBrain[/COLOR]
[COLOR=black]Setting     monster to bookbat...[/COLOR]
[COLOR=black]Loading batfactors...[/COLOR]
[COLOR=black]Evaluating     '0.35*40.0*0.75 perfect'...[/COLOR]
[COLOR=red]Expression syntax     errors for 'modifier_eval()':
Expected end, found perfect (zlib.ash,     line 176)[/COLOR]
[COLOR=red]You're on your own, partner.[/COLOR]
[URL="http://kolmafia.us/main.php"]Click     here to continue in the relay browser.[/URL]


[COLOR=olive]>     zlib verbosity = 3[/COLOR]

Previous value of verbosity: 10
Changed     to 3.

And Winterbay's fix from post #1450 from the WHAM thread:

Yes I know and it's a BatBrain error. If you have the confidence to edit ash-scripts yourself you can open up BatBrain and move the line with "parse_factors()" up until it is above the line with "fxngear()" which seems to solve the issue.



If this could get a permanent fix, that would be awesome, thanks!
 

Theraze

Active member
You're fighting All-Hallow's Steve
HP: 198, Atk: 180, Def: 265, Type: dude
Drops: All-Hallow's Steve's fright wig (100 cond) 180
265
203
448.75μ


CRITICAL NOODLE! You conjure up a mass of sticky noodles to entangle your opponent.
Trofflesby does a pelvic thrust at your opponent. A piece of toast ricochets off his head, momentarily stunning him (and/or driving him insa-a-a-a-ane.)

toast You acquire an item: toast

Unfazed, your opponent attacks you anyway!

He gets really close to your face and screams at you. His breath is almost as bad as that of an actual clown.
Eek! Ugh! Argh! Ouch! Ow! Ooh!

You lose 30 hit points. (stench damage)
Steve is immune to multi-round stuns. :) And apparently single round stuns, since I got both kinds that round and neither one stopped him.

I believe it's also something like a 75% damage resistance to all? Miniborg does 3-4 damage.
 
Last edited:

Winterbay

Active member
You can add that to batfactors yourself :)

Also, he appeared to have a hard damage cap somewhere as well unless I remember incorrectly.
 

heeheehee

Developer
Staff member
I can believe a soft damage cap. Not so sure about a hard damage cap on top of that, but this is nontrivial to test :|

4 saucegeyser casts with over 5000 myst did 660/661/1138/661 damage (presumably 1138 was a crit). With 0 spell damage, 5000 myst should correspond to about 1750 damage.
 

Ioeth

Member
I seem to be having an issue with Olfaction. I'm in a hardcore AT run right now using WHAM, SS, and BatBrain. I just encountered a Blooper with 179 MP, no current On The Trail effect, and BatMan_attract = "Blooper, dairy goat, shaky clown, Goth Giant, Knott Yeti, violent fungus, dirty old lihc, unemployed knob goblin", yet it didn't olfact the blooper for me. Any idea what might be going on here?
 

zarqon

Well-known member
Just spent the evening trying to catch up on some scripting and I have a fruitful pile of updates to bring you today. Huzzah!

r24 Update

Lots of New Skills

Since the last time I worked on BatBrain, there have been a considerable slew of content revisions and additions coming down the pike from KoL. My primary intent with this update was to make BatBrain functional with all this new content, so for starters we have support for most of the new SC, TT, AT, and DB combat skills. Notably missing are Cavalcade of Fury (not enough info to support) and Knife in the Dark (likewise). All of the new combat skills are otherwise included to some degree. Smacks even account for Cold Shoulder and Thirst of the Weasel. Perhaps most impressively, BatBrain knows about all the different accordions for Cadenza.

As I said, the priority here was to make it work. There are a number of enhancements yet to be made: DB dance skills should consider your various passive skills that interact with momentum, because if using that skill will also make you harder to hit and improve your item drop, it could be much more profitable than present calculations indicate. Fury is not considered as having any value, so expending or gaining it has no effect on decisions yet. Though I did remove the two-handed check for SC's auto-hitting with clubs, I feel like there's something I haven't accounted for with that yet. If you're able to help me improve support for any of this new stuff, my gratitude shall flow like rice!

Other Not-small Improvements

  • Support for procedurally-generated skeletons. All keywords other than 'vicious' are fully supported for characters who have Manuel. For characters without, the keywords 'giant', 'deadly', 'nimble', and 'thick' (all of which affect the three basic monster stats) are not supported. For 'thorny', BatBrain assumes you will damage yourself for 50 HP when you hit them. I pulled that number out of thin air, if you have a better number I'd be happy to hear it. Likewise if you know anything about the scaling damage caps or stat-independent hit chance that these guys seem to have at higher levels.
  • More Dreadsylvania support. Account for vampires' bloodsucking ways. Add skills granted by Dread boss rewards. Account for Chilled to the Bone.


Small Improvements

  • Cap my_stat() at 1 on the low end, since your stats can't go lower than 1. Hopefully this will solve xKiv's issue; if not, there's something else afoot.
  • New keyword for monsters in batfactors: "retal". Use this keyword to indicate damage that you take when hitting the monster with a melee attack. The blackberry bush and cactuary have now moved from being hardcoded to being in batfactors. This was also used internally to support the 'thorny' procedural skeleton keyword.
  • Track factoid learning in happenings, just in case that information is helpful.
  • Support for fear/anger/regret/doubt weapon skills. They each cost a pixel power cell.
  • Support for Pantsgiving skills. Support for Dirty Laundry is very rough but at least existent.

Enjoy!
 
Top