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

I dug this out of one of my old scripts. Anyone care to tell me what the last five parameters do?
Code:
eatdrink(fullness_limit(), inebriety_limit(), spleen_limit(), false, 1100, 5, 1, 1000, false);
 
Here is the definition of the 9 parameter version of eatdrink() that was in a copy I had:
Code:
void eatdrink(int foodMax, int drinkMax, int spleenMax, boolean overdrink, 
	      int advmeat, int primemeat, int offmeat, int pullmeat, boolean sim)
{
  VALUE_OF_ADVENTURE = advmeat;   
  VALUE_OF_PRIME_STAT = primemeat;
  VALUE_OF_NONPRIME_STAT = offmeat; //You probably care less about it
  COST_OF_PULL = pullmeat;
  SIM_CONSUME = sim;
  eatdrink(foodMax, drinkMax, spleenMax, overdrink);
}
 
Just noticed a bit of wonkieness with mojo filters. I tell it to spleen up to 15 and when it uses 2 mojo filters apparently doesn't register the fact that they reduced the load on my spleen, so it stops at what it assumes is 15 but is actually 13. Running it a second time will fill those last two spleen.
 
Weird, since it's using mafia's value for doneness. Suppose what we'll want to do is make it repeat the spleen step if it uses a mojo filter. Done. Will be in next upload.
 
I've mentioned this before, but is eatdrink supposed to do an individual price check (by searching the mall) on every consumable in the game before running each day? Because it's been operating that way for me for quite some time.
 
Are you using an older version of the script, or the one from 928? 923 was the first version where I went back from using mall_price to historical_price in the effective_price check, and immediately had a bug report that it was overpricing items. :D Anyways, if you don't run ED every day, or you've set eatdrink_maxAge down below the '2' that it defaults to, then yes, it will check them all. If you're using a version before 923, then yes, it will check them all.

If you have maxAge set to 2, then it will check half the items every day. If you set it up higher, it'll check them less often... It comes down to how accurate you'd like your prices to be.
 
I think I'm using the one from the first post (that one's been updated though hasn't it?). I've been running it everyday, so I'll try again tomorrow with a higher maxAge setting (is 2 the recommended setting for this?). How does it determine which half to check? I seem to get a very good spread over the alphabet and consumable type.
 
It just means if the historical_age of the item is greater than that number of days, check. So every ~2 days, it will update for you. Might be every 3 days for a few weeks if you offset your playing slightly. If the price checks bother you, and you don't care about exactly how much you spend or that it's the best item for your meat today... turn it up to 7, or whatever level you'd prefer. If you're extra-paranoid about how your meat is spent, turn it down to 1 and it'll check every day.

It checks about half because, if you run it every day, and you're ascending so different items are available to you on different days, it will work based on the available count. If you enter aftercore and don't run it for a few days, then all your data will end up on the same schedule, but otherwise it will be spaced out due to level, class, path, etc...

And the official version does use historical_age. It was just a few editions of the version in progress that cared deeply about accuracy. ;)
 
Okay, finally time for a new version. This has whatever tweaks (mojo filter repeatings?) I've talked about above, as well as a new feature... hermit foods. It should actually be able to retrieve worthless items using chewing gum automatically, so if 5 painful penne pastas is your best option, that should be accomplished... In my attempt, it still suggested painful penne pasta with 0 worthless items available, so it should be ready for other people to try.

Edit: 2 quick fixes. One, it's (14 - starter items) for your next worthless item not (16 - starter items) which would be right if you needed to get 3 worthless, but... Two, the cost to guarantee it is ((14 - starter items) * 50), not (14 - starter items * 50) which actually becomes (14 - 50*starter items) instead. :) Pretty sure that the amount should be a positive, not a negative number.
 

Attachments

Last edited:
Importing and calling EatDrink from another script seems to result in the default value of value_of_adventure being used, rather than the one specified in my vars file. Calling EatDrink with all parameters specified (eg: "value_of_adventure = vars["eatdrink_valueOfAdventure"].to_int();") fixes the problem. Is this expected behaviour? I haven't looked far enough into to it to be able to tell you if any other settings behave like this.
 
In your vars file? Value of Adventure is a mafia preference, not a zlib preference... that's probably your issue. If you're quoting properly in the example you've given above, you'd want to set VALUE_OF_ADVENTURE not value_of_adventure, which is a completely different variable...
 
That would explain a few other things, actually. But how did I end up with an 'eatdrink_valueOfAdventure' setting in my vars file? That must have happened ages ago. Ah well, sorry to have bothered you (again), and thanks for the information.
 
