How do I make mafia auto abort adventure automation when I get beatup?

taltamir

Member
I noticed that I get beat up during adventure automation in mafia, it just keeps on going. wasting turns getting repeatedly beat up (since i am already beat up my stats have -50% meaning i will get beat up again and again)

How do I make mafia auto abort the adventure tab automation when beatup status occurs?
 

taltamir

Member
thank you.
I added it to my mood and will try it out tomorrow when my adventures refresh

edit: Well, this method works to abort combat. However, it somehow also changed the method of healing beaten up by clicking on it (click to heal) into an "abort" command as well
 
Last edited:

taltamir

Member
Ok, I encountered a bigger method with this problem, and that is that the restore HP script no longer works when beaten up while this is selected. It tries to restore beaten up by casting abort. even though it was put in a mood and i didn't touch the HP restore script.

It also has to be manually redone each ascension. I get the feeling I am going to have to learn how to script and write a specific script for aborting and set it for after combat.
 

fronobulax

Developer
Staff member
If there is anything that is trying to cast abort (as opposed to execute the abort command) then there is almost certainly some corrupt data locally on your system.

You might step back and remind us exactly what you are trying to do. My goal is to not waste turns while Beaten Up. So my mood is set to uneffect beaten up (because I want to continue adventuring) and my recovery settings are such that they will automatically restore. Furthermore I can do this, without any scripts that I wrote, across Ascensions. But I am explicitly giving up control of what happens when I get beaten up or need restoration. Sometimes the character does not have enough meat to afford that so I have to trade automation for control.

It has been a while since I reminded myself of exactly what Abort does, but depending on the order of occurrence, I am not surprised that you Abort and then have to manually restore HP. So if you are concerned about abort and then not restoring HP you may have received incorrect advice - hence my question about what, exactly are you trying to accomplish?
 

taltamir

Member
If there is anything that is trying to cast abort (as opposed to execute the abort command) then there is almost certainly some corrupt data locally on your system.

You might step back and remind us exactly what you are trying to do. My goal is to not waste turns while Beaten Up. So my mood is set to uneffect beaten up (because I want to continue adventuring) and my recovery settings are such that they will automatically restore. Furthermore I can do this, without any scripts that I wrote, across Ascensions. But I am explicitly giving up control of what happens when I get beaten up or need restoration. Sometimes the character does not have enough meat to afford that so I have to trade automation for control.

It has been a while since I reminded myself of exactly what Abort does, but depending on the order of occurrence, I am not surprised that you Abort and then have to manually restore HP. So if you are concerned about abort and then not restoring HP you may have received incorrect advice - hence my question about what, exactly are you trying to accomplish?
My installation is not corrupted, the issue is with the workaround used.

I am trying to make the bulk auto adventure mafia thing abort when beaten up.
The only way suggested so far (which works btw) is to add a mood to perform the action "abort" when acquiring the "buff" called "beaten up".

However, using the above mood results in 2 negative consequences.
1. Clicking the "3 turns remaining" link at the buff list to "shake it off" will cast abort.

2. on manual adventure, the before battle restore HP script will abort if beaten up, with the option to click on the picture to continue which will continue without any healing at all.

While your method of setting the mood to auto remove beaten up (for example, by auto casting tongue of walrus). I do not have that skill permed so for me it is not an option. I need to decide if to use a free rest, a regular rest, or an item to remove it. Hence I want it to abort.
Honestly, this should be the default setting since if you are getting beaten up during auto adventures then you probably set up something wrong.
 

fronobulax

Developer
Staff member
My installation is not corrupted, the issue is with the workaround used.

The phrase "cast abort" does not accurately describe anything mafia was designed or expected to do. But there are circumstances where mafia will "cast X" where X is something mafia got from a data file. If mafia is really trying to "cast abort" as you said then a corrupt data file is a probable cause.

I couldn't reproduce your 2 or 3 but that just means I'm still not understanding you or there is some long forgotten setting that is different for me than you.

There is a trade-off between automation and customization and sometimes you can't get KoLmafia to give you both. Unless there is a real KoL bug behind some of your experience you just might not be able to get what you want.

You might consider writing up 2, 3 and your suggested change in defaults as Bug reports or feature requests. 2 and 3 might be working as designed but if other people can reliably reproduce them then there will at least be a discussion of why the design is the way it is.
 

