EatDrink.ash: Optimize your daily diet (and see how your old diet stacks up).

Theraze

Active member
This is voodoo advice. If there is a problem with inventory, "refresh inventory" will fix it. Since "refresh all" does nothing to inventory - and even if it did, it would be exactly the same thing as "refresh inventory" does - it is completely pointless to do it in the superstitious hope that it will magically fix your problem.

Hmm... Does refresh inv also refresh stash, storage, display case, etc? EatDrink will try to use those if your mafia settings allow, so it may attempt to access things that aren't directly in your inventory, per se...
 

Veracity

Developer
Staff member
Actually, looking at the code, "refresh all" calls KoLmafia.refreshSession - which WILL refresh inventory - in precisely the same way the refreshInventory will do, as well as storage. Although, why would refreshing storage be useful? You cannot add to it. Regardless, "refresh storage" will do it.

EatDrink will use your display case? Really? Wow! If that is true, I hope that is published in big red letters on its page. That is toxic. As mentioned on another thread - which you participated in! - there are no "settings" to use the display case.

There is no CLI command to refresh the stash. although the ash "refresh_stash()" function will do it. InventoryManager.hasItem will count items in (KoLmafia's current idea of) the stash, if the preference is included. InventoryManager.retrieveItem will pull from the stash if KoLmafia thinks the item is present there. ConcoctionDatabase.getAvailableIngredients will include items from (KoLmafia's current idea of) the stash when calculating what can be created. All of those will look at the stash if it hasn't been looked at yet, but none of them will update to the current state.

In any case, the reported problem was with a "HC Level 12 Sauceror", so Storage and Stash are irrelevant. Inventory - and, potentially closet - are the only sources for ingredients. Both are refreshed when you "refresh inv".
 
Last edited:

Theraze

Active member
Ah, true. The one character I had the issue on a week or so ago was a level 14-15 (can't remember exactly) on the day of ascension, which makes the other locations potentially important. Not relevant if still in HC though.

If display case isn't able to be preferenced on, it's irrelevant, as you say. Morning posts are always dangerous, as they come out before caffeine brings the synapses to their partially working state. I was thinking there was some preference that would make it checked for outfits and the like, but maybe that was the post where it was shot down horrifically as being counter-logical.

Yes, as you said, if inventory and closet are both refreshed with the inv, that should be all that matters for the HC player. For SC/post-NS, refreshing stash and those may matter, but in this case, the inv should have fixed it.

I'm curious though why the long pork crafted food seems to cause this. Next time it comes up for me, I'll need to try to watch more closely, and hopefully I'll be able to report the issue instead of forgetting and just restarting the script repeatedly or remembering the issue after it's run off my entire pre-repeat logs...
 

Theraze

Active member
Not sure how many people are playing with this still, but here's my latest version... if it works as it should, the script should (if you've told it to, have the skill, and enough max mp to cast it at least once) cast enough ode for whatever the item's maximum fullness it can provide. If after it casts once, it decides it needs more, it casts again. It repeats until either the casting fails for some reason (mp restoration disabled, out of meat, whatever) or there's enough ode to cover the full consumption of the booze.

This completely eliminates the need for a booze mood, as well as means that you shouldn't have it try to ode for adventuring if the script is aborted mid-execution. It is somewhat more restrictive on when it will wait for ode... if you tell it that you want ode, but it's impossible to cast, it shouldn't attempt/fail to add more because of the script anymore. Also, the script shouldn't abort because while you want/have ode as a HP skill, you're still level 3 without the ability to get 50 max mp. :D
 

Attachments

  • EatDrink.ash
    59.7 KB · Views: 91

Tom Sawyer

Member
Ok there must be something in my settings or such. This time the script got into a loop eating centipede eggs of all things??

Maybe I will flush everything and try running the latest mafia daily build in a new folder
 

Theraze

Active member
Centipede eggs are actually decent food-wise... they just massively poison you when done. Costs 2 appetite, gives 6-7 adventures plus 8-10 substats for all 3. That sounds like a pretty decent food choice for the cost of one antidote, especially when you consider it only takes one antidote regardless of how many eggs you consume. KoL itself classifies their food level as "awesome" so they agree as well. :)
 

asturia

Minion
I'm really happy that someone is still updating this script. I'm using it everyday. So thanks for the updates.
 

Ferdawoon

Member
Code:
> call scripts\Ascend.ash

[the ode to booze] does not match anything in the status effect database.
Bad effect value: "the ode to booze" (EatDrink.ash, line 1339)

Downloaded the version Theraze posted and the one at the front page. the Modified version work, but it is EatDrink.ash that my other scripts depend on =(
Simply editing out the 'the' part in the skill name solve the problem.
 

lostcalpolydude

Developer
Staff member
Removing "the" is the only difference in the modified version, so I'm surprised the unfixed version is still attached to the first post. I haven't been following the thread too closely, so I'll wait a few days before cutting it down to a single attachment in case there's some reason for the other one that I'm missing.
 

fronobulax

Developer
Staff member
Removing "the" is the only difference in the modified version, so I'm surprised the unfixed version is still attached to the first post. I haven't been following the thread too closely, so I'll wait a few days before cutting it down to a single attachment in case there's some reason for the other one that I'm missing.

Until the creation of Minions and releasing them on KoLmadia.us, no one could edit the first post except dj_d. Now that has changed, it is probably worth changing the version number on the post and in the script and otherwise updating the first post.
 

Funny_snake_100

New member
A little confused, but very interested

So i just came across this script a day or two ago, and keep trying to make it work for me but keep failing. I've solved a few of my problems, but now I'm stuck again. when i run the script and it gives me what i should eat/drink, it seems to assume that if I have 1 of something in my inventory, that i have unlimited of that. so for instance i only have the ability to make 1 fruity girl swill, but it tells me i should drink 4 of them.
I'm also not sure what version to be using. there's the 2 in the first post, and then the one that there is a link to in the first post, which one should i be using?

The script seems like an awesome thing, just getting a little confused. thanks for any help in advanced!
 

fronobulax

Developer
Staff member
I unilaterally decided the best way to support EatDrink was to do it here and edit the first post as appropriate, now that I can. I posted my version, rather than Theraze's because I know mine works. There are two features that are, as a result, missing. The first is code Threaze deleted that deals with Ode to Booze and moods. Since I don't know why that was pulled I figure some discussion is in order. The second is code which I believe was originally from Bale, that changed the parameters to EatDrink from integer and Boolean to a single string. I resisted this when it was previously discussed because I like the popups and did not want to have to fiddle with aliases or remember how things were packed in a string. I am willing to reconsider that decision if people want to continue the discussion or there is an overwhelming groundswell of support. (In this case an overwhelming groundswell of support would be two or three folks besides Bale and Theraze asking for the feature and no one asking me not to do it).
 

Xenthes

Member
Personally, I like the popups so I know how much of food/drink/spleen I am consuming. Just feels like I have more control over things that way.
 

Theraze

Active member
I changed the mood code because sometimes, generally when I realize that Eatdrink it drinking imp ales because I ran out of barrel drinks in HC, I cancel the script. Then I adventure in the barrels, and then run Eatdrink again when done, and I get more than 1 adventure (2 with ode) per inebriety. Cancelling the script mid-run leaves the booze mood (which the user has to create themselves) active, and it keeps trying to cast Ode as I'm adventuring, which wastes a bunch of either restoratives or meat.

Instead, it now just casts ode if you've set the preference that you want ode. As ode automatically uses the best accordion in your inventory, that shouldn't be an issue, so it should just use as much ode as you need. No messing with needing to create a mood, no failing because you don't actually have enough max mp to cast ode, no accidentally casting ode because your mood got left when you cancelled to pull the bugbear outfit for tomorrow's consumption when you remember just a little bit too late...
 

tgetgel

Member
I like the pop-ups when I manually launch eatdrink from within mafia. I manually cast or get ode, no mood.
I give eatdrink all of the needed parameters when I call it from within a script, and get ode in the script beforehand.

And I thank you both for the work on these scripts.
 

Theraze

Active member
Hmm... well, here's a version of EatDrink 3.1 with the booze mood removed, but retaining the popups and Bale's choc fixes. This also removes the desire of the script to add a zlib value for every item consumed, which should keep people's zlib variables from bogging down.
 

Attachments

  • EatDrink.ash
    60 KB · Views: 36

fronobulax

Developer
Staff member
Hmm... well, here's a version of EatDrink 3.1 with the booze mood removed, but retaining the popups and Bale's choc fixes. This also removes the desire of the script to add a zlib value for every item consumed, which should keep people's zlib variables from bogging down.

I am amused. The version I posted has the original booze mood behavior and I'm not sure (without actually looking at your code) whether you are saying you backed out your changes or retained them. Personally I think you made a pretty good case for not allowing EatDrink to manipulate moods so I am just waiting to hear if anyone else cares before I change EatDrink to either cast Ode or not, in much the same way you either use milk or don't use milk. Bale's chocolate fixes are in v3.1. Did I screw up somehow?

As a general rule it would be much more helpful to start with the latest posted version (3.1) and then list the changes you have made in your proposed version. That, of course, presumes that you are posting them with a goal of having them incorporated into the baseline version of the script.

On the whole popup issue, I'm wondering if there is a way to have it both ways. I'm thinking of a wrapper script that has a main that expects a string, parses it and calls EatDrink while EatDrink itself has a main that expects integers. I don't think anyone who wants the string version has reported that they actually call it from the script menu and most of the CLI usage is aliased so it might be as simple as training you and Bale to use EatDrinkS instead of EatDrink and then we can have it both ways. Under the circumstances, I would add EatDrinkS and documentation to the first post.
 

Theraze

Active member
My version has the Bale choco changes and the original (3.0/3.1, non-Bale) popup behaviour, but keeps my no-mood ode behaviour and removes the eatdrink_daily_ additions.

Regarding the string popup... I never actually used it, I just thought it seemed like it would be more useful if I ever called it by itself. Since it's a sticking point, and nobody besides Bale has actually spoken up as using it, it made sense to remove it.

Reasoning on the no-mood ode... gave that in my 656 post.

Reasoning on removing the eatdrink_daily_<300+ entries>... I seem to recall zarqon speaking against adding too many variables, since every script that runs has to load up all of the variables, not just its own. The only 'added' functionality it gives is that favourites get to lookup when the historical price of the item is stale, and everything else fails to update unless you do it manually. Why would I want a stale price though on other good choices... I may as well have the prices update if stale, and then they won't update again until I either buy it or it becomes stale again. The variables are just a way of additionally tracking whether or not you've ever eaten something, but not really in a useful way. So... faster zlib execution, more accurate prices... seemed win/win to me.
 
Top