BatBrain -- a central nervous system for consult scripts

Getting an odd error message both starting and between each round of manual combat:

Code:
[4] The Boss Bat's Lair
Encounter: beefy bodyguard bat wearing a hockey     mask
Round 0: ililili wins initiative!
Round 1: You lose 142 hit     points
Expression syntax errors for 'modifier_eval()':
Can't     understand maxmp*0.5 (zlib.ash, line 194)
  at eval (zlib.ash:194)
  at     to_event (BatBrain.ash:286)
  at add_skill (BatBrain.ash:1360)
  at     build_skillz (BatBrain.ash:1396)
  at build_options (BatBrain.ash:1435)
  at     act (BatBrain.ash:2131)
  at batman_enhance (BatMan_RE.ash:287)
  at     main (BatMan_RE.ash:499)
Expression syntax     errors for 'modifier_eval()':
Can't understand maxmp*0.5 (zlib.ash,     line 194)
  at eval (zlib.ash:194)
  at to_event     (BatBrain.ash:286)
  at add_skill (BatBrain.ash:1360)
  at     build_skillz (BatBrain.ash:1396)
  at build_options (BatBrain.ash:1435)
  at     act (BatBrain.ash:2131)
  at main (WHAM.ash:1415)
Expression     syntax errors for 'modifier_eval()':
Can't understand maxmp*0.5     (zlib.ash, line 194)
  at eval (zlib.ash:194)
  at     to_event (BatBrain.ash:286)
  at add_skill (BatBrain.ash:1360)
  at     build_skillz (BatBrain.ash:1396)
  at build_options (BatBrain.ash:1435)
  at     act (BatBrain.ash:2131)
  at main (WHAM.ash:1415)
You're     on your own, partner.

I mention it here because BatBrain is mentioned most, and zlib's main post says it's not a zlib issue, but if there's a better place for this, let me know?

EDIT: In the zlib thread I found reference to Batfactors failing in regards to the latte. I tried to make BatBrain update but got:

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

Starting     Checkout...
Validating repo...
Repo validated.
C:\Users\...KolMafia\svn\batbrain
svn: E155032: The pristine text with     checksum '$sha1$d00370963b9a66d1d8ec9f280993521d88a3fb00' not found
SVN     ERROR during checkout operation. Aborting...
Done.
Requests     complete."

EDIT 2:

Manually deleting BatBrain.ash and manually downloading a new copy has it working fine again. I'll leave the post here to help anyone who comes searching with a similar issue.
 
Last edited:
This monster is stun immune! That information should be added to batfactors.

I think this is the right thread for this:

[869] Through the Spacegate
Preference lastEncounter changed from Cool Space Rocks to Murderbot drone
Encounter: Murderbot drone
Preference _lastCombatStarted changed from 20190304083102 to 20190304084604
Round 0: tiaan wins initiative!
Round 1: tiaan executes a macro!
KoLmafia thinks it is round 2 but KoL thinks it is round 1
WHAM: Running SmartStasis
WHAM: Starting evaluation and performing of attack
WHAM: We are going to 1-shot with Shattering Punch.
Round 1: tiaan executes a macro!
Round 1: tiaan casts SHATTERING PUNCH!
Round 2: Murderbot drone takes 300 damage.
Round 2: Gunklin viciously wattle-whips your opponent until it looks dizzy and out-of-sorts, doing 123 damage.
Round 2: Murderbot drone takes 123 damage.
Round 2: You lose 369 hit points
Preference _shatteringPunchUsed changed from 0 to 1
This monster is stun immune! That information should be added to batfactors.
 
I think this is the right thread for this

Yes indeed! Have just added that info to batfactors (which I can do even when Sourceforge is down BWAHAHA), thanks.

