BatBrain -- a central nervous system for consult scripts

Revision 19910 adds a couple of features:

to_skill( string name, string type )

Finds a skill with the specified name (fuzzy matching, etc.) of the specified type

SKILL.type

A proxy record field that is the skill type.

Valid types:

"passive"
"summon"
"remedy"
"self-only"
"buff"
"combat"
"song"
"combat/noncombat remedy"
"combat/passive"
"expression"
"walk"

This does not quite obviate the other proxy fields - .passive, .combat, etc. - since some of those include multiple types.

Code:
[color=green]> ash to_skill( "Multi-Bounce", "combat" ).to_string()[/color]

Returned: [7336]Multi-Bounce

[color=green]> ash to_skill( "Multi-Bounce", "combat" ).type[/color]

Returned: combat

[color=green]> ash to_skill( "Multi-Bounce", "passive" ).to_string()[/color]

Returned: [25006]Multi-Bounce

[color=green]> ash to_skill( "Multi-Bounce", "passive" ).type[/color]

Returned: passive

[color=green]> ash to_skill( "Multi-Bounce", "buff" ).to_string()[/color]

Returned: none

[color=green]> ash to_skill( "Multi-Bounce", "buff" ).type[/color]

Returned: unknown
 
Code:
Updating batfactors.txt from '2020-03-26T17:29:41+00:00' to '2020-04-29T08:28:52+00:00'...
...batfactors.txt updated.
Expression syntax errors for 'modifier_eval()':
Can't understand aggregate float [element] (zlib.ash, line 195)
  at eval (zlib.ash:195)
  at to_spread (BatBrain.ash:249)
  at to_spread (BatBrain.ash:256)
  at regular (BatBrain.ash:1122)
  at wrapup (BatBrain.ash:1743)
  at set_monster (BatBrain.ash:2110)
  at act (BatBrain.ash:2162)
  at main (WHAM.ash:1415)
Expression syntax errors for 'modifier_eval()':
Can't understand aggregate float [element] (zlib.ash, line 195)
  at eval (zlib.ash:195)
  at to_spread (BatBrain.ash:249)
  at to_spread (BatBrain.ash:256)
  at regular (BatBrain.ash:1122)
  at wrapup (BatBrain.ash:1743)
  at set_monster (BatBrain.ash:1756)
  at act (BatBrain.ash:2162)
  at main (WHAM.ash:1415)
You're on your own, partner.
Click here to continue in the relay browser.

Code:
> version

KoLmafia v20.3 r20049
 
KoLmafia r20047 has broken BatBrain somehow. Something to do with having a typedef 'spread' and variously defined to_spread() functions. For now, revert to pre-20047 and you can still use BatBrain. I'll look into it as soon as I can.
 
That's fixed it, thank you!

BTW everyone, the latest update let BatBrain know about drippy monsters (though not the Thing in the Basement yet). I haven't tried automating the Drip yet, but BatMan RE now gives me very sensible suggestions when I fight drippy monsters.
 
Need to do something to fix the spookyraven library key bug.

Request 13 of 143 (Manor1: The Haunted Billiards Room) in progress...

