I wanted to say thank you very much for ASH. It's pretty awesome. I'm still smarting from the effects of rev 3883 but I've filed the appropriate bugs in the tracker about it.
Here's what I've been working on. I'm going to present it as pure concept for now, so you can take it as a challenge if you would like to try your hand at it.
Concept: The ultimate fight consult script.
Summary: Upon entering combat, the script considers all possible courses of action and picks the optimum one. ;D
Details: The goal is to win the battle with minimal resource loss. Since it's a fight consult script, it has to play the cards as they are dealt and can't change the player's equipment or cast buffs. It should take into account all available skills, active effects, and equipment bonuses. For example, a monster might be killed by a chain of Entangling Noodles, Stream of Sauce, Stream of Sauce (9MP) or just one Lunging Thrust-Smack (8MP). The LTS may be more efficient normally. But if you're operating under Dreams and Lights, the calculation changes ... it's now 3MP vs 5MP, and the spells become the most efficient way to kill the monster.
Suggested Implementation: Don't hard-code just a few strategies. Really consider all the possible courses of action! Create functions which determine the minimum amount of damage that can be inflicted by each action. (Be pessimistic; it's better to underestimate than overestimate and lose.) You'll probably need a simulator which exercises each course of action to see (a) whether it works, and (b) what its cost is. Cost is probably best represented as meat ... every strategy can be boiled down to its total cost in HP/MP, and a HP/MP cost can be converted down to a meat cost if you know the player's access to restorers. Obviously the search space of all possible strategies is, uh, rather large. So you'll need to come up with clever ways to prune it so that the script runs in about half a second or less.
Bonus Points: If your script can steal, delevel, handle monster level variance, consider Disco Combos, and deal with Cunctatitis/fumble/block. Double bonus if it does a good job with the Bonerdagon. Triple bonus for the Naughty Sorceress. ;-)
It's ambitious, but ... it's definitely possible. I did it and I've been using it for about a week. On my 2GHz laptop it runs in much less than half a second, even with my 40+ ascension character who has a ton of skills to consider.
I'll post my script soon. I'm still tweaking it to be better at melee actions: it tends to underestimate damage too much right now. Besides, it's an interesting challenge and I'm curious to see other people's approaches to the same problem. ;D
My script doesn't do stasis yet -- I considered adding it, but with NS13 looming I figured I'd wait to see what changes are made before wasting a bunch of time. I also don't handle item use, and I tried but disabled in-combat healing. (It's rarely useful and expands the search space exponentially.) My version also decides on its course of action before combat and doesn't change strategy after that. Spells are easy to predict accurately, but melee actions still need work -- my script is too pessimistic most of the time. So my next task is that I'm going to explore dynamically adjusting the strategy based on actual damage dealt.