BatBrain -- a central nervous system for consult scripts

Good to know, thanks Bale! I reread the sticky thread about SVN but saw nothing there to indicate the situation had changed. Perhaps a note there would be helpful to others who also remember old information. (This is, I suppose, the danger of sticky threads.)

Ewwww. Thanks for pointing that out. On rereading the thread there are indeed several posts explicitly warning against updating svn or else it won't work with mafia. I posted an update to avert that ancient admonition.
 
Something is not working right, I get this new error after updates:
Expression syntax errors for 'modifier_eval()':
Expected end, found )) (zlib.ash, line 188)
 
It was a batfactors error. There was some bonus whitespace in the formulas for Pungent Mung and Lavafava.

I fixed batfactors just now and it is working for me now.
 
It was a batfactors error. There was some bonus whitespace in the formulas for Pungent Mung and Lavafava.

Thanks Bale! Fixed for me too. I was thinking it was a batfactors error somewhere, but did not have time to track it down.
 
A question on the handling of encounters in the Fun Guy Mansion. This happened this morning:

Code:
[843] The Fun-Guy Mansion
Encounter: Miss Aril, Stropharia Brown
Round 0: Arbos wins initiative!
> WHAM: Running SmartStasis
> WHAM: Starting evaluation and performing of attack
> WHAM: We are going to 1-shot with grody jug.
Round 1: Arbos executes a macro!
Round 1: Arbos uses the grody jug!
Round 2: Fun-Guy Playmate takes 128 damage.
Round 2: You lose 36 hit points
> WHAM: Starting evaluation and performing of attack
> WHAM: We are going to 2-shot with Summon Love Mosquito and throwing fork.
Round 2: Arbos executes a macro!
Round 2: Arbos casts SUMMON LOVE MOSQUITO!
Round 3: Fun-Guy Playmate takes 1 damage.
Round 3: You gain 1 hit point
Round 3: Arbos uses the throwing fork!
Round 4: Fun-Guy Playmate takes 1 damage.
Round 4: Fun-Guy Playmate takes 1 damage.
Round 4: Fun-Guy Playmate takes 1 damage.
Round 4: You lose 12 hit points
> WHAM: Starting evaluation and performing of attack
> WHAM: We are going to 1-shot with throwing fork.
Round 4: Arbos executes a macro!
Round 4: Arbos uses the throwing fork!
Round 5: Fun-Guy Playmate takes 1 damage.
Round 5: Fun-Guy Playmate takes 1 damage.
Round 5: Fun-Guy Playmate takes 1 damage.
Round 5: You lose 37 hit points
> WHAM: Starting evaluation and performing of attack
> WHAM: We are going to 1-shot with throwing fork.
Round 5: Arbos executes a macro!
Round 5: Arbos uses the throwing fork!
Round 6: Fun-Guy Playmate takes 1 damage.
Round 6: Fun-Guy Playmate takes 1 damage.
Round 6: Fun-Guy Playmate takes 1 damage.
Round 6: You lose 37 hit points
> WHAM: Starting evaluation and performing of attack
> WHAM: We are going to 1-shot with love song of vague ambiguity.
Round 6: Arbos executes a macro!
Round 6: Arbos uses the love song of vague ambiguity!
Round 7: Fun-Guy Playmate takes 1 damage.
Round 7: You gain 5 hit points
Round 7: You lose 12 hit points
> WHAM: Starting evaluation and performing of attack
> WHAM: We are going to 1-shot with love song of vague ambiguity.
Round 7: Arbos executes a macro!
Round 7: Arbos uses the love song of vague ambiguity!
Round 8: Fun-Guy Playmate takes 1 damage.
Round 8: You gain 5 hit points
Round 8: You lose 37 hit points
> WHAM: Starting evaluation and performing of attack
> WHAM: We are going to 1-shot with love song of vague ambiguity.
Round 8: Arbos executes a macro!
Round 8: Arbos uses the love song of vague ambiguity!
Round 9: Fun-Guy Playmate takes 1 damage.
Round 9: You gain 5 hit points
Round 9: You lose 12 hit points
> WHAM: Starting evaluation and performing of attack
> WHAM: We are going to 1-shot with love song of vague ambiguity.
Round 9: Arbos executes a macro!
Round 9: Arbos uses the love song of vague ambiguity!
Round 10: Fun-Guy Playmate takes 1 damage.
Round 10: You gain 5 hit points
Round 10: You lose 13 hit points
> WHAM: Starting evaluation and performing of attack
> WHAM: We are going to 1-shot with love song of vague ambiguity.
Round 10: Arbos executes a macro!
Round 10: Arbos uses the love song of vague ambiguity!
Round 11: Fun-Guy Playmate takes 1 damage.
Round 11: You gain 5 hit points
Round 11: You lose 35 hit points
> WHAM: Starting evaluation and performing of attack
> WHAM: We are going to 1-shot with love song of vague ambiguity.
Round 11: Arbos executes a macro!
Round 11: Arbos uses the love song of vague ambiguity!
Round 12: Fun-Guy Playmate takes 1 damage.
Round 12: You gain 5 hit points
Round 12: You lose 13 hit points
> WHAM: Starting evaluation and performing of attack
> WHAM: We are going to 1-shot with love song of vague ambiguity.
Round 12: Arbos executes a macro!
Round 12: Arbos uses the love song of vague ambiguity!
Round 13: Fun-Guy Playmate takes 1 damage.
Round 13: You gain 5 hit points
Round 13: You lose 12 hit points
> WHAM: Starting evaluation and performing of attack
> WHAM: We are going to 1-shot with love song of vague ambiguity.
Round 13: Arbos executes a macro!
Round 13: Arbos uses the love song of vague ambiguity!
Round 14: Fun-Guy Playmate takes 1 damage.
Round 14: You gain 5 hit points
Round 14: You lose 13 hit points
> WHAM: Starting evaluation and performing of attack
> WHAM: We are going to 1-shot with love song of vague ambiguity.
Round 14: Arbos executes a macro!
Round 14: Arbos uses the love song of vague ambiguity!
Round 15: Fun-Guy Playmate takes 1 damage.
Round 15: You gain 5 hit points
Round 15: You lose 12 hit points
> WHAM: Starting evaluation and performing of attack
> WHAM: We are going to 1-shot with throwing spoon.
Round 15: Arbos executes a macro!
Round 15: Arbos uses the throwing spoon!
Round 16: Fun-Guy Playmate takes 1 damage.
> WHAM: Starting evaluation and performing of attack
> WHAM: We are going to 1-shot with throwing spoon.
Round 16: Arbos executes a macro!
Round 16: Arbos uses the throwing spoon!
Round 17: Fun-Guy Playmate takes 1 damage.
Round 17: You lose 13 hit points
Round 18: Arbos casts BEANSTORM!
Round 19: Fun-Guy Playmate takes 1 damage.
Round 19: Fun-Guy Playmate takes 132 damage.
Round 19: Arbos wins the fight!
After Battle: You gain 13 hit points
After Battle: You gain 9 Mojo Points
After Battle: Albrecht Von Umweltverschmutzung gives you an invigorating brain-freeze with the snow suit.
After Battle: You gain 7 Mojo Points
After Battle: +1 carp (to Clan Floundry)
After Battle: Albrecht Von Umweltverschmutzung finishes a story without any heavy-handed moralizing in it, and smiles at his success. (+10 Stats)
After Battle: You gain 11 Strengthliness
After Battle: You gain 28 Magicalness
You gain a Mysticality point!
After Battle: You gain 41 Chutzpah

