BatBrain -- a central nervous system for consult scripts

Ryo_Sangnoir

Developer
Staff member
You can, in ASH, catch Mafia errors with the "catch" keyword, so

Code:
catch map_to_file(happenings,"BatMan_happenings_"+replace_string(my_name()," ","_")+".txt");

is perhaps the simplest fix.
 

fronobulax

Developer
Staff member
I will observe that my use of BatBrain is indirect, via SimpleSmack or BatmanRE but I have not seen this problem. My batfactors.txt is dated 06/22/2022 so maybe I'm not getting updates that expose the issue. (If true that would be a problem with the scripts update code, but...)
 

heeheehee

Developer
Staff member
gCLI said:
> ashq int[monster] all_monsters; foreach m in $monsters[] all_monsters[m] = 1; map_to_file(all_monsters, "all_monsters.txt")

()
Script execution aborted (java.lang.NullPointerException: Cannot invoke "net.sourceforge.kolmafia.textui.parsetree.Value.dump(java.io.PrintStream, String, boolean)" because "value" is null): ()

It sure looks like there's some monster that no longer deserializes / serializes cleanly. Digging deeper...
 

heeheehee

Developer
Staff member
Yet... writing single-entry maps with each monster does not cause issues.

> ashq int[monster] all_monsters; foreach m in $monsters[] { clear(all_monsters); all_monsters[m] = 1; map_to_file(all_monsters, "all_monsters.txt"); }
 

heeheehee

Developer
Staff member
Hm. I don't think that's quite it, since manually adding the entry to the map (either before or after the loop) makes it crash elsewhere. But, it's clear that Map.aref is returning null (possibly because the comparison contract is breaking?).
 

heeheehee

Developer
Staff member
There are some monsters with identical names (9x Jerry Bradford, 2x Bowser). However, the actual issue seems to be Ed the Undying (1-7), which all have ID 0.
 

heeheehee

Developer
Staff member
Okay. I think the core problem is that we're breaking transitivity.

the darkness (blind) > fired-up Knob Goblin King (string comparison)
the darkness (blind) < zombie waltzers (string comparison)
...
zombie waltzers < fired-up Knob Goblin King (id comparison)
 

Magus_Prime

Well-known member
I will observe that my use of BatBrain is indirect, via SimpleSmack or BatmanRE but I have not seen this problem. My batfactors.txt is dated 06/22/2022 so maybe I'm not getting updates that expose the issue. (If true that would be a problem with the scripts update code, but...)
I use BatBrain in the same way and it hit me immediately after updating KoLmafia to any release later than r26738. The first thing I, normally, do after logging in is to complete the Daily Dungeon and in every combat I get the error described.

I will check r26759 this morning.

Edit: Tested with r26761 and ran 90+ turns on an alt, most of them combats, with no errors. Ran another 354 turns on my main, via VMF with no errors. All combats were via SimpleSmack. Thank you!
 
Last edited:

zarqon

Well-known member
I think r26759 fixes this, but please let us know if that's not the case.

I've played my turns for today already, but I'll check this out tomorrow. My experience matches Magus's (all combats generated the error) so if I have no issues I'd be confident in calling the issue fixed. Thanks very much for your effort regardless.
 

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
I've played my turns for today already, but I'll check this out tomorrow. My experience matches Magus's (all combats generated the error) so if I have no issues I'd be confident in calling the issue fixed. Thanks very much for your effort regardless.
How odd - I had it happen sometimes but couldn't get it to happen when I actually sat down to debug
 
Top