StDoodle's recoveryToggle.ash

StDoodle

Minion
This is a fairly simple script to toggle mafia's recovery functionality.

It makes use of a custom property, "recoveryToggle", which is saved under your user preferences.

If this preference is blank, this means your recovery is currently considered "ON" at your specified settings. They are then saved to the preference, and both hp & mp are set to "do not recover" and the targets are set to 0% (so that if you cast spells and mafia restores to do so, it doesn't restore more than needed for said casting). It will then report on the cli that recovery is now "OFF".

If the preference has data which is properly formatted for the script, your recovery is assumed to be "OFF" currently. The script will reload your saved preferences, blank out the "recoveryToggle" preference, and report that your recover is now "ON".

If, for whatever reason, the data in "recoveryToggle" is not blank, but isn't properly formatted, the script will abort with an error message, without changing any settings (except to wipe the saved data).

Note that this script also blanks out the preference for "recoveryScript" when turning "OFF" recovery and reloads it to the previous value when turning "ON".

CAVEAT

KoLmafia's recovery pane does not update when these preferences are changed, so you can't rely on what's shown there after directly changing the preferences on the cli or via a script. If you need to know what the current settings are, you may need to call the script & have it tell you.

Recommendation


I recommend creating an alias for this script. I personally used:
Code:
alias toggle => call scripts\recoveryToggle.ash

Additional Note

This script does NOT change mana-burning settings. I can't particularly see a great use in it doing so, but if the majority of (vocal) users request it, I'd be happy to add that.
 

Attachments

  • recoveryToggle.ash
    1.4 KB · Views: 63
Last edited:
Top