BatBrain -- a central nervous system for consult scripts

@Bale: Your version of Batfactros lack the change I did to fix the angry goat:
Code:
fam	4	Angry Goat	fweight/3.0+1	physical,stench	rate ceil(fweight/6.0)*0.1
 
@Bale: Your version of Batfactros lack the change I did to fix the angry goat:
Code:
fam	4	Angry Goat	fweight/3.0+1	physical,stench	rate ceil(fweight/6.0)*0.1

Thanks. Updated it to include that.

zarqon, any chance of uploading that to the map manager?
 
Anyone who was considering a name for a new multi, I believe Batfactros is it.

That is indeed an awesome name. I quite often swapp letters around while typing, but it's generally only the last two or the first two not in the middle of words...
 
>EDIT< edit to add ... looks like batfactors.txt is toast!

Since I 'updated' to the 1.1k batfactors in post 385, DAM stopped working completely.
ditto, I grabbed all 3 new files and now it does this:
Code:
97] Haunted Bedroom
Encounter: One Nightstand
Encounter: animated nightstand
Strategy: C:\Users\E073933\Dropbox\KM\ccs\kain.ccs [default]
Round 0: kain wins initiative!
Running ZLib version: r29
Running BatBrain version: 1.9
1 MP costs 17.0μ.
1 HP costs 5.1μ.
grouchy restless spirit (80.0 @ +100.0): 55μ * 100.0% = 55.0
Value of stat gain: 592.19μ
Profit per round: ActionProfitDamageOtherbase; Rogue Program (0μ)0μ--
Running SmartStasis version: 3.6
Stasis action chosen: attack
SmartStasis: -214 profit is too low to stasis with attack
grouchy restless spirit (80.0 @ +100.0): 55μ * 100.0% = 55.0
Value of stat gain: 592.19μ
Monster: Animated Nightstand (White), ATT: 186, DEF: 179, HP: 207, Value: 647.19
You will die in 5 rounds.
Your attack will kill the monster in 16 rounds.
Stasis action chosen: attack
DestroyAllMonsters: attack... killrounds: 16, dierounds: 5
DestroyAllMonsters is unable to figure out a useful combat strategy
Executing macro: scrollwhendone; sub batround; if haseffect 8 || haseffect 264 || haseffect 282 || haseffect 283 || haseffect 284; abort "BatBrain abort: poisoned"; endif; endsub; abort "Unable to figure out a useful combat strategy"; call batround; if hpbelow 46; abort "BatBrain abort: Danger, Will Robinson"; endif; 
Round 1: kain executes a macro!
KoLmafia thinks it is round 2 but KoL thinks it is round 1
DestroyAllMonsters: attack... killrounds: 16, dierounds: 5
DestroyAllMonsters is unable to figure out a useful combat strategy
Executing macro: scrollwhendone; sub batround; if haseffect 8 || haseffect 264 || haseffect 282 || haseffect 283 || haseffect 284; abort "BatBrain abort: poisoned"; endif; endsub; abort "Unable to figure out a useful combat strategy"; call batround; if hpbelow 46; abort "BatBrain abort: Danger, Will Robinson"; endif; 
Round 2: kain executes a macro!
KoLmafia thinks it is round 3 but KoL thinks it is round 1
You're on your own, partner.
Click here to continue in the relay browser.
 
Make sure it hasn't overwritten your batfactors.txt with the one from Zarqon's server, it does that from time to time if you have a local copy (I have a .backup of the file for that reason).
 
Make sure it hasn't overwritten your batfactors.txt with the one from Zarqon's server, it does that from time to time if you have a local copy (I have a .backup of the file for that reason).
The version that Bale posted (with updated fist skill formulas, etc) in the post with his version of batbrain and DAM is messed up., not the one from Z's server. I was able to revert to a 54K version from my dropbox folder.

I am also finding that DAM/SmartStasis wants to stasis with harpoon in fistcore ... in which you can't wield a weapon. If I take that line out of batfactors, it appears to be running correctly again.
 
Last edited:
Just saying that I think he accidentally just posted the update/patch and not the full version, making it non-functional. I replaced his with the zarqon server version, which was fine for my sauceror, but less fun on my fistcores. :)