[131] The Haunted Billiards Room
Preference lastEncounter changed from Welcome To Our ool Table to pooltergeist
Encounter: pooltergeist
Preference _lastCombatStarted changed from 20200506062532 to 20200506062541
Round 0: Rick Tyger wins initiative!
Round 1: Arfwyd says, "warm it up, Custake," and Custake responds, "I'm about to.'
WHAM: Running SmartStasis
Multiple matches for "Spookyraven library key"; using "[7302]Spookyraven library key". (zlib.ash, line 566) Clarify by using one of:
"[1764]Spookyraven library key"
"[7302]Spookyraven library key"
Multiple matches for "Spookyraven library key"; using "[7302]Spookyraven library key". (zlib.ash, line 566) Clarify by using one of:
"[1764]Spookyraven library key"
"[7302]Spookyraven library key"
Multiple matches for "Spookyraven library key"; using "[7302]Spookyraven library key". (zlib.ash, line 566) Clarify by using one of:
"[1764]Spookyraven library key"
"[7302]Spookyraven library key"
Multiple matches for "Spookyraven library key"; using "[7302]Spookyraven library key". (zlib.ash, line 566) Clarify by using one of:
"[1764]Spookyraven library key"
"[7302]Spookyraven library key"
Multiple matches for "Spookyraven library key"; using "[7302]Spookyraven library key". (zlib.ash, line 566) Clarify by using one of:
"[1764]Spookyraven library key"
"[7302]Spookyraven library key"
Multiple matches for "Spookyraven library key"; using "[7302]Spookyraven library key". (zlib.ash, line 566) Clarify by using one of:
"[1764]Spookyraven library key"
"[7302]Spookyraven library key"
Multiple matches for "Spookyraven library key"; using "[7302]Spookyraven library key". (zlib.ash, line 566) Clarify by using one of:
"[1764]Spookyraven library key"
"[7302]Spookyraven library key"
Multiple matches for "Spookyraven library key"; using "[7302]Spookyraven library key". (zlib.ash, line 566) Clarify by using one of:
"[1764]Spookyraven library key"
"[7302]Spookyraven library key"
Multiple matches for "Spookyraven library key"; using "[7302]Spookyraven library key". (zlib.ash, line 566) Clarify by using one of:
"[1764]Spookyraven library key"
"[7302]Spookyraven library key"
Multiple matches for "Spookyraven library key"; using "[7302]Spookyraven library key". (zlib.ash, line 566) Clarify by using one of:
"[1764]Spookyraven library key"
"[7302]Spookyraven library key"
Multiple matches for "Spookyraven library key"; using "[7302]Spookyraven library key". (zlib.ash, line 566) Clarify by using one of:
"[1764]Spookyraven library key"
"[7302]Spookyraven library key"
Multiple matches for "Spookyraven library key"; using "[7302]Spookyraven library key". (zlib.ash, line 566) Clarify by using one of:
"[1764]Spookyraven library key"
"[7302]Spookyraven library key"
Multiple matches for "Spookyraven library key"; using "[7302]Spookyraven library key". (zlib.ash, line 566) Clarify by using one of:
"[1764]Spookyraven library key"
"[7302]Spookyraven library key"
Multiple matches for "Spookyraven library key"; using "[7302]Spookyraven library key". (zlib.ash, line 566) Clarify by using one of:
"[1764]Spookyraven library key"
"[7302]Spookyraven library key"
Multiple matches for "Spookyraven library key"; using "[7302]Spookyraven library key". (zlib.ash, line 566) Clarify by using one of:
"[1764]Spookyraven library key"
"[7302]Spookyraven library key"
Multiple matches for "Spookyraven library key"; using "[7302]Spookyraven library key". (zlib.ash, line 566) Clarify by using one of:
"[1764]Spookyraven library key"
"[7302]Spookyraven library key"
Multiple matches for "Spookyraven library key"; using "[7302]Spookyraven library key". (zlib.ash, line 566) Clarify by using one of:
"[1764]Spookyraven library key"
"[7302]Spookyraven library key"
Multiple matches for "Spookyraven library key"; using "[7302]Spookyraven library key". (zlib.ash, line 566) Clarify by using one of:
"[1764]Spookyraven library key"
"[7302]Spookyraven library key"
Multiple matches for "Spookyraven library key"; using "[7302]Spookyraven library key". (zlib.ash, line 566) Clarify by using one of:
"[1764]Spookyraven library key"
"[7302]Spookyraven library key"
Multiple matches for "Spookyraven library key"; using "[7302]Spookyraven library key". (zlib.ash, line 566) Clarify by using one of:
"[1764]Spookyraven library key"
"[7302]Spookyraven library key"
Multiple matches for "Spookyraven library key"; using "[7302]Spookyraven library key". (zlib.ash, line 566) Clarify by using one of:
"[1764]Spookyraven library key"
"[7302]Spookyraven library key"
Multiple matches for "Spookyraven library key"; using "[7302]Spookyraven library key". (zlib.ash, line 566) Clarify by using one of:
"[1764]Spookyraven library key"
"[7302]Spookyraven library key"
Multiple matches for "Spookyraven library key"; using "[7302]Spookyraven library key". (zlib.ash, line 566) Clarify by using one of:
"[1764]Spookyraven library key"
"[7302]Spookyraven library key"
Multiple matches for "Spookyraven library key"; using "[7302]Spookyraven library key". (zlib.ash, line 566) Clarify by using one of:
"[1764]Spookyraven library key"
"[7302]Spookyraven library key"
Multiple matches for "Spookyraven library key"; using "[7302]Spookyraven library key". (zlib.ash, line 566) Clarify by using one of:
"[1764]Spookyraven library key"
"[7302]Spookyraven library key"
Multiple matches for "Spookyraven library key"; using "[7302]Spookyraven library key". (zlib.ash, line 566) Clarify by using one of:
"[1764]Spookyraven library key"
"[7302]Spookyraven library key"
Multiple matches for "Spookyraven library key"; using "[7302]Spookyraven library key". (zlib.ash, line 566) Clarify by using one of:
"[1764]Spookyraven library key"
"[7302]Spookyraven library key"
Multiple matches for "Spookyraven library key"; using "[7302]Spookyraven library key". (zlib.ash, line 566) Clarify by using one of:
"[1764]Spookyraven library key"
"[7302]Spookyraven library key"
Multiple matches for "Spookyraven library key"; using "[7302]Spookyraven library key". (zlib.ash, line 566) Clarify by using one of:
"[1764]Spookyraven library key"
"[7302]Spookyraven library key"
Multiple matches for "Spookyraven library key"; using "[7302]Spookyraven library key". (zlib.ash, line 566) Clarify by using one of:
"[1764]Spookyraven library key"
"[7302]Spookyraven library key"
Round 1: Rick Tyger executes a macro!
Round 1: Rick Tyger tries to steal an item!
You acquire an item: 8-ball
Round 2: Arfwyd barks loudly, runs behind a nearby tree, and returns with some meat.
You gain 8 Meat.
Round 2: Custake squawks briefly as she lays a little nest egg in your Bjorn.
You gain 28 Meat.
WHAM: Starting evaluation and performing of attack
WHAM: We are going to 1-shot with attack with your weapon.
Round 2: Rick Tyger executes a macro!
Round 2: Rick Tyger attacks!
Round 3: pooltergeist takes 259 damage.
Round 3: Arfwyd barks loudly, runs behind a nearby tree, and returns with some meat.
You gain 15 Meat.
Round 3: Custake squawks briefly as she lays a little nest egg in your Bjorn.
You gain 10 Meat.
Round 3: Rick Tyger wins the fight!
After Battle: Arfwyd surveys the scene from atop the throne, and gains 1 Experience.
After Battle: Custake surveys the scene from your back, and gains 1 Experience.
After Battle: Kane doffs its top hat and gives you a little, "Hello my baby, hello my honey," kicking its legs and singing harmony with its second set of jaws.
After Battle: Kane smiles on the inside. Unlike all other life-forms, it's doing it literally, with its second set of jaws. (+3 Stats)
After Battle: You gain 3 Enchantedness
After Battle: You gain 10 Smarm
You acquire an item: Gathered Meat-Clip
Preference _boomBoxFights changed from 10 to -1
Preference _xenomorphCharge changed from 2 to 3
Preference _boomBoxFights changed from -1 to 0
This happens for every fight until you get the key.
 
