How to have Mafia keep automating even when it can't recover enough MP to recast buff

Is there some script or Mafia functionality that I could utilize to make it keep adventuring even when a buff has run out of turns, and it can't restore enough MP to recast the buff? I typically run with MP-restoring familiars, so I don't mind adventuring for a few turns without buffs while I regen enough MP to recast it automatically. But currently, it keeps stopping, and it's quite annoying.

Additionally, it's overriding my mana burning rules under the HP/MP usage tab, to recast an expired buff as soon as there's enough MP to do so, rather than waiting for the specified "start recasting at x%" option. How can I get it to stop doing this?
 

xKiv

Active member
Is there some script or Mafia functionality that I could utilize to make it keep adventuring even when a buff has run out of turns, and it can't restore enough MP to recast the buff?

Possibly: edit the command used to maintain the buff, and prepend a "try; ".

Additionally, it's overriding my mana burning rules under the HP/MP usage tab, to recast an expired buff as soon as there's enough MP to do so, rather than waiting for the specified "start recasting at x%" option. How can I get it to stop doing this?

Isn't "start recasting" for mana burning? Those are two different mechanisms doing very different things. Mana burning is for spending excess mana on prolonging the effects you already have, moods are for making sure you don't run out of specified buffs.
If you want to have mood-like mana burning, you should probably write your own script that handles the logic entirely as you like, and put it in your mood under unconditional trigger.
 
Possibly: edit the command used to maintain the buff, and prepend a "try; ".
I don't know how to do this, could you provide simple instructions if at all possible? Thanks in advance!


Isn't "start recasting" for mana burning? Those are two different mechanisms doing very different things. Mana burning is for spending excess mana on prolonging the effects you already have, moods are for making sure you don't run out of specified buffs.
I don't quite get what you're saying, here. As far as I know, the mana burning drop-down menus under the HP/MP Usage tab are what control the buffs specified in the mood setup tab. If I have 100 max MP, and I have one buff that takes 1 MP to cast in my mood, and I specify mana burning to start recasting at 85%, and cast down to 50%; if I have all that, when I auto-adventure with Mafia, it won't cast the buff until I regenerate to at least 85 MP, and then it will cast the buff 35 times. It will continue to repeat this behavior until I have (by default) 1,000 turns of the buff queued, and then it won't recast the buff until I run below 1,000 turns. That's just what I've observed through experimentation with the program, I don't know if it's supposed to work some other way, or if there's some underlying principle behind the mechanism that I haven't divined.

To elaborate more on what's currently happening, and what I'd like to have happening: early on in my runs, now that I've got a lot of buffs permed, it's easier to leave the same mood active, and not worry about manually introducing buffs as I adventure. So, let's say I have a mood with 10 different buffs. Since it's early on in the run, my familiar is low-weight, and doesn't regenerate as much MP as it does on after it's bulked up a bit. So I might not actually be regenerating enough MP to keep all the buffs up at once (but I don't really care, because it's still early in the run and none of them are essential for survival). When a buff completely expires, Mafia will prioritize getting it back, even if it means casting it will put my MP below the specified "recast buffs down to %" value, which can be a pain when I'm a spellcasting class using a spell macro, and I suddenly don't have enough MP for it.

So if at all possible, I'd like for Mafia to:
1. Not recast buffs in a mood, even if they're completely expired, until I hit the "recast at % threshold"
2. Keep automating even if a buff in a mood is completely expired

If neither of those things are possible or easy to implement, then that's fine, I'll just have to create more mood presets and change between them more often, which is annoying, but not the end of the world. I'm mainly posting here to find out whether it is possible at all.

If you want to have mood-like mana burning, you should probably write your own script that handles the logic entirely as you like, and put it in your mood under unconditional trigger.
I don't have the slightest idea how to create scripts, sorry. :/
 

xKiv

Active member
I don't know how to do this, could you provide simple instructions if at all possible? Thanks in advance!

Umm ... in the custom combat tab, (in the part that lists all the buffs in your mood) click on the row that has a buff. Now, above, there are input fields for "trigger on", "check for", and "command". Click in "command", put a "try ; " (without the quotes, but with the semicolon) at the start, press enter.

I don't quite get what you're saying, here. As far as I know, the mana burning drop-down menus under the HP/MP Usage tab are what control the buffs specified in the mood setup tab. If I have 100 max MP, and I have one buff that takes 1 MP to cast in my mood, and I specify mana burning to start recasting at 85%, and cast down to 50%; if I have all that, when I auto-adventure with Mafia, it won't cast the buff until I regenerate to at least 85 MP, and then it will cast the buff 35 times. It will continue to repeat this behavior until I have (by default) 1,000 turns of the buff queued, and then it won't recast the buff until I run below 1,000 turns. That's just what I've observed through experimentation with the program, I don't know if it's supposed to work some other way, or if there's some underlying principle behind the mechanism that I haven't divined.

Those are two separate mechanisms that happen to trigger one after another, and interact slightly.
Moods are supposed to be a strict "if you are about to lose this buff, execute that command to extend the buff".
Mana burning is "if you have a lot of MP, use it to extend any buffs you happen to have (up to 1000+whatever your current remaining adventures are).

So what probably happens is that your mood makes sure you have the buffs in the first place, and then mana burning extends them (if you have a lot of MP left after the mood is done).

I don't have the slightest idea how to create scripts, sorry. :/

You can also select "trigger on"=unconditional trigger, and (something like) command="ash if (have_effect($[pasta oneness]) < 10 && my_mp() > 100) { use_skill(30, $skill[manicotti meditation]); }" (fill in your own effects, mp limits, numbers of casts, and skills)
 
So far, I think the "try ;" addition to the command line for buff recasting appears to be functioning the way I'd like it to. I'm about to ascend, though, so I'll see how it goes in those first few levels.
 
Yes, this looks like it's working quite well! It's still automating even when it can't restore enough mana to recast a buff, which is exactly what I wanted it to do. Thanks again for the help!
 
Top