Interesting Harpoon bug... anything else similar that requires a weapon? I think I heard that LTS and its family is now weapon-free (though doesn't work with ranged), but... anything else?
 
Alright. I already posted this in the SmartStasis thread because I initially thought it was a problem with SS, but I have discovered with the help of Winterbay that Batbrain has a brain fart if you are attempting to use it with a bottle rocket crossbow equipped.

Adventures end up looking like this:
Code:
Request 37 of 60 (Island: F'c'le) in progress...

[448] F'c'le
Encounter: clingy pirate
Strategy: C:\Users\Erik\Dropbox\KoLmafia\ccs\default-evilspoons.ccs [default]
Round 0: evilspoons wins initiative!
Evaluator syntax error: unexpected end of expr
Evaluator syntax error: can't understand |
Evaluator syntax error: can't understand |
1/6 monsters drop goals here.
Round 1: evilspoons executes a macro!
Round 1: evilspoons tries to steal an item!
You lose 12 hit points
Round 2: evilspoons uses the cocktail napkin!
Evaluator syntax error: unexpected end of expr
Evaluator syntax error: can't understand |
Evaluator syntax error: can't understand |

Batfactors.txt has the line "stats 1|1|1" after "fire orange bottle-rocket". This is the only place the pipe character appears in Batfactors except "Play a guitar solo", but I do not have the item that provides that effect in order to test.

First: what's going wrong here? It seems like BatBrain isn't processing the text in Batfactors.txt properly and a pipe symbol is being interpreted by kolmafia as a script element instead of a string that's parsed *by* the script.

Second: As a band-aid fix for now, is there a way to simply remove the "stats" entry without it reappearing? I don't understand how Batfactors.txt is set up.
 
Adding the following to ok(advevent a) should solve the harpoon!-problem:
Code:
case "skill 1023": //Harpoon!
	if(equipped_item($slot[weapon]) == $item[none])
		return false;
 
Adding the following to ok(advevent a) should solve the harpoon!-problem:
Code:
case "skill 1023": //Harpoon!
	if(equipped_item($slot[weapon]) == $item[none])
		return false;
Problem is, where. In the switch set, it doesn't actually have any "break" bits in there, so each check rolls into the next, unless an explicit bit has been done similar to the FFF. As such, put it between FFF and shield, it doesn't stop people from shieldbutting while weaponless, but does mean that it will use harpoon on the Procrastination Giant and that you need a shield to harpoon. Put it between shield and LTS and your shield problem goes away for Harpoon, but now you can't shield-butt without a weapon. Put it between LTS and attack, and you now need a weapon for all groups... bad option.

Not sure what the easiest choice is, since I haven't actually ever used Harpoon! but specifics on where you're suggesting it be added would probably help. :)
 
Winterbay, Theraze: I think that the best way to do that is this:

PHP:
boolean no_cunctatitis() {
	return m != $monster[Procrastination Giant] || weapon_type(equipped_item($slot[weapon])) == $stat[Moxie];
}

boolean ok(advevent a) {
	matcher aid = create_matcher("(skill |use |attack|jiggle)(?:(\\d+),?(\\d+)?)?",a.id);
	if(aid.find())
		switch(aid.group(1)+aid.group(2)) {
		case "use 3391":  // Frosty's iceball. Don't use it!
			return false;
		case "skill 66": //Flying Fire Fist
			// Don't auto-use this if it will expend Salamanderenity.
			if(have_effect($effect[Salamanderenity]) > 0) return false;
			#if(have_effect($effect[Salamanderenity]) > 3* get_property("fistSkillsKnown").to_int()) return false;
			return true;
		case "skill 1023": //Harpoon!
			return equipped_item($slot[weapon]) != $item[none] && no_cunctatitis();
		case "skill 2005": //Shieldbutt
		case "skill 2105": //Head + Shield Combo
		case "skill 2106": //Knee + Shield Combo
		case "skill 2107": //Head + Knee + Shield Combo
			if(item_type(equipped_item($slot[off-hand])) != "shield") return false;
		case "skill 1003": //Thrust-Smack
		case "skill 1004": //Lunge-Smack
		case "skill 1005": //Lunging Thrust-Smack
		case "skill 2003": //Headbutt
		case "skill 2015": //Kneebutt
		case "skill 2103": //Head + Knee Combo
			if(weapon_type(equipped_item($slot[weapon])) == $stat[Moxie]) return false;
		case "attack":
			return no_cunctatitis();
		}
	return true;
}
 