When I noticed that it was spamming "love song of vague ambiguity" doing 1 damage each time I finished the fight manually. This was only about fifteen fights in on the zone and I'm used to Batbrain/Wham handling far more fights.

I didn't think to capture the turn-on and turn-off values for the encounter but I'm willing to assist with figuring out where the problem lies. It will be a few days before I can ascend and try again.

Any ideas on what to look for?
 
Any ideas on what to look for?
Since unknown turn-off are reported (at -3 and above), it is likely a turn-off that's in the wrong category. In BatBrain.ash, starting after the line "case $monster[Fun-Guy Playmate]:" you can find the coding for those. Based on your log, I believe something should be under physical resistance (setmatt("res","1");), but is in another category.
 
Thanks Bale! Fixed for me too. I was thinking it was a batfactors error somewhere, but did not have time to track it down.

Yah, batfactors eval() errors can be really tough to find. They only appear if the users actually has the skill or item and there's basically no way to get good feedback from the script about what triggered the parsing error. I told eval() to print out whatever it is working with and at the bottom it said "50))" which fortuitously for me appeared only 3 times in batfactors.
 
zarqon, I think I just spotted an error in your implementation of sixgundmg.

It is equal to the base damage of the sixgun, PLUS ranged damage. You didn't include ranged damage, so...

Code:
   if (my_class().to_int() > 17 && my_class().to_int() < 21) fvars["sixgundmg"] = numeric_modifier(equipped_item($slot[holster]), "Sixgun Damage") + numeric_modifier("Ranged Damage");
 
zarqon, I've been using your new BatBrain update for my current AWoL ascension and it is making things soooo much easier. I had all these ad-hoc rules to determine which skills to use in combat instead of the way I've gotten used to enjoying BatBrain. Finally my combat script has returned to being simpler, more reliable and more effective. (I am using the fix for sixgun damage listed above.)

Thank you!


Edit:
@Bale: I think I remember why I didn't want to add a "once" field -- it was a design consideration to encourage certain algorithm types over others. If you are using BatBrain as intended, you don't deal with specific ID names and instead enqueue or perform actions based on results criteria, and once-only items will not be present in opts[] if you have either performed or enqueued the action. But as it happened, SS needed to know the once information to avoid submitting with repeats. I'll sit on this a bit more, but I'm close to being persuaded.

I'd like to urge you again to do this. At first I explicity include a few staggers (like Love Mosquitos) and then after I sort opts and choose an attack, sometimes Love Mosquitos is suggested. Because of that I have to explicitly remove it from consideration based on being a "once" skill.
 
Last edited:
After choosing your actions, you don't then enqueue or perform them? Doing so would effectively remove "once" actions from your options.

Oh, also r91 adds the ranged damage modifier. I edited for syntax, good to have others editing for content. :)
 
I do enqueue Love Mosquitos. Do I have to do something else to make it disappear from opts after enqueueing?
 
Options are rebuilt after enqueueing, meaning that Mosquitos should be absent from opts after enqueueing it. If your experience differs, that could indicate a (non-mosquito) bug.
 
I've never really thought about that before. I"m looking over the code now.

enqueue() calls buld_options() which calls build_skillz(). Then in build_skillz() - > add_skill() I see, if (contains_text(fields.special,"once") && happened(thisid)) return; which looks pretty solid. I don't see a problem in batfactors either so I cannot imagine how enqueue($skill[Summon Love Mosquito]); could fail to remove it from opts.

equeue() also calls set_happened() which clearly should set the correct value in happenings to be detected in happened().

I'll try to debug the Love Mosquito in the future and maybe I'll figure something out.
 
Last edited:
I just learned that April 17th is Bat Appreciation day! That was yesterday. I'm shocked and appalled that I didn't learn that until a day late, but have a belated bat.

D6dY5Vg.gif
 
I've noticed two things about how Batbrain handles AWOL:

- Batbrain seems to enqueue the use of the Hogtie skill, for a stun, even when other options are available, regardless of the opponent. Hogtie only works against enemies that have legs. Is that information even available in the monster proxy record?

- Against monsters that hold goal items Long Con is queued every time the monster is seen. Long Con should only be cast once against a given monster. It's limited to five casts per day and lasts until it is cast against a different monster. The effect even persist through rollover.

The second was particularly sad to see when all five casts were used in the space of ten seconds, against the same monster, of automated adventuring.
 
Last edited:
Long Con should be flagged "custom" in batfactors to prevent 2). This is a change that anyone can make.

No idea what to do about 1). This is the first time monster body parts have been relevant to combat decisions, so there is 0 framework in place for that, both on mafia's side and this script's.

Also WHAT BAT APPRECIATION DAY?! FABULOUS. If only the date were a palindrome.
 
Back
Top