BatBrain -- a central nervous system for consult scripts

Bale

Minion
No, I meant 923 because, contrary to appearances, I was not talking to you or zarqon.

I was actually giving the line number that would be helpful to anyone who reads this thread and wants to improve their copy of BatBrain, but needs help to follow zarqon's instructions. :) That's also why I reiterated zarqon's line of code with the added parameter for dmg_dealt().

In other news, you are a formatting fiend! :eek:
 
Last edited:

Winterbay

Active member
Totally understood :)

And yes, my version of BatBrain is very differently formatted but it makes it so that I can read the code without having to think too much about what is there which I find really nice.

On topic: The problem I had was that the script aborted when I got poisoned rather than using an antidote to cure me despite the fact that the poison was the first thing that happened in that fight, meaning that batbrain really should've fixed it when act() got called. I've got no idea why it didn't. I'll see if I can add a call in my own macro to remove the poison before batbrain aborts :)
 

Bale

Minion
Oooch. I got a bug to report with the new mistletoed code: Shieldbutt is not a disco bandit skill.

I think you need to actually check if $strings[skill 61, skill 5021, skill 5003, skill 5005, skill 5008, skill 5012, skill 5019] contains a.id since there is no other way to be sure that a current or future skill won't tigger your current terms. There is even a current skill (Offensive Joke) that isn't in the 5000 sequence so there isn't any simple method.
 

Winterbay

Active member
I think the point was that even if you cast stealth mistletoe before a skill with which it doesn't work it only costs you 5MP (it's a quick action, so you won't lose a round on it) and thus with such a small cost it can be used before each delevelling skill without very much problem.
 

slyz

Developer
Also, the n-n-n => n/n/n issue is a batfactors issue
In that case, line 840:
PHP:
if (have_effect($effect[everything looks red]) > 0) fields.special = "stats "+(4.5*fvars["fweight"])+"-"+(4.5*fvars["fweight"])+"-"+(4.5*fvars["fweight"]);
should be:
PHP:
if (have_effect($effect[everything looks red]) > 0) fields.special = "stats "+(4.5*fvars["fweight"])+"/"+(4.5*fvars["fweight"])+"/"+(4.5*fvars["fweight"]);
 

zarqon

Well-known member
I'd explained that casting Mistletoe is harmless -- it could ostensibly be performed at the beginning of every combat just for giggles -- so it's unnecessary to detect if it's preceding an actually relevant skill. With macrofication it doesn't add a server hit either. So I just filtered the actions to deleveling actions which cost MP. However, I was overlooking the MP cost, which at lower levels could really bother people and in any case is suboptimal.

*sigh* Ok, I'll filter it properly; s.class == $class[disco bandit] && s.level >=0 ought to do it. Should also skip if you don't have enough MP for both that and the subsequent action.

Take your time on that mood; presently BatBrain tracks the hipster's stat action but it doesn't actually mean anything.

And, an even better sort for stasis_action() is:

sort opts by -min(kill_rounds(value),maxround - round + 3);

This includes other sources of damage (attack familiar, cups of pencils, etc) in determining the monster's survivability for a given action.

@Winterbay: I had something weird happen with poison too. I added some more debug statements but haven't come across the issue again yet.

ETA: @slyz: Yes.
 

Bale

Minion
Ah, of course. I forgot about the proxy record.

And, an even better sort for stasis_action() is:

sort opts by -min(kill_rounds(value),maxround - round + 3);

This includes other sources of damage (attack familiar, cups of pencils, etc) in determining the monster's survivability for a given action.

You would use that in place of the current line 923, or is that an additional sort?
 

jwylot

Member
However, this gives me an idea. I think I'll rework the stasis_action() sort to consider all actions that would never kill the monster equal in terms of damage -- rather than sort by dmg_dealt() as our final criterion, sort by max(dmg_dealt(), monster_stat("hp") / max(1,maxround - round) + 5). That 5 is there as a little cushion against damage range swing.
That would be totally awesome. Thank you zargon.
 

Bale

Minion
Today I was pleasantly surprised when SS began to use my spectre scepter to stasis with! Yay for free heals and delevels. I am using this:

Changed line 923 to

sort opts by max(dmg_dealt(value.dmg), monster_stat("hp") / max(1,maxround - round) + 5);

I really, really like SS in my current Seal Cubber run. It's a shame that the current BatBrain is causing new bugs for other people.
 

Winterbay

Active member
Question: Is it expected to be up to a writer of a consult script to skip past the two versions of Thrust-Smack when you have a ranged weapon equipped or should batbrain handle that? (my spamattack crashed because it tried to use Thrust-Smack with a BHH-rifle)
 

Winterbay

Active member
The buzzerker is also immune to multi-round stuns (such as noodles) as I got aware of today when I got beaten up by using Noodles and getting attacked :)
 

zarqon

Well-known member
Oh yes, the ranged Smacks. It would be best if KoL itself didn't include impossible options, but since it does, it's up to BatBrain to filter those out. Making the hitchance 0 is an attractive way of doing that, however it evidently doesn't just do nothing, it generates an error. So BB should filter ranged smacks out of opts[] entirely.