This monster is stun immune! That information should be added to batfactors.

SimpleSmack.

Reported against The Naughty Sorceress and The Naughty Sorceress(2).

Tangentially, does SimpleSmack know how to defeat the Shadow?
 
Reported against The Naughty Sorceress and The Naughty Sorceress(2).

Looks like her stun immunity is contingent on whether or not you smashed the mirror on the way up. How would we check for that? I guess we could parse session logs. Can anyone think of a more direct way?

I don't believe SimpleSmack has special handling for the Shadow. It does know which actions will hurt the Shadow, so adding support is possible. I usually manually fight it with a scented massage oil from my first semirare window, so I haven't thought to dig into this.
 
I don't believe SimpleSmack has special handling for the Shadow. It does know which actions will hurt the Shadow, so adding support is possible. I usually manually fight it with a scented massage oil from my first semirare window, so I haven't thought to dig into this.

I tend to take the choice that makes things easier provide I don't leave the tower and then I don't leave.

What drove me from WHAM to SimpleSmack was the insistence on using red buttons and the beehive under circumstances when such use generated an invalid macro. My only solution was to blacklist the items. However blacklisting the beehive makes tower automation not trivial. My solution is just to do the tower manually and, as such, I can easily do the Shadow. Eventually I can just make some special cases in my ccs but...
 
