How to have a combat script/macro abort if a battle isn't finished fast enough?

I typically go with an extremely basic macro for combat, just attacking normally or using a basic spell a few times in a row until the monster dies. This is okay for practically everywhere, but some zones have monsters which behave differently than others in the zone, and sometimes I forget that they're there. So I'll tell Mafia to adventure in a zone for X adventures, but it'll abort after Y adventures because I got beaten up, because I forgot to account for a monster (or some other factor). I'd like it to abort automatically and prompt for manual input after a certain number of combat rounds if the battle hasn't yet been won; if I haven't killed a monster after 3-4 rounds then something is definitely not right. But even when I have the macro set up to attack three times in a row, it doesn't do just those three attacks and aborts, it keeps trying over and over. I can check the CLI and see that it tried to attack 19 times in a row or even longer before the monster beat me up. So how can I have it try a certain number of attacks in a row, and if the fight isn't over yet, abort?

Actually, come to think of it, is there a way to do like a branching tree macro or whatever it's called? Try three attacks in a row, and if the fight isn't over then use a specific skill or combat item or whatever?

The TL;DR is the title of the thread.
 

ckb

Minion
Staff member
Ae you using KoL combat macros?

If so, you can add aborts to the start of your macro, something like:
Code:
"abort hppercentbelow 20; abort pastround 11; "
 

Crowther

Active member
I don't use KoL's combat macros, just Mafia's CCS. There if you put three attacks and it hits the bottom of your script it just repeats the last line. If you really only want three attacks and then to stop, you say so by adding an abort after the three attacks.
 
Ae you using KoL combat macros?

If so, you can add aborts to the start of your macro, something like:
Code:
"abort hppercentbelow 20; abort pastround 11; "
I use the combat macros from within KoL itself, yeah. The system seemed simpler to use than what Mafia has. I wasn't aware there were abort conditions, so that's great, that sounds like exactly what I'm hoping for!

An additional question; is there a way that Mafia can detect whether an attack is being effective or not, and adjust accordingly? Let's say that I'm early on in a run and don't have any elemental damage (this really would never happen, but just for the sake of this example), and go up against a ghost. Can you program it to do a physical attack, and if the damage amount is below a specific threshold, use a skill instead of doing another basic attack?

I know I can just have a macro do, say, three basic attacks and then switch to a skill, so that anything left alive after the three attacks should be taken down by the skill, but I'm just curious if the damage detection thing is even possible. I don't even need an explanation of how you might do it, I'm literally just curious if it's even possible.
 

Crowther

Active member
An additional question; is there a way that Mafia can detect whether an attack is being effective or not, and adjust accordingly? Let's say that I'm early on in a run and don't have any elemental damage (this really would never happen, but just for the sake of this example), and go up against a ghost. Can you program it to do a physical attack, and if the damage amount is below a specific threshold, use a skill instead of doing another basic attack?
That could be done, but it would require a consult script.
 

ckb

Minion
Staff member
A consult script would be the most detailed and effective way to do it, but you could do something that gets part of the way there with BALLS (KoL) macros.
You can check 'missed' or 'monsterhpabove' or 'monsterhpbelow'
 
Okay, cool. I doubt I'll ever need to do that, but I just like knowing things are possible. =P For now I'll just stick with a simple conditional abort.
 
Top