How to recognize critical hits in a consult script?


New member
UPDATE: I eventually realized that I had overshot my target; BALLS itself has a didcritical trigger that happily works fine for me.

Hi all, I'm just getting into in-combat consulting (and am not particularly adept at mafia coding generally), so apologies in advance if this is a dumb/easy question—I've searched around for a while to try to find an answer but haven't had any luck, so I'm hoping someone here can help me. I'm trying to write a consult script that takes a few initial actions and then attacks until a critical hit occurs (for pointer-finger-ring farming as a Sauceror), at which point it stops and turns combat back over to the CCS. I've tried two methods unsuccessfully:

I first tried to use contains_text(page, "negotiations") to recognize the crit text for the ring, but page wasn't actually including combat text; when I printed it to take a look, it only included the "You twiddle your thumbs" language. My (pretty uninformed) guess is that page only contains text from when the consult script is initially called; maybe I need to be updating it somehow?

Next I installed batbrain and tried out happened(crit) based on the documentation's suggestion that that's a thing, but it didn't work either. I don't know if this is related to why it didn't work, but at least in the gCLI it doesn't report a difference between regular attacks and crits, listing both as happened: attack.

Relatedly, if I can solve this crit trigger I'll also want to make a trigger for when my hobo monkey steals meat. Hopefully figuring out the first will also let me figure out the second, but if it's more complicated than that I'd also appreciate any advice here.

Any suggestions for how to get something like this to work? I appreciate any input!
Last edited: