BatBrain -- a central nervous system for consult scripts

I know I mentioned that deleting the "happenings" file seemed to fix my issues but they are back. There is something wrong with the line for the Toss skill (2023), I constantly get this error whenever WHAM considers using that skill, regardless of me deleting the happenings file or anything like that

Code:
Expression syntax errors for 'modifier_eval()':
Can't understand fweight+3,10)+floor(sqrt(max(fweight-7,0)))
Expected ,, found
Unexpected end of expr
Expected ), found (zlib.ash, line 188)
You're on your own, partner.

EDIT

Right now I am using BCA to go through the battlefield, more specifically doing the junkyard quest. The script automatically remove my familiar since I use the Starfish so me not having a familiar on might have something to do with it

EDIT 2

Since I was going to have to go through this area manually I gave my theory a try and equipped a familiar and then tried to use WHAM against the mobs in the junkyard, it worked. Looks like the script needs some kind of fail safe so it doesn't break if you don't have a familiar on
 
Last edited:

Bale

Minion
I'm pretty sure that WHAM just sorts and evaluates options that are passed by BatBrain which means that BatBrain shouldn't have added that to opts if it cannot be used. I wouldn't blame WHAM.
 

Veracity

Developer
Staff member
Fortunately, we are in the BatBrain thread, so zarqon will see this and decide what BatBrain needs to do. Perhaps I should have said "WhamBrain should not use Toss if you have no familiar." :)
 
My general use familiar is a combat one, therefore it deals damage in fights. In the junkyard you want to deal extremely low damage, if any damage at all, until you know if they have the item you are looking for or not. So, BCA detects that my familiar might hinder my progress in the quest by killing mobs I don't want to kill so he just removes the familiar. But it is not programmed to get any other familiar to take its place so it just runs it with no familiar.
 

Crowther

Active member
My general use familiar is a combat one, therefore it deals damage in fights. In the junkyard you want to deal extremely low damage, if any damage at all, until you know if they have the item you are looking for or not. So, BCA detects that my familiar might hinder my progress in the quest by killing mobs I don't want to kill so he just removes the familiar. But it is not programmed to get any other familiar to take its place so it just runs it with no familiar.
Aaah. Thanks for the explanation. I never liked how BCA handled that quests, so I've always done it by hand.
 

Beljeferon

New member
Script execution aborted (java.lang.OutOfMemoryError: Java heap space): (BatBrain.ash, line 1705)

Bumcheekascend is crashing during the island quest with this error... suggestions?
 

Winterbay

Active member
Your Java-installation is running out of memory. You can either use a command-line thingie to increase the available memory that Java allocates or be proactive while running BCA and press the Garbage collection-button which will give you some more time, but may not be enough.
 

xKiv

Active member
or be proactive while running BCA and press the Garbage collection-button which will give you some more time, but may not be enough.

Manually running GC can never do anything that wouldn't happen anyway, other than report different numbers about used memory. The program will still run out of memory at precisely the same point.

ETA: actually, running GC manually can make you run out of memory *faster*, if you manage to inappropriately-prematurely give tenure to any object (objects can always grow old when eden is too small, but they can never revert back to young).
 
Last edited:
How can I disable happenings logging? I'm running SmartStasis in the Sloppy Seconds Diner, and KoLMafia pauses for two to three seconds after each round of combat (not each combat, each individual round), after the "logging happenings the old way" message. Even weirder, if I put KoLMafia in the background, after working for a while it grinds to a halt unless uncover enough of the graphical CLI window. (I don't even have to make it the foreground app, just make sure the whole CLI window is visible.) If I switch my CCS to straight combat, KoLMafia runs smoothly. This behavior started with the most recent major revision to BatBrain, which introduced the new happenings logging method.
 

Bale

Minion
BatBrain needs a bit of work to handle happenings in Ed. Each time you revive from death, Ed can use once per fight things again so happenings needs to track that. Fortunately KoLmafia has just added the necessary support.

_edDefeats contains the number of times you have died this fight. It resets to 0 when fight is won or aborted.
 
I am also encountering the same Java out of memory error that Beljeferon reported (exact same error message). I saw it first after about 200 adventures, when KoLMafia aborted my adventuring script; my CCS uses SmartStasis.. Re-running the script gave me the error on the next combat. Quitting and relaunching KoLMafia doesn't entirely help: initially it would run for anywhere from 5 to 20 more adventures, but eventually it aborted after one. It definitely depends on adventure location: continuing to statis at the Sloppy Seconds Diner gives me the error, but when I switched to the Hidden Hospital I could stasis indefinitely with no errors. I suspect the problem relates to the recent change in happenings logging, which generates an error message after every round of combat with name-changing monsters. (I ran KoLMafia on a different machine today, which didn't exhibit the same "pause three seconds after every round of combat" behavior as the one I usually use. I suspect if I'd let that computer run long enough, it would have given the "out of heap" error eventually.)
 

heeheehee

Developer
Staff member
Some preliminary data on Ed's (evocation) skills:

* Fist of the Mummy scales as 1*buffedmys + spelldmg, capped at 50. %spell damage applies after this.
* Howl of the Jackal scales as 1*buffedmys + spelldmg + spookyspelldmg, capped at 100. %spell damage applies after this.
* Roar of the Lion scales as... (1.5?..1.9?)*buffedmys + spelldmg + hotspelldmg, uncapped.
* Storm of the Scarab deals prismatic damage that totals around 0.5-0.6*buffedmys. Split... strangely. Generic spell damage applies to _each_ element, but typed spell damage (e.g. spooky) does not apply. Uncapped.

Something strange I noticed: spell crits seem to be applied after bonus spell damage, but after caps? I really don't understand how that's coded. Maybe it just takes the original damage roll and adds that much more damage?
 
To follow up on my recent error reports: both problems have been resolved. BatBrain still complains about non-matching monster names, but doesn't grind KoLMafia to a halt. I haven't see any recent updates to BatBrain, but I think there was one to zlib, which may have resolved the problem.
 

Theraze

Active member
A note I've noticed: It appears that the non-matching monster name seems to come up on any monster with a legitimate article in its name. For example, The Bonerdagon tries to match against "Bonerdagon" which, well:
Encounter: The Bonerdagon
Round 0: Theraze wins initiative!
You lose 1 hit point
> Encounter with "Bonerdagon" not found! Attempting case-insensitive match...
> This encounter cannot be found by name; logging happenings the old way.
This is of course because of how mafia does it...
> ash $monster[the bonerdagon]

Bad monster value: "the bonerdagon" ()
Returned: void

> ash $monster[bonerdagon].to_string()

Returned: Bonerdagon
Not sure if there's anything we can actually do to get the proper combat string, or if that would need to be a new FReq.
 

lostcalpolydude

Developer
Staff member
Is last_monster() not good enough? I don't know nearly enough about this script to guess why it's trying to parse the monster name from the page when mafia already knows the monster name (and if it doesn't for a specific case, then that would need fixing).
 

Theraze

Active member
It actually parses from the session log, which is where there's a problem. The session log now shows what KoL itself does, which means that monsters have articles and we can't disambiguate between Ninja Snowmen. But if we can know what will show up in the log, the script could pull that string instead.
 
Top