@Magus: Sorry for not responding earlier. I also wish I knew what caused that error, since I come across it nearly every time I'm in aftercore. I've tried to hunt down the bug more than once in the past, since it halts automation for seemingly no reason (since you've already won the fight). I came to the confusing conclusion that by the time that error happens the script is actually done, so I don't know what I could possibly do to fix it. However, the error only happens when the script wins during the stasis loop, so it does seem to be caused somehow by the script, despite the script successfully exiting the loop and running to completion (note it successfully tells you you've won during stasis). I guess for now the best way to avoid it is not to use familiars that cause stasis. Not satisfactory, I know, but the best I've got at the moment.
 
My copy of BatBrain says:
Code:
   if (mdata.nostun < 1 && contains_text(action,"Unfazed, your opponent attacks you anyway!") && 
      vprint("This monster is stun immune!  That information should be added to batfactors.","red",2)) mdata.nostun = 1;

This text also appears for stagger bypass. Perhaps we want (mdata.nostun < 1 && mdata.nostagger == 0) && ...?
 
r124 adds support for the Darke Gyfte skills. Completely untested as I still haven't ventured into vampirism.
 
r124 adds support for the Darke Gyfte skills. Completely untested as I still haven't ventured into vampirism.

Works better today than yesterday. Thanks.

Dark Feast is a bit problematic. With one character WHAM tried to cast it when the character had max HP. With another, it seemed to never cast it, often aborting because there was not enough HP to cast something else. I suspect Dark Feast requires some special handling which is probably in WHAMs swim lane.
 
Yes, by "support" I simply meant that I added information about what the skills do when you use them (though Ensorcel is basically just "custom" for now). Decisions about how to use them still belong to the calling script.

FYI: BatBrain basically treats Feast as not existing until the monster has low enough HP for it to be effective. If WHAM is not otherwise instructed, I suspect it'll build a macro including some sort of "finisher" action without ever suspecting that Dark Feast even exists. It'll have to be a bit deliberate in not killing the monster before it can be drained.

I'll probably add some (decision-making) support for this to SmartStasis or SimpleSmack when I finally get 'round to becoming a hæmatophagic parasite.
 
@Magus: Thanks for the heads up. BatBrain was unaware of this because Zarqon either never knew it or completely forgot about it (the two are indistinguishable, as it happens). When the Zeppelin rolled out, I think most people still did the pirates, so it wasn't a priority. SS r42 adds some code for throwing glark cables at appropriate Zeppelin monsters, along with a few other small fixes and changes, such as prefacing all print statements generated by SS with "SS: ".
 
Normally I fight the shadow. in the tower, manually. Today I decided to let Simplesmack do it...

Code:
Encounter: Shadow Cannelloni Conjurer
Round 0: Arbos wins initiative!
SimpleSmack queueing... (Monster HP: 395, base profit 5)
SimpleSmack failed to kill the monster (395 HP remaining). Macro-ing with: attack;repeat
Countdown: 3 seconds...
Countdown: 2 seconds...
Countdown: 1 second...
Waiting completed.
Round 1: Arbos executes a macro!
Round 1: Arbos attacks!
Round 2: You lose 177 hit points
Round 2: Arbos attacks!
Round 3: You lose 180 hit points
Round 3: Arbos attacks!
Round 4: You lose 180 hit points

I had plenty of gauze garters in inventory.
 
Last edited:
This could be BatBrain, Smart Stasis or WHAM.

The KoE invader bullet monster is not known. What happens for me is I consistently lose if I just let WHAM handle things.

Since you only get two rounds to kill it before you lose I'm not sure whether updating BatBrain is sufficient to resolve the issue.

Tangentially - would it be a reasonable FR to have WHAM and/or SmartStasis abort if a monster is found that is unknown to BatBrain? This would have to be opt in but most of the time I would rather abort than get beaten up.
 
The invader boss is another new monster for the path. The approach suggested in the wiki worked for me: reduce my base HP, boost elemental resists, funk-sling high damage combat items. In my case it was two gas cans.
 
For some reason SimpleSmack, via Batbrain, is choosing to cast expensive, 120 MP, Hobopolis spells like "Raise Backup Dancer" against monsters that it can easily kill with the equipped weapon. This is in HC Kingdom of Exploathing runs as, so far: Seal Clubber, Turtle Tamer, and Pastamancer.
 
Last edited:
Hey Zarqon, I feel like I am doing something wrong when it comes to initializing batbrain. When trying to figure out the damage of smacks as a Seal clubber, it gives me crazy low damages. Example:
EoD Thinks: Lunge Smack will do 2679. BatBrain Thinks: Lunge Smack will do 160.
EoD Thinks: Thrust-Smack will do 2752. BatBrain Thinks: Thrust-Smack will do 160.
EoD Thinks: Lunging Thrust-Smack will do 3661. BatBrain Thinks: Lunging Thrust-Smack will do 160.
EoD Thinks: none will do 2670. BatBrain Thinks: none will do 160.
EoD Thinks: Northern Explosion will do 3808. BatBrain Thinks: Northern Explosion will do 160.

After attacking, I get.
Round 1: Ro casts LUNGING THRUST-SMACK!
Round 2: Alphabet Giant takes 3812 damage.

For initialization, I have

Code:
record SkillList {
	int dmg;
	float heal;
	float stun;
	int mp;
};
SkillList[skill] test;
void main( int rn, monster m, string pg) {
act(pg);
foreach it, adv in opts {
	if (contains_text(adv.id, "skill")) {
		temp = replace_string(adv.id, "skill ", "");
		current = to_skill(to_int(temp));
		EoD_AddSkill(current);
		test[current] = new SkillList (round(dmg_dealt(adv.dmg)), -dmg_dealt(adv.pdmg), adv.stun, mp_cost(current));
	}
}

I am assuming I am calling the wrong adv.dmg or dmg_dealt function? But reading through everything, I've yet to come across what my mistake is.
 
Normally I fight the shadow. in the tower, manually. Today I decided to let Simplesmack do it...

Haha, you are braver than I. Perhaps I'll take a look at that next go-round and see what's amiss.

@frono and @Magus: I've just added the Invader and his bullets to batfactors so that ought to help, though as with the Shadow I'm not sure SimpleSmack would find an appropriate strategy. Had to add a "daycount" fvar to BatBrain.

@Magus: Not sure what's up with preferring the 120MP skills? Perhaps fire up a combat in BatMan RE and check out the hitchance and predicted damage for your attack action, as well as your meatperhp and meatpermp values.

EDIT: Found something. I'm also in a very slow Exploathing run at the moment trying to fix all the broken things as I go in about an hour a day. I just saw a Hobopolis skill at the top of the table, so I looked further and saw that my meatpermp value is 0. That would do it. Something about the way BatBrain or UR calculates meatpermp is evidently broken in Exploathing.

@Elite: That looks correct. dmg_dealt() takes a damage spread and applies it to a given monster (including capping it at the monster's HP). There's an optional parameter for the HP cap though, so try using dmg_dealt(adv.dmg, false) to see BatBrain's uncapped damage predictions.
 
Last edited:
I looked further and saw that my meatpermp value is 0. That would do it. Something about the way BatBrain or UR calculates meatpermp is evidently broken in Exploathing.
This is very interesting. Since there often is no way to use meat to restore MP in Exploathing, that value is technically undefined. I think using a large number would work.
 
The following just appeared when using Simplesmack:

Code:
[4388] The Tunnel of L.O.V.E.
Encounter: L.O.V. Engine Room
Submitting option 1 for choice 1225
Encounter: LOV Engineer
Round 0: Arbos wins initiative!
Round 1: Arbos executes a macro!
Round 1: Arbos casts CURSE OF WEAKSAUCE!
Round 2: LOV Engineer drops 7 attack power.
Round 2: LOV Engineer drops 8 defense.
Round 2: Arbos casts SAUCEGEYSER!
Round 3: LOV Engineer takes 35 damage.
Round 3: LOV Engineer drops 7 attack power.
Round 3: LOV Engineer drops 9 defense.
Round 3: You lose 46 hit points
Changing "Invader" to "the invader" would get rid of this message. (BatBrain.ash, line 1093)

Note the last line.
 
Last edited:
WHAM wouldn't work for me with a Nanorhino. I haven't really looked into how BatBrain actually works, so for now, all I know is that the issue comes from the "rate unspaded" in Nanorhino's entry in batfactors.txt, which famevent reads and passes on to eval.
 
Back
Top