BatBrain -- a central nervous system for consult scripts

1.23 Updates and BatMan Relay!

Gosh Bruce, do I have big news for you today!

NEWS FLASH! NEWS FLASH! BatMan Relay has been released just minutes ago. It is a crime-fighting juggernaut of calculating destruction. Go check it out!

Also, can anyone tell me the best way to include screenshots and other images in a thread here? I assume I'll need to host the images somewhere but I don't usually do this kind of thing.

And now for your regularly scheduled BatBrain update list. Boy oh boy do I have some great ones for you!

First, three gigantic bugfixes!

  1. As mentioned, tracking for events was getting thrown off by your turncount increasing on the last page of combat, but only for automated play! Fixing that will have widespread repercussions of goodness!
  2. As mentioned, kill_rounds() was being fooled by capping the damage at the average monster HP, despite calculating the turns needed using pessimistic monster HP (meaning that kill_rounds was never less than 2)! Fixing this will make all sorts of things work right!
  3. Fumbles were being stupidly added to melee attack skills! Don't do that! No! No! Only add fumbles to your regular attack with weapon!

Second, a wide array of more butt-kicking for goodness!

As Winterbay suggested, when building items, skip items if you've already enqueued as many as you have!

The Song of Battle totally grants you a 100% hitchance, but after Cunctatitis and Dr. Awkward's aura.

Hey! Since the sort formulas are relatively expensive in terms of processor time, why not always cache the results of those, too? It worked great for profit calculations! So now there are three new global advevents: plink, smack, and buytime. These contain the results of stasis_action(), attack_action(), and stun_action(), respectively, and they are assigned automatically when calling any of the sort functions! You don't need to create your own local variables to contain these now -- simply access the globals after calling the sort function once.

Speaking of sort_action(), it sucked before! So I made it more awesome!

Thanks to syzzle implementing an effect() function for modifier expressions, we could totally scrap several fvars and case checks for heightened efficiency!

Yo, Volcanocumulostratostruthic Explodoaustralopithecanthophthalmoruption totally accounts for the cost of its material component now!

Be totally pessimistic about monster HP variance, for increased optimism about victory! And don't forget -- bosses don't variate.

You know what? Screw considering all possible poisons as potentially dangerous! Now that poison is a proxy field for monsters, let's only consider that one poison. For swift execution! ...of justice! ...and monsters!

Q: Say, is Mighty Axing available without Trusty? A: Does zarqon adore regexes?? What that means is no!

I leave you with this true story:

Robin: "Boy! That was our closest call ever! I have to admit that I was pretty scared!"
Batman: "I wasn't scared in the least."
Robin: "Not at all?"
Batman: "Haven't you noticed how we always escape the vicious ensnarements of our enemies?"
Robin: "Yeah, because we're smarter than they are!"
Batman: "I like to think it's because our hearts are pure."

And now, thanks to these updates, BatBrain's brain is pure too. Enjoy this astounding amalgamation of awesome enhancements!!
 
I perused the forums and didn't see anything helpful to resolve this new warning:

can't understand havesugar?

[32936] Giant's Castle
Encounter: Possibility Giant
Strategy: D:\Games\KoL\Current Builds\Derp\ccs\Default.ccs [default]
Round 0: Derp wins initiative!
Evaluator syntax error: can't understand havesugar
Evaluator syntax error: can't understand havesugar
Round 1: Derp executes a macro!
Round 1: Derp casts LASAGNA BANDAGES!
You gain 17 hit points
Evaluator syntax error: can't understand havesugar
Evaluator syntax error: can't understand havesugar
 
Raven, your batfactors didn't get updated yet. Though I suspect this error "magically disappeared" by now, you could delete your local copy of batfactors to force it to update, just in case.
 
Was hoping I was having a similar batfactors problem fixed by updating, but...
Updating batfactors.txt from '' to '2012-04-30T08:10:48-05:00'...
...batfactors.txt updated.
ATT: 1 (6% × 1, death in 2867)
DEF: 1 (97.73% × 118.06, win in 1)
HP: 1.05, Value: 266.38 μ
Profit per round: Action Profit Damage Other base (0μ) 0μ --
Expression syntax error for 'modifier_eval()': expected end, found E-8
I get the bottom line every time my two seal clubbers run combat.

Edit: Hmm... I got it on every combat yesterday, but it was just at the start of the day for this SC. Maybe had to do with the equipped gear or familiar or something similar.

And... it's back now that I've re-ascended into AoB.
Expression syntax error for 'modifier_eval()': expected end, found E-7
Well, almost back. :) It lost a number somewhere along the way.
 
Last edited:
Raven, your batfactors didn't get updated yet. Though I suspect this error "magically disappeared" by now, you could delete your local copy of batfactors to force it to update, just in case.

Thanks Zarqon. I was just getting ready to try that. :-)
 
IF you do delete your batfactors, remember to delete the line in zversions.txt as well or it won't download the new version and you will be left without a batfactors at all...
 
Hmmm... presently load_current_map() returns false in that situation, but with no error message. I'd also wager that most scripters are not using the return value at all. So, considering an empty map the same as an outdated version would be an improvement. I'll tweak that for the next ZLib.
 
One thing I noticed last night fighting AoSP, I know his ML/HP is unspaded due to the extra ML gained with boris points or whatever it is... but that leaves batbrain thinking he should be dead already (mafia is reporting -hp after all), and so the enqueue/suggestion goes from Cleave (dealt:1) to the specter scepter (dealt: 2.something). Using the scepter there is a recipe for player death.; At some point, I feel there needs to be a backup plan for when mafia/bb thinks the monster should be dead already and it isn't.

I'm going to do a couple of myst hcnp's before the new path season next.
 
There appears to be a bug with not deducting items that are enqueued so that we don't use too many of them. I added the following function to WHAM to try and fix this:
Code:
//Count happenings to avoid items that have already been enqueued as many as we have
int times_happened(string occurrence)
{
	if (count(happenings) == 0)
		file_to_map("happenings_"+replace_string(my_name()," ","_")+".txt",happenings);
	if (happenings contains occurrence && happenings[occurrence].turn == turncount)
		return happenings[occurrence].queued + happenings[occurrence].done;
	return 0;
}

It appears to do the trick so far...
 
@Weatherboy: If you opt to automate combat against a monster with unknown or inaccurate stats using a script that relies heavily on accurate info, you should expect suboptimal results. The workaround for that would be to either spade the stats so they can be added to mafia, or use a CCS that ignores monster stats.

@Winterbay: Does that still happen? I put in a check in the last update to fix that.

Including BatBrain.ash it appears :)

I don't make risky wagers, generally. :)
 
@Winterbay: Does that still happen? I put in a check in the last update to fix that.

It appears to yes. It tried to enqueue four of my one cocktail napkins before I put in that check.

Edit: Or am I just being stupid? If I enqueue an item suggested by attack_action() and then call attack_action() again, I would assume it not to suggest the same item if I only had one of them to begin with...
 
Last edited:
Code:
        [1071] Fernswarthy's Basement (Level 129)