Minor issue: when handling the different behaviour of Entangling Noodles for pastamancers and non-pastamancers, BatBrain currently removes the mutex.

Code:
        case 3004: if (my_class() == $class[pastamancer]) {   // entangling noodles
              if (my_thrall() == $thrall[spice ghost] && modifier_eval("P") == 10.0) fields.special = "stun 4, once";
              if (m == $monster[Spaghetti Demon]) fields.special = list_remove(fields.special,"once"); break;
           } else fields.special = "stun, att -9, def -9";
           break;

needs to be

Code:
        case 3004: if (my_class() == $class[pastamancer]) {   // entangling noodles
              if (my_thrall() == $thrall[spice ghost] && modifier_eval("P") == 10.0) fields.special = "stun 4, once";
              if (m == $monster[Spaghetti Demon]) fields.special = list_remove(fields.special,"once"); break;
           } else fields.special = "stun, att -9, def -9, mutex noodle, once";
           break;

Also I noticed that all the vampyre cloak skills and Silent Knife need to be "once" in batfactors
 
Last edited:
Batbrain and/or Smart Stasis are using duskwalker syringes when I adventure in the Oil Peak even if the quest is complete. Would you entertain a feature request to not use syringes if the quest isn't active?
 
@Magus: There isn't any custom handling for syringes, so evidently BatBrain considers exchanging a syringe (100 meat) for a bubblin' crude (120 meat) to be profitable in your situation. Should crude be devalued?

@gausie: Your fix will be in the next update. The batfactors stuff you could add yourself, or I'll get to it sometime this week.
 
@Magus: There isn't any custom handling for syringes, so evidently BatBrain considers exchanging a syringe (100 meat) for a bubblin' crude (120 meat) to be profitable in your situation. Should crude be devalued?

Not really. I just noticed that syringes were being used when I didn't need oil.
 
And r139 brings us better Drippy support, items correctly flagged as "once", new skills added, and an undiminished noodle mutex (live in concert!).
 
Thanks z!

More musings from my growing combat script:

I would love to know in batfactors whether an "endscombat" does so by using an adventure or is free.
It would be great to know, again through batfactors, which skills require an item to be equipped or a familiar to be used so i could prepare before the fight
 
restless ghosts have 75% elemental resistance when you are doing a hard mode telegram. I added

Code:
    if ( m == $monster[restless ghost] && get_property( "lttQuestDifficulty" ).to_int() > 2 )
    {
        mdata.res = "3.75 cold,hot,sleaze,stench,spooky".to_spread();
    }

to my combat script, although note that I did 3.75 because my resistance was being divided by 5 and I couldn't be bothered to work out why!
 
That should already be accounted for? The batfactors entry for restless ghost is:

Code:
monster	1906	restless ghost	1.0|3.75*max(0,lttdifficulty-1.0) prismatic	0

Is that not working correctly? If the difficulty is 2 that should result in 75% elemental resistance.

And if you didn't know why it was divided by 5, it sounds like you could benefit from typing "ashwiki batfactors" in your CLI!
 
Back
Top