Not a problem. I'm guessing that it's part of some wrapper that tried to do it as an unlinked variable (from the mafia preference) or something similar...
 
quick question

Ok not sure if I'm doing this wrong, in ronin and just want to simulate and see what it thinks the best food/drinks are.

It seems to find items i don't have on hand and doesn't subtract them when it simulates using them.

default vars file, and VoA at 100.

Code:
Starting EatDrink.ash (version 3.1.3).
Consuming up to 15 food, 14 booze, and 15 spleen and then finishing off with the stiffest drink we can find.
Considering food from inventory closet Hagnk's NPCs the mall. Per-item budget cap is 25000.0.
Price will be a factor if you own it already. Hagnk's pulls (if enabled) will cost 3000 meat each.
An adventure has the value of 100 meat. Muscle subpoint is 10.0. Nonprime stat subpoint is 2.0. Hagnk pulls are limited and their 'cost' is incorporated.
Simulating only; no purchases or food/drink/spleen consumption.
food: At 0, consuming to 15.
1: desiccated apricot lev:2 gain:1.0 adv:2.5 musc:16.0 myst:0.0 mox:0.0 meat:100 own:7 value:310
2: desiccated apricot lev:2 gain:1.0 adv:2.5 musc:16.0 myst:0.0 mox:0.0 meat:100 own:7 value:-2690
3: desiccated apricot lev:2 gain:1.0 adv:2.5 musc:16.0 myst:0.0 mox:0.0 meat:100 own:7 value:-2690
4: desiccated apricot lev:2 gain:1.0 adv:2.5 musc:16.0 myst:0.0 mox:0.0 meat:100 own:7 value:-2690
5: desiccated apricot lev:2 gain:1.0 adv:2.5 musc:16.0 myst:0.0 mox:0.0 meat:100 own:7 value:-2690
6: desiccated apricot lev:2 gain:1.0 adv:2.5 musc:16.0 myst:0.0 mox:0.0 meat:100 own:7 value:-2690
7: desiccated apricot lev:2 gain:1.0 adv:2.5 musc:16.0 myst:0.0 mox:0.0 meat:100 own:7 value:-2690
8: desiccated apricot lev:2 gain:1.0 adv:2.5 musc:16.0 myst:0.0 mox:0.0 meat:100 own:7 value:-2690
9: desiccated apricot lev:2 gain:1.0 adv:2.5 musc:16.0 myst:0.0 mox:0.0 meat:100 own:7 value:-2690
10: desiccated apricot lev:2 gain:1.0 adv:2.5 musc:16.0 myst:0.0 mox:0.0 meat:100 own:7 value:-2690
11: desiccated apricot lev:2 gain:1.0 adv:2.5 musc:16.0 myst:0.0 mox:0.0 meat:100 own:7 value:-2690
12: desiccated apricot lev:2 gain:1.0 adv:2.5 musc:16.0 myst:0.0 mox:0.0 meat:100 own:7 value:-2690
13: desiccated apricot lev:2 gain:1.0 adv:2.5 musc:16.0 myst:0.0 mox:0.0 meat:100 own:7 value:-2690
14: desiccated apricot lev:2 gain:1.0 adv:2.5 musc:16.0 myst:0.0 mox:0.0 meat:100 own:7 value:-2690
15: desiccated apricot lev:2 gain:1.0 adv:2.5 musc:16.0 myst:0.0 mox:0.0 meat:100 own:7 value:-2690
drink: At 0, consuming to 14.
1: dusty bottle of Pinot Noir lev:1 gain:2.0 adv:6.0 musc:12.5 myst:12.5 mox:12.5 meat:280 own:17 value:247
2: dusty bottle of Pinot Noir lev:1 gain:2.0 adv:6.0 musc:12.5 myst:12.5 mox:12.5 meat:280 own:17 value:-1252
3: dusty bottle of Pinot Noir lev:1 gain:2.0 adv:6.0 musc:12.5 myst:12.5 mox:12.5 meat:280 own:17 value:-1252
4: dusty bottle of Pinot Noir lev:1 gain:2.0 adv:6.0 musc:12.5 myst:12.5 mox:12.5 meat:280 own:17 value:-1252
5: dusty bottle of Pinot Noir lev:1 gain:2.0 adv:6.0 musc:12.5 myst:12.5 mox:12.5 meat:280 own:17 value:-1252
6: dusty bottle of Pinot Noir lev:1 gain:2.0 adv:6.0 musc:12.5 myst:12.5 mox:12.5 meat:280 own:17 value:-1252
7: dusty bottle of Pinot Noir lev:1 gain:2.0 adv:6.0 musc:12.5 myst:12.5 mox:12.5 meat:280 own:17 value:-1252
spleen: At 0, consuming to 15.
Best find was Hatorade with a value of -100. That's no good, so not consuming and moving on.
At drunkenness of 14. Overdrinking.
1: dusty bottle of Pinot Noir lev:1 gain:2.0 adv:6.0 musc:12.5 myst:12.5 mox:12.5 meat:280 own:23 value:495
choc: Checking non-filling crimbo chocolates - all 3 kinds
Best find was chocolate seal-clubbing club with a value of -2700. That's no good, so not consuming and moving on.
Finished.
Spent 2590 meat for a value of 3740 meat. Gained Fullness: 15. Inebriety: 16. Spleen: 0.
Adventures: 101. Muscle: 336. Moxie: 96. Mysticality: 96.
Eating, drinking, and spleening complete. Commence merrymaking (at your own discretion).
 
