Ah, that simplifies matters a great deal. I'd been thinking it would be rather tricksy due to Olfaction altering all percentages but combat rate modifier altering one percentage individually, and the others as a group. But this is much simpler. I should be able to add that in fairly quickly.
@Doodle: I've been thinking a lot about algorithms for sorting and optimally ordering possibilities (for some reason...), so in case you're interested, here's how I would script it. It's basically identical to my approach to BatMan -- get all the information available, remove unavailable possibilities, then reduce your remaining possibilities to a single number, sort, and perform the top action. Then repeat.
First, start with the basic idea of my Hardcore Checklist script. All of the actions are in an external data file on the Map Manager which can be expanded and tweaked by anyone. Each action contains, at minimum, the condition that must be true, and what to do if it's not. Presently, it handles:
- Adventuring somewhere until certain text appears on a certain page
- Adventuring somewhere to get N of a lacking item, unless
- certain text is on a certain page
- you have a certain other item
- you have a certain familiar
- you have disabled the item's quest stream
- Yeah, it has options to include a few optional quest streams (i.e. getting a maid, or pre-farming NS tower items), but your script should not hard-code the streams but allow for unlimited streams (covered below).
However, there's plenty that it lacks to be a complete ascension script (it doesn't unlock anything or make anything or use much of anything), or an optimized script. An optimal script should be able to weigh various options (i.e.
optimize its actions). Checklist is entirely without decision-making abilities -- it's just a list, in order, of actions to do.
I envision something way cooler for this script. After an action is completed/verified (which could be acquiring an item, unlocking a quest, achieving a certain level, calling a script/function... -- this would all be in the data file -- I actually overloaded the data file format fairly cleverly in Checklist which is why I recommended it as a starting point), the script will rebuild the list of possible actions and perform the most optimal one. This is exactly what BatMan does to calculate combat options; since any number of things could have changed after completing an action, it recalculates (including rebuilding the list of possible actions) after every action.
How would your script build the list? Well, first, you'd painstakingly make a data file containing a list of very specific actions that need doing, akin to Checklist's data file but much more anal, and with three important structural changes: 1) eliminate the safemox field, since ZLib makes that information available quite accurately these days, 2) add a 'stream' field, and 3) add a 'prereq' field. The stream field would contain which quest stream(s) the action belongs to. All actions mandatory for ascension would be one such stream. Another would be a maid. Another (several, actually) would be the Nemesis quest. Another might be a Pagoda. Another would be the White Citadel quest. Another would be pre-farming NS tower items (these should be included in the main stream if you can identify them using your 'scope). You could even include the gnomish neverending NPC quest. But non-mandatory streams could be added in after the main stream was finished, and it wouldn't even be much of a hassle to add since they wouldn't need to be in order.
Why no order? Because the prereq field would simply point to which step must be completed before that action is available. The way I see it, almost
every action will have a prereq. So when building the list of available options, if the prerequisite step had not yet been completed, the script would not add that action to the list of possible actions to consider (or, if the action cost nothing, it would just perform it automatically). This means that you would have an action "achieve level N" for every level, and then all of the steps that depend on that level being reached would include that as a prereq -- or they would chain off from there. Bonus: nearly all the hassle about whether you can or can't adventure somewhere would be part of the data file, rather than the script. Another bonus: the action list doesn't need to be in any specific order!
So now, you've built a list in memory of all actually possible actions that have not yet been done for the quest streams which your user has selected (somehow). Now to sort them based on turncount! Turn cost vs. turn profit.
The cost is easy -- once has_goal() accounts for Olfaction/frequency/item-yielding noncombats, you'll be able to pretty accurately predict the number of turns everything will take, and without too much difficulty. Don't include meat cost! Achieving the necessary meat for an action could be a prerequisite action, but don't include the meat as part of the cost, since all actions are necessary to complete your chosen streams, no matter what they cost.
The gain is the hard part to calculate. Stat gain is a big deal, but not for the obvious reason. The only thing it's good for is unlocking things, so it's not really a factor unless you can unlock things that give you more turns! (This is counterintuitive but true, since you have narrowed the field to only necessary actions which you will have to perform at some point.) The hardest part of this calculation will be figuring out whether going up a level would let you eat/drink something that gives you far more adventures than you could eat/drink otherwise. I'm not sure if EatDrink has any speculative abilities built-in, but if so, that would be excellent for this purpose -- compare your predicted food/drink gains at your present level to the predicted gains at the next level and then decide if achieving the next level is possible before eating/drinking. Huge chore, that, and in the meantime you may want to take a "run the actionsorter till only a handful of advs remain; call eatdrink; run the actionsorter again" approach.
After stat gain, there is item gain -- which again, usually counts for nothing except for items that gain you turns. Basically, consider food/item drops to be turns gained, although probably not at a 1:1 ratio. I'd probably add a special action to the list of available actions each iteration -- groceryshop. Basically, for each available zone that drops food/drink, what is the average turn gain per turn spent? Take the best of those, then figure out if turns gained >= turns spent + turns gainable from your current inventory.
After that, most actions won't gain you turns, so you should simply choose the action that gives you the smallest stat gain, since at that point you will actually be getting the largest percent of a level that you will ever get for it.
To sum up, this is the process that the actionsorter would perform after completing every action: iterate through the master list and remove actions already completed, perform free actions (from any stream!), remove actions from unselected quest streams, and remove actions that have unsatisfied prerequisite actions, in that order. Add a consumables-farming action to the list if appropriate. From the remaining actions, perform the highest turn-gaining action (food/drink earners, basically, possibly including leveling), or failing that, the lowest stat-gaining action. Rinse, repeat.
That's the angle I'd come from!
Hopefully that gives you some food for thought if nothing else!
-----
tl;dr: Everyone! You can
buy your own submarine!