Done.

Am finding a DAM fistcore issue today... it wants to use Moxious Maneuver when it can't hit (my moxie is still too low), even though Drunken Baby easy one-hits the monsters. Has anyone checked if these are guaranteed hits? Appears to be, or at least it's improved by the Master of the Fist skill... current stats (now that I've gained a few moxie) are 65/61/97 and I'm in the ballroom.
 
Fist skills are auto-hit. Or they're something like +200 to-hit, because I was fighting LFM at level 6 with +ML piled on (softcore).
 
Possible that my Fistcore problem was due to the map manager overwriting the batfactors file, since when I checked just now it was missing the fist skills... Guess that's one more thing to check before changing default action from CCS to DBS. :)
 
1.10 Update

Most of the changes are in the changelog -- the majority of issues described have been fixed. The most exciting bit is full Fistcore support. Well, that and it will actually verify again! :)

Several known issues remain:
  • Auto-funk conversion was broken a while ago and will require some brainstorming to fix. That means that for people with Funkslinging, BatBrain may select a stunning item to sling along with a combat item -- however, they will be slung individually.
  • Still haven't added Winterbay's Saucesphere bonuses. The methods I tried were all unsatisfactory.
  • Predictive Mistletoe augmentation of DB skills. Considering the increasing number of "action enhancers" (Mistletoe, Throw Shield, multistunners), I'm considering making them a separate action category.

Also, a note: batfactors hasn't been updated yet, but I'm on it and if it doesn't get out in the next 10 minutes (when my students will start to swarm this classroom), I'll get to it at the end of the workday (about 5 hours later). I'm not going to let myself go home without updating that. It'll fix a few of the problems users have encountered:

  • Frosty's iceball is marked "custom" which means it will be removed by BatBrain, and its presence will hopefully deter anyone from feeling like they need to add it again.
  • All Fist skills are included, including bonuses from Salamanderenity and Earthen Fist. The cost of Flying Fire Fist is calculated as the MP cost of replacing your current turns of Salamanderenity, so that ought to avoid needlessly wasting the buff.
  • The dictionaries are tied to the Chasm's monsters rather than the Chasm, so their damage ought to be correctly 0 against monsters which wander into the Chasm.
  • The redundant "multi" flags were removed.


zarqon, any chance of uploading that to the map manager?

Sorry but I didn't, because the version you posted is, as they say, toast. It doesn't separate stats with the pipe character (BatBrain eval's stats, so / means division). It also doesn't consider the Earthen Fist or Salamanderenity bonuses. But the kicker is that your version will also actually corrupt users' fistSkillsKnown preference. Check the ASH wiki on modifier_eval().

Thanks for your help in adding the Fist skills though, it sped things along when I added them to batfactors.

So, now we have a "working" update. For now, I'm going to ignore all the previous posts, since it's hard to say which version of BatBrain they're about. I understand your impatience Bale, but it's made a lot more work for me -- thus increasing the delay, thus increasing your impatience to post more things, etc. ad nauseum. Later when my computer finally friggin' works I'll go back over this thread and see who was talking about BatBrain and who was talking about BatBrain, and address the remaining issues that are related to BatBrain and not BatBrain. (What? Did you really post a fork with the same name, in the same thread? Is anyone besides me confused? Go start a new thread and rename the file, please. I suggest "BaleBrain.")

Hopefully this update will restore a semblance of order to this thread.
 
Awesome! I'm just happy that I've got a functional official version of BatBrain to work with again.

I hadn't realized the problem with using pref() on an integer. Dang.

Sorry I troubled you with my impatience, but the topic of BatBrain powered consult scripts came up and I decided to share, but it wouldn't work at all unless I uploaded my BatBrain since yours lacked functional monster_stat("hp") prediction. Your freshly posted version does fix that problem.


Auto-funk conversion was broken a while ago and will require some brainstorming to fix.

I think you need to break out the tongs.
 
Last edited:
Back
Top