taltamir

Member
The phrase "cast abort" does not accurately describe anything mafia was designed or expected to do.
I was not using a technical term.
Normally when you click on the time remaining time for an effect in the relay browser you attempt to "shrug it off" (according to tooltips) or otherwise remove it in an appropriate manner. This can be either a skill, free rest, or an item. I forgot about the fact that it isn't always a skill, and healing skills are basically spells, hence my use of the word "cast".

To be technical about it, using default mood to set
Code:
When I get Beaten Up, abort
results in:

1. if manually pressing the time remaining in relay browser then the tooltip will say
Abort to remove the beaten up effect
and clicking it will perform (in CLI)
Code:
[COLOR=red]KoLmafia declares world peace.[/COLOR]
This is the main issue. For some reason mood is overwriting the restore script in a weird way.
PS. try unchecking all options in HP/MP restore page. maybe they take precedence for you?
---
2. If using a script or the built in multi adventure mode, then the CLI will perform the following when you get beaten up.
Code:
Beaten Up will be removed via pre-defined trigger (abort)...
[COLOR=red]Script abort.[/COLOR]
It is the desirable action in this scenario... but the way it goes about it is implying some issues with the implementation. (it is trying to remove beaten up via a predefined trigger instead of "because the effect beaten up was gained, a predefined trigger will be performed "abort")
----
There is a trade-off between automation and customization and sometimes you can't get KoLmafia to give you both.

I am aware, that said, I believe that aborting automation when beaten up so that you can make adjustments is not beyond reasonable. That would clearly be a feature request. Initially I had just assumed that it was an existing feature that I simply didn't know about and was asking for help in turning it on.

However, there is a bug in the way that the mood is implemented. For some reason mood overwrites several other functions that it shouldn't automatically influence. It either treats "when an effect is gained" trigger as a "remove immediately using the chosen command" (assuming that the chosen command is a removal one). Or it hardcoded beaten up as a malus and treat any command that is triggered by it as a "remove using this thing". And in either case, its the mood setup that does that rather than HP/MP usage (which is what controls the restore HP script normally)

If this is fully intentional and there is no desire to change it, then "when an effect is gained" in the dropdown box in mood setup should really instead say "when a negative effect is gained, remove it"

And "when an effect is lost" should probably say "maintain these buffs" or some such.

... actually. I wonder if using unconditional trigger would work instead. nope, unconditional trigger just deletes whatever i try to input in the box for some reason...
 
Last edited:

lostcalpolydude

Developer
Staff member
Probably what you really need is a Pre-Adventure script that checks for Beaten Up and aborts. There's no way to use a mood without getting the undesirable side effect that you noticed.

Make sure "Run betweenBattleScript before manual adventures" is checked (Relay Browser section) if you're doing manual adventuring.
 

xKiv

Active member
Doesn't that ("stop automation at %%") also cause an abort? Which, you know, stops automation. Meaning, there is no more automation after that. It doesn't just stop a running script, it stops autoadventuring, moods, healing, everything.
Also, if you set it above 0%, it can stop automation while still in a fight. At that point, it can't heal anyway.
 
Last edited:

xKiv

Active member
Isn't this what they want though? The whole point was to manually do things when they got beaten up.

Oh. I must have gotten confused with who wanted what in this thread and reacted to something that does not even exist.

On a reread: I guess you shouldn't abort in a mood, because then anything you try might trigger the mood first, which will abort again?
 

taltamir

Member
You can try using the option in the HP/MP usage tab. "Stop automation" and set it to "Stop if health at 0%"
Since when you reach 0% you also get the beaten up effect.

https://i.imgur.com/3PYZSPC.png
That you very much. This method works great.
I don't know how I managed to miss that option before.

I still think there is something off about how mood affects the restore script and clicking on remaining turns.
But I can avoid the issue entirely now by using the method you suggested instead.
 

lostcalpolydude

Developer
Staff member
I still think there is something off about how mood affects the restore script and clicking on remaining turns.

Moods intentionally override the method of extending an effect in general, and I would guess for removing an effect as well. It isn't the most desirable result for this one effect, but in general it works out pretty well.

Perhaps I should have posted earlier clarifying that, to preempt some other posts.
 
Top