BatBrain -- a central nervous system for consult scripts

It's great that that possibility exists, but I definitely don't feel comfortable pushing an update myself, without first being 100% sure that it's correct.
 
Thanks for putting that bee in my bonnet, @adeyke. It's been quite a while since I've had scripting time, but today I had a nice window of child-free time and decided to use it to update the ol' combat suite.

Have just updated BatBrain, SmartStasis, and batfactors with lots of previously unsupported skills, using your post as a starting point. Still more to add, and I ran out of time to add items, but much progress was made.
 
Thanks for the update, and sorry for putting you on the spot. The update actually ended up being too effective for me. It's now using all the skills from my designer sweatpants, leaving me unable to cast Sweat Out Some Booze. I added this line to my BatBrain.ash to address this:
Code:
        case 7415: case 7416: case 7417: case 7421: if (get_property("sweat").to_int() < 80 - 25 * get_property("_sweatOutSomeBoozeUsed").to_int()) return; break;

(Technically, that 80 could be lower based on which skill it is in particular, and by factoring in the sweat gained as a result of that combat, but I chose to err on the side of caution and simplicity.)
 
Thanks for the update, and sorry for putting you on the spot. The update actually ended up being too effective for me. It's now using all the skills from my designer sweatpants, leaving me unable to cast Sweat Out Some Booze. I added this line to my BatBrain.ash to address this:
Code:
        case 7415: case 7416: case 7417: case 7421: if (get_property("sweat").to_int() < 80 - 25 * get_property("_sweatOutSomeBoozeUsed").to_int()) return; break;

(Technically, that 80 could be lower based on which skill it is in particular, and by factoring in the sweat gained as a result of that combat, but I chose to err on the side of caution and simplicity.)
How would I make batbrain ignore my sweatpants entirely? I only ever use them to sweat out booze anyway.

ETA: And where would I put this? I just tried slapping that code into the beginning of batbrain and mafia yelled at me :(
 
Last edited:
The best way would be to just add them to your personal blacklist. In KoLmafia's data folder, edit (or create if it doesn't exist) the file BatMan_blacklist_[your KoL user name].txt and add these lines:
Code:
skill 7415    0
skill 7416    0
skill 7417    0
skill 7421    0

(That should be a tab before the 0, not spaces.)

If you're using WHAM, the included WHAM_dontuse relay script can instead be used to manage that blacklist.
 
Last edited:
Warning: image 'adventureimages/bond_minion1.gif' does not match monster 'Villainous Minion' (bond_minion1.gif).

I can repeatedly get the above message by faxing and then fighting a Villainous Minion. ("repeatedly" means it has happened twice and I expect it to keep happening until I get all the factoids and stop faxing it :-) )

I believe it is generated by Batbrain since I can't find the non-constant parts of the message in the code or any other scripts.

I looked at KoLmafia's data for a Villainous Minion and I can't find anything obviously wrong. There could be a whitespace issue in monsters.txt but my tools that would confirm that aren't on this system and I haven't dealt with them yet.

Anyone have any suggestions or able to beat me to a whitespace check?

My intuition says there is inconsistent data somewhere and a fix should be simple.
 
I tried to create a test case using that section of BatBrain, but it didn't recreate the problem. Might need to capture the actual page.
Code:
import zlib
string page = "adventureimages/bond_minion1.gif";
matcher imgm = create_matcher("adventureimages\\/([^ ]+\\.gif)",page);
monster m = $monster[Villainous Minion];
if (imgm.find() && !(m.images contains imgm.group(1))) vprint("Warning: image '"+imgm.group(1)+"' does not match monster '"+m+"' ("+m.image+").","#8585FF",3);
 
I tried to create a test case using that section of BatBrain, but it didn't recreate the problem. Might need to capture the actual page.
Code:
import zlib
string page = "adventureimages/bond_minion1.gif";
matcher imgm = create_matcher("adventureimages\\/([^ ]+\\.gif)",page);
monster m = $monster[Villainous Minion];
if (imgm.find() && !(m.images contains imgm.group(1))) vprint("Warning: image '"+imgm.group(1)+"' does not match monster '"+m+"' ("+m.image+").","#8585FF",3);

And having asserted its expected repeatability it hasn't happened the two most recent times. I fight the faxed monster in the relay browser. When I got the fight page the image was of a man on skis. I used my CCS which is essentially SimpleSmack using BatBrain and at the end of the fight the image sis not appear on the page and I had the missing image instead.

Makes me wonder about the image cache or some place where a comparison needs to consider case and or white space but at this moment it is just one of many things I should investigate.
 
Well. I faxed and fought. The display at the beginning of the fight had the minion image. The display at the end had the missing image. The location of the image that could not be displayed was http://127.0.0.1:60082/images/adventureimages/adventureimages/bond_minion1.gif

Note the correct location should be


The image is in the cache. A problem is that something that is processing images inserted an extra adventureimages into the path.

Hypothesis which I don't have time to check quickly - KoLmafia unnecessarily inserts an additiona adventure images when processing monsters with multiple images and BatBrain merely detected it.
 
Back
Top