And, I'll add the buzzerker to the multistun-immune list. Have I made a feature request for multistun-immune in monster proxy records yet? I'll have to check.

@Bale: You also forgot that Tango of Terror and Offensive Joke don't get enhanced by Mistletoe. :) And try replacing that sort with the kill_rounds() one -- it will be more accurate in situations where you have other sources of damage.

The next update will include this improved stasis action selection, and it will add deleveling to to_profit() by comparing m_dpr() before and after deleveling, times meatperhp. This will allow us to remove the first sort from stasis_action(), which was added because SS had been preferring a seal tooth over a free Suckerpunch.
 

Bale

Minion
@Bale: You also forgot that Tango of Terror and Offensive Joke don't get enhanced by Mistletoe. :) And try replacing that sort with the kill_rounds() one -- it will be more accurate in situations where you have other sources of damage.

Wrong. I can personal guarantee that Tango of Terror is enhanced by Mistletoe since I do that all the time. I haven't tried it with Offensive Joke, but the wiki says it works. I'll have to test it to check.
 

zarqon

Well-known member
I was going to quote the Wiki at you where I read that, but the "not" which I swore I read there previously was missing. :) Must be getting old. Anyway, then s.class == DB is all that's needed for filtering. Easy!
 

Bale

Minion
Personally tested this so that you can be sure of accurate information. To paraphrase Veracity's recent comment, "The wiki sucks!" I've changed that page to be correct.

It appears that Offensive Jokes do not benefit from a peck on the cheek, unsurprisingly. However Spooky Tangos do benefit from a surprising kiss.
 

xKiv

Active member
Yes, I think "somebody" (let's not point fingers at page hsitory) just added Offensive Joke to the wrong line, and then "somebody else" fixed wrong part of that edit (or to and, instead of line). But I wasn't sure - I mean, I wasn't getting the kiss message, but maybe it just got lost? I was not in position to test actual ML decreases ...
 

Bale

Minion
Yes, I think "somebody" (let's not point fingers at page hsitory) just added Offensive Joke to the wrong line, and then "somebody else" fixed wrong part of that edit (or to and, instead of line). But I wasn't sure - I mean, I wasn't getting the kiss message, but maybe it just got lost? I was not in position to test actual ML decreases ...

Testing actual ML decreases is easy. KoL gives messages stating how much monster attack and defense are reduced. I -LOVE- that KoL update. Once upon a time it was hard to figure out how much ML was decreased. Now you just cast the skill and let KoL tell you.

I suspect that this is because the skill number for Offensive Joke isn't in the 5xxx sequence.
 

Theraze

Active member
Any ideas why BatBrain apparently says that Fearful Fettucini is the perfect spell for killing a huge ghuol, a spooky monster?
SpamAttack: Monster HP is 113.0.
SpamAttack: We are going to 1-shot with Fearful Fettucini.
Round 2: Theraze executes a macro!
Round 2: Theraze casts FEARFUL FETTUCINI!
Round 3: huge ghuol takes 1 damage.

It decided the damage done based on this string:
Code:
  kill_it[possible].hp = base_hp - dmg_dealt(myskills[n].dmg) - (m_hit_chance()*dmg_dealt(retal.dmg) + dmg_dealt(baseround().dmg));
Is skill.dmg the wrong value to pass in for dmg_dealt?
 

zarqon

Well-known member
1.9 Updates!

Should have fixed most of the issues mentioned lately, with the exception of variable tracking on fights that don't consume adventures:

  • "occurrence"
  • Buzzerker can't be multi-stunned.
  • Add deleveling to to_profit() -- the profit of deleveling is the difference between the monster's damage before and after deleveling, times meatperhp.
  • When choosing a stasis action, consider all actions which will never kill the monster equal in terms of damage.
  • Filter out smacks when wielding a ranged weapon, since evidently KoL doesn't.
  • Add appropriate "hascombatitem" and "hasskill" conditions to all repeats. Should fix a lot (all?) of the issues caused by SS's recent more permissive stasis repeat conditions.
  • Mistletoe will only be inserted automatically before deleveling DB skills (thus not itself), and only if you have enough MP for both Mistletoe and the DB skill being enqueued.
  • Use eval() on the stat bits rather than just to_int(), since this will probably be necessary for some stats-granting actions. Further, use n|n|n for stats rather than n-n-n or n/n/n, since both - and / could be used in a formula. This will require some edits to batfactors, which I'll get to later unless someone else beats me to it.

Now, let's see what I broke this time. :)

Theraze, will look at your issue soon. At the moment I have no idea. Is there some reason you're not using kill_rounds()?
 

Theraze

Active member
It's used to decide which, of all of the skills available, up to 10 rounds, will kill the cheapest. That was just the first round... each round gets the skills added. It's the (somewhat modified) version of spamattack that I posted including my modifications to Winterbay's sauceslinging spamattack system. :) If that amount is the post-resistance version, I have no idea why it's doing that. If it's the raw number... there should be some way to get the proper one out, right?
 
Top