Feature Minor change to ash maximize detailed function output

soolar

Member
Hi! I'm working on a script that uses the record output of the maximize function to provide an in browser interface to the mafia maximizer, for a tiny QoL benefit to myself.

That said, I'm running in to some (admittedly minor) limitations: There does not seem to be any way to determine how long the effect is going to last from this data, except when the data includes a skill (in which case you can use turns_per_cast or an item (something with modifiers). But when it's a cli command (friars food or alliedradio effect boon, just to name a couple) there is absolutely no way to know unless I hardcode in a list for every one of these commands. I'd like to display the turn duration, but not if that's what it takes.

So basically, what I am requesting is one of two things: Either add a "duration" field to the record that is returned from the maximize function when used with all the parameters, or update the "display" field of that record to show the full line of text (including cost, uses remaining, duration, etc when relevant). I'd actually prefer the latter. Or maybe a new field that is a string that is what would go in the brackets in the line of text, since the rest of the line is easy enough to deduce.

EDIT: It would also be nice to somehow be able to access the "current score" that the maximizer displays. This could be via another function that I've always kinda wanted, something like "evaluate_modifiers(string mods)" which evaluates a maximizer query and spits out your current score.
 
Last edited:
Score should be exposed from the simulated maximizer command:
> {string display; string command; float score; effect effect; item item; skill skill;} [0] maximize( string maximizerStringValue, int maxPriceValue, int priceLevelValue, boolean isSpeculateOnlyValue, boolean showEquipment )

duration, uses, cost etc. are displayed based on the values you select: only with the preference "verboseMaximizer" set to "true" are any of these dispalyed, cost is not displayed if your max price is "don't check", etc.

You can access partial scores using the "Generated:_spec" lookup, e.g.

> ash maximize("init", 2500, 0, true, true); numeric_modifier("Generated:_spec", $modifier[Initiative])

Maximizer: init
Loading character status...
Maximizing...
40 combinations checked, best score 186.00
Returned: 186.0

You might want to look into autoscend's code, that uses a lot of these features.
 
Back
Top