Last edited:
The own amount displayed should be the amount after you're done, so if it says it's using 15 apricots and "own" is 7, that should mean you actually have 22 apricots... Is there something specific where it's wrong?
 
I only have 1 on hand, is there a way to have it ignore storage? And actually I have 310 in storage, so not sure where it gets 22 from.

Thanks!
 
Last edited:
It uses whatever settings you've done for mafia... as it says:
Considering food from inventory closet Hagnk's NPCs the mall.
It's planning on using the one on-hand, and then pulling 14 more from storage (hence their value at -2690, when the first one has a value of +310) to finish you up...

Hmm... does mafia actually have a preference for whether storage is valid? It's currently using the clan stash value for that, which isn't right...
 
Last edited:
Using eatdrink 3.1.3 on mafia r9452, when I call the script it doesnt seem to actually make/buy any items or fill any food/drink/spleen.


here is what appears in CLI after using the script setting simulation to false and asking it to fill 15/19/15:

> call scripts\EatDrink.ash

Refreshing stash contents...
Stash list retrieved.
Internal checkpoint created.
Loading favorite consumables from user settings...
adding favorite: rockin' wagon
adding favorite: pr0n chow mein
adding favorite: twinkly wad
Starting EatDrink.ash (version 3.1.3).
Consuming up to 15 food, 19 booze, and 15 spleen
Considering food from inventory closet . Per-item budget cap is 125000.0.
Price will be a factor if you own it already. Hagnk's pulls (if enabled) will cost 3000 meat each.
An adventure has the value of 1500 meat. Moxie subpoint is 0.0. Nonprime stat subpoint is 0.0.
2319 prices updated from http://nixietube.info/mallprices.txt
Pass 1: food.
food: At 0, consuming to 15.
Searching for "dry noodles"...
Search complete.
Searching for "jabañero pepper"...
Search complete.
Favorite pr0n chow mein appears unavailable given budget, EAT_SHOP and EAT_MALL variable settings, ronin status, and/or mall price.
Searching for "ghost cucumber"...
Search complete.
No food available that's good enough. Moving on.
Favorite pr0n chow mein appears unavailable given budget, EAT_SHOP and EAT_MALL variable settings, ronin status, and/or mall price.
Favorite pr0n chow mein appears unavailable given budget, EAT_SHOP and EAT_MALL variable settings, ronin status, and/or mall price.
Favorite pr0n chow mein appears unavailable given budget, EAT_SHOP and EAT_MALL variable settings, ronin status, and/or mall price.
Favorite pr0n chow mein appears unavailable given budget, EAT_SHOP and EAT_MALL variable settings, ronin status, and/or mall price.
Favorite pr0n chow mein appears unavailable given budget, EAT_SHOP and EAT_MALL variable settings, ronin status, and/or mall price.
Favorite pr0n chow mein appears unavailable given budget, EAT_SHOP and EAT_MALL variable settings, ronin status, and/or mall price.
Favorite pr0n chow mein appears unavailable given budget, EAT_SHOP and EAT_MALL variable settings, ronin status, and/or mall price.
Favorite pr0n chow mein appears unavailable given budget, EAT_SHOP and EAT_MALL variable settings, ronin status, and/or mall price.
Favorite pr0n chow mein appears unavailable given budget, EAT_SHOP and EAT_MALL variable settings, ronin status, and/or mall price.
Pass 2: drink.
drink: At 0, consuming to 19.
Favorite rockin' wagon appears unavailable given budget, EAT_SHOP and EAT_MALL variable settings, ronin status, and/or mall price.
No drink available that's good enough. Moving on.
Favorite rockin' wagon appears unavailable given budget, EAT_SHOP and EAT_MALL variable settings, ronin status, and/or mall price.
Favorite rockin' wagon appears unavailable given budget, EAT_SHOP and EAT_MALL variable settings, ronin status, and/or mall price.
Favorite rockin' wagon appears unavailable given budget, EAT_SHOP and EAT_MALL variable settings, ronin status, and/or mall price.
Favorite rockin' wagon appears unavailable given budget, EAT_SHOP and EAT_MALL variable settings, ronin status, and/or mall price.
Favorite rockin' wagon appears unavailable given budget, EAT_SHOP and EAT_MALL variable settings, ronin status, and/or mall price.
Favorite rockin' wagon appears unavailable given budget, EAT_SHOP and EAT_MALL variable settings, ronin status, and/or mall price.
Favorite rockin' wagon appears unavailable given budget, EAT_SHOP and EAT_MALL variable settings, ronin status, and/or mall price.
Favorite rockin' wagon appears unavailable given budget, EAT_SHOP and EAT_MALL variable settings, ronin status, and/or mall price.
Favorite rockin' wagon appears unavailable given budget, EAT_SHOP and EAT_MALL variable settings, ronin status, and/or mall price.
Pass 3: spleen.
spleen: At 0, consuming to 15.
Favorite twinkly wad appears unavailable given budget, EAT_SHOP and EAT_MALL variable settings, ronin status, and/or mall price.
No spleen available that's good enough. Moving on.
Favorite twinkly wad appears unavailable given budget, EAT_SHOP and EAT_MALL variable settings, ronin status, and/or mall price.
Favorite twinkly wad appears unavailable given budget, EAT_SHOP and EAT_MALL variable settings, ronin status, and/or mall price.
Favorite twinkly wad appears unavailable given budget, EAT_SHOP and EAT_MALL variable settings, ronin status, and/or mall price.
Favorite twinkly wad appears unavailable given budget, EAT_SHOP and EAT_MALL variable settings, ronin status, and/or mall price.
Favorite twinkly wad appears unavailable given budget, EAT_SHOP and EAT_MALL variable settings, ronin status, and/or mall price.
Favorite twinkly wad appears unavailable given budget, EAT_SHOP and EAT_MALL variable settings, ronin status, and/or mall price.
Favorite twinkly wad appears unavailable given budget, EAT_SHOP and EAT_MALL variable settings, ronin status, and/or mall price.
Favorite twinkly wad appears unavailable given budget, EAT_SHOP and EAT_MALL variable settings, ronin status, and/or mall price.
Favorite twinkly wad appears unavailable given budget, EAT_SHOP and EAT_MALL variable settings, ronin status, and/or mall price.
Pass 4: drink.
Skipping drink.
Finished. You had -Ode to Booze in effect. Adventures listed above does not reflect that, but this does:
Spent 0 meat. Gained Fullness: 0. Inebriety: 0. Spleen: 0.
Adventures: 0. Muscle: 0. Moxie: 0. Mysticality: 0.
Eating, drinking, and spleening complete. Commence merrymaking (at your own discretion).
******************************************
Now, to recap...
******************************************
Starting EatDrink.ash (version 3.1.3).
Consuming up to 15 food, 19 booze, and 15 spleen
Considering food from inventory closet . Per-item budget cap is 125000.0.
Price will be a factor if you own it already. Hagnk's pulls (if enabled) will cost 3000 meat each.
An adventure has the value of 1500 meat. Moxie subpoint is 0.0. Nonprime stat subpoint is 0.0.
food: At 0, consuming to 15.
drink: At 0, consuming to 19.
spleen: At 0, consuming to 15.
Finished. You had -Ode to Booze in effect. Adventures listed above does not reflect that, but this does:
Spent 0 meat. Gained Fullness: 0. Inebriety: 0. Spleen: 0.
Adventures: 0. Muscle: 0. Moxie: 0. Mysticality: 0.
Eating, drinking, and spleening complete. Commence merrymaking (at your own discretion).
 
You're consuming from your inventory and the closet.
Considering food from inventory closet .
That means you haven't allowed it to use NPCs or the mall to buy things... my guess is that your inventory itself is rather bare at the moment?
 
Back
Top