Encounter: The Ghost of     Fernswarthy's great great great great Grandfather
Round 0: [COLOR=#2cae33]epicgamer[/COLOR]     wins initiative!
Round 1: Spicy produces a tubular red firecracker     labeled M-36, lights the long fuse, and tosses it behind your opponent.
Factoring     in navel ring of navel gazing: 0 damage, stun 0.5
Factoring in V for     Vivala mask: 11.55[B] [COLOR=red](11.55)[/COLOR][/B]     damage, stun 0.33, oncrit
[COLOR=purple]WHAM: Monster HP is     410.0.[/COLOR]
[COLOR=purple]WHAM: Running SmartStasis[/COLOR]
Round     1: [COLOR=#2cae33]epicgamer[/COLOR] executes a macro!
Round 1: [COLOR=#2cae33]epicgamer[/COLOR]     casts SPRING RAINDROP ATTACK!
You gain 16 hit points
You gain 18     Mojo Points
[COLOR=purple]WHAM: We are going to 1-shot with     Weapon of the Pastalord.[/COLOR]
Round 2: [COLOR=#2cae33]epicgamer[/COLOR]     executes a macro!
Round 2: [COLOR=#2cae33]epicgamer[/COLOR] casts     WEAPON OF THE PASTALORD!
Round 3: the ghost of fernswarthy's n     great-grandfather takes 1 damage.
[COLOR=purple]WHAM: Current     monster HP is calculated to 409.0[/COLOR]
[COLOR=purple]WHAM: We     are going to 1-shot with Weapon of the Pastalord.[/COLOR]
Round 3: [COLOR=#2cae33]epicgamer[/COLOR]     executes a macro!
Round 3: [COLOR=#2cae33]epicgamer[/COLOR] casts     WEAPON OF THE PASTALORD!
Round 4: the ghost of fernswarthy's n     great-grandfather takes 1 damage.
Round 4: the ghost of fernswarthy's n     great-grandfather takes 19 damage.
You lose 265 hit points
[COLOR=purple]WHAM:     Current monster HP is calculated to 389.0[/COLOR]
[COLOR=purple]WHAM:     We are going to 1-shot with Weapon of the Pastalord.[/COLOR]
Round 4: [COLOR=#2cae33]epicgamer[/COLOR]     executes a macro!
Round 4: [COLOR=#2cae33]epicgamer[/COLOR] casts     WEAPON OF THE PASTALORD!
Round 5: the ghost of fernswarthy's n     great-grandfather takes 1 damage.
[COLOR=purple]WHAM: Current     monster HP is calculated to 388.0[/COLOR]
[COLOR=purple]WHAM: We     are going to 1-shot with Weapon of the Pastalord.[/COLOR]
Round 5: [COLOR=#2cae33]epicgamer[/COLOR]     executes a macro!
Round 5: [COLOR=#2cae33]epicgamer[/COLOR] casts     WEAPON OF THE PASTALORD!
Round 6: the ghost of fernswarthy's n     great-grandfather takes 1 damage.
[COLOR=purple]WHAM: Current     monster HP is calculated to 387.0[/COLOR]
[COLOR=purple]WHAM: We     are going to 1-shot with Weapon of the Pastalord.[/COLOR]
Round 6: [COLOR=#2cae33]epicgamer[/COLOR]     executes a macro!
Round 6: [COLOR=#2cae33]epicgamer[/COLOR] casts     WEAPON OF THE PASTALORD!
Round 7: the ghost of fernswarthy's n     great-grandfather takes 1 damage.
[COLOR=purple]WHAM: Current     monster HP is calculated to 386.0[/COLOR]
[COLOR=purple]WHAM: We     are going to 1-shot with Weapon of the Pastalord.[/COLOR]
Round 7: [COLOR=#2cae33]epicgamer[/COLOR]     executes a macro!
Round 7: [COLOR=#2cae33]epicgamer[/COLOR] casts     WEAPON OF THE PASTALORD!
Round 8: the ghost of fernswarthy's n     great-grandfather takes 1 damage.
[COLOR=purple]WHAM: Current     monster HP is calculated to 385.0[/COLOR]
[COLOR=purple]WHAM: We     are going to 1-shot with Weapon of the Pastalord.[/COLOR]
Round 8: [COLOR=#2cae33]epicgamer[/COLOR]     executes a macro!
Round 8: [COLOR=#2cae33]epicgamer[/COLOR] casts     WEAPON OF THE PASTALORD!
Round 9: the ghost of fernswarthy's n     great-grandfather takes 1 damage.
You lose 262 hit points
[COLOR=purple]WHAM:     Current monster HP is calculated to 384.0[/COLOR]
[COLOR=purple]WHAM:     We are going to 1-shot with Weapon of the Pastalord.[/COLOR]
Round 9: [COLOR=#2cae33]epicgamer[/COLOR]     executes a macro!
Round 9: [COLOR=#2cae33]epicgamer[/COLOR] casts     WEAPON OF THE PASTALORD!
Round 10: the ghost of fernswarthy's n     great-grandfather takes 1 damage.
You lose 266 hit points
[COLOR=purple]WHAM:     Current monster HP is calculated to 383.0[/COLOR]
[COLOR=purple]WHAM:     We are going to 1-shot with Weapon of the Pastalord.[/COLOR]
Round 10: [COLOR=#2cae33]epicgamer[/COLOR]     executes a macro!
Round 10: [COLOR=#2cae33]epicgamer[/COLOR]     casts WEAPON OF THE PASTALORD!
Round 11: the ghost of fernswarthy's n     great-grandfather takes 1 damage.
You lose 277 hit points
[COLOR=purple]WHAM:     Current monster HP is calculated to 382.0[/COLOR]
[COLOR=purple]WHAM:     We are going to 1-shot with Weapon of the Pastalord.[/COLOR]
Round 11: [COLOR=#2cae33]epicgamer[/COLOR]     executes a macro!
Round 11: [COLOR=#2cae33]epicgamer[/COLOR]     casts WEAPON OF THE PASTALORD!
Round 12: the ghost of fernswarthy's n     great-grandfather takes 1 damage.
You lose 283 hit points
[COLOR=purple]WHAM:     Current monster HP is calculated to 381.0[/COLOR]
[COLOR=purple]WHAM:     We are going to 1-shot with Weapon of the Pastalord.[/COLOR]
Round 12: [COLOR=#2cae33]epicgamer[/COLOR]     executes a macro!
Round 12: [COLOR=#2cae33]epicgamer[/COLOR]     casts WEAPON OF THE PASTALORD!
Round 13: the ghost of fernswarthy's n     great-grandfather takes 1 damage.
[COLOR=purple]WHAM: Current     monster HP is calculated to 380.0[/COLOR]
[COLOR=red]KoLmafia     declares world peace.[/COLOR]
[COLOR=red]You're on your own,     partner.[/COLOR]
[URL="http://kolmafia.us/main.php"]Click     here to continue in the relay browser.[/URL]

I would think this is a batbrain issue not wham, as it seems to think weapon is doing prismatic damage.
 
Last edited:
BatBrain is actually having some issues with a couple of the basement monsters. It's trying to use spells that are frequently blocked by the beer golem as well for example.
 
This bit makes me suspicious:

Code:
Encounter: The Ghost of Fernswarthy's great great great great Grandfather

If that's a monster mafia knows about, shouldn't it say "The Ghost of Fernswarthy's n great-grandfather"? But if it's a monster mafia doesn't know about, where is it getting the 410 HP from? Something's fishy here. I wish your verbosity had been high enough to see the monster info readout so I could see what mafia considers all the stats to be.
 
Last edited:
If that's a monster mafia knows about, shouldn't it say "The Ghost of Fernswarthy's n great-grandfather"?
No, we log the actual name of a basement monster (or a hobo) in the session log as the "Encounter", but use the normalized, shortened, name in the "Encounters" tab or for use by CCS or consult scripts.
 
Back
Top