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

Hmm I was having some issues with getting this to work. (And sorry if you already know about this. I didn't want to look through all 16 pages to see if it's been reported) I downloaded the ascend.ash script and ran the eatdrink.ash so it would make all the variables and i could tweak them. Except instead of using the data files in the script folder it created blank data files in the data folder, and then it told me that there was nothing good enough for me. I copied all the data files from the script to the data folder and it worked fine. Just thought I'd post in case anyone else had this problem. Again, sorry if you already knew about this
 

dj_d

Member
Wierd! Mafia's default folder locations have always been a mystery to me. Will be interesting to see if there are any other reports. Glad you got it working, though.
 

Veracity

Developer
Staff member
Mafia's default folder locations have always been a mystery to me.

As of revision 7526 on August 6, data files always come from the "data" directory. I know that zarqon and Bale had repeatedly lobbied for that fix; I could have sworn that you did too, but apparently not.

Here's what the revision log says about this:

Fix creation of data files from ASH scripts:
* use only the final component of the pathname, even on Windows (only forward slashes were previously considered, which was a security hole).
* create files in the data directory rather than the script directory.
 

flypapermonk

New member
I'm still trying to figure out what happened, but I have a script where I eat once in a day and then a second time at the end of the day using your script here. It eats up to 13/15 fullness for me at the beginning and then tries to fill up to 15 at the end of the day. Your script was run properly (message from script: Now at fullness of 13, eating to 15.) but it did not actually eat up to 15 fullness. Other than this little hiccup it works great, but I sure would love to know how to get it to work properly.
 

dj_d

Member
Neo - the behavior you describe is not unexpected if you don't have any qualifying food (of 1 or 2 fullness). That's common if you're in Ronin or hardcore, for example. But I'd have to get more detail to know exactly what's happening. I've certainly used it that way myself successfully many times.
 
I am trying to run this on a fairly new multi (trying to get a fresh config for the config editor), and I get the following error when running EatDrink.ash (with all other scripts fully updated):

Code:
> call scripts\EatDrink.ash

Undefined reference to function 'historical_age' (EatDrink.ash, line 898)

> eatdrink.ash

Undefined reference to function 'historical_age' (eatdrink.ash, line 898)

I tried running it from the scripts menu as well as manually, and got this error both times. Any Ideas?
 

Bale

Minion
The question has been asked and answered several times already. :'(

Answer: Your KolMafia is too old. Update it.

Moral: Always update software before reporting a bug. Doubly so for a beta product like KolMafia which is frequently adding new functions like historical_age.
 
Last edited:
Answer: Your KolMafia is too old. Update it.

Oops... apologies. I keep KOLMafia updated on my Linux Box since it is my main machine, but I had forgotten to check for updates on my windows machine (which I only use for C# programming). I guess I thought it checked for updates automatically. I will reboot and update!
 
I started messing around with this a lot recently and it is extremely useful!! :D So, thanks for this script!

I did notice one thing, which is really more of a user error and most likely wouldn't come up if eatdrink was being called from a script. I accidentally put a drinkMax that was higher then my inebriety limit and overdrink was set to true. So it overdrank just trying to get to my erroneous drinkMax value and then when it came time to over drink it went into a loop because I was already falling down drunk.

Like I said, this is more of a user error, but something like this would prevent this problem from ever occurring:

Code:
if(drinkMax > inebriety_limit())
  drinkMax = inebriety_limit();

Anyways, thanks again for the script!
 

dj_d

Member
Awesome! I'm glad you like it!

I added that check, with an exception for if you're simulating. I also added a check for if your requested consumption is less than your max consumption but you still request overdrink.
 

Raven434

Member
Hi, I really like this script a lot.

I have a few mechanical questions that I haven't been able to figure out.

It appears that favorites are defined in the EatDrink script itself as opposed to vars_YOUR-TOON.txt. Will they be moving in later following the trend towards zlib goodness?

What is the relationship between prime vs non-prime as a ratio? Meaning, is defining prime stat of 10 and non-prime of 2 the *same* as prime 5 and non-prime 1? Does it matter in terms of how EatDrink decides on how to act?

Is there a recommended ratio for maximizing adventures as opposed to stat gain? I have a multi in aftercore working on Wumpus and lucres and other trophies for a week or so and want max adventures instead of max stats. Is there a way to optimize for that?

Thanks so much.
 
Last edited:

dj_d

Member
Re: moving favorites to zlib, laziness may preclude it. But knowing that you're using the feature is a good kick in the rear to do it sometime. :)
The ratio is important but the absolute value is more important. EatDrink normalizes all beneficial aspects of food (except effects) in to meat. The number is how much meat a subpoint is worth. If you don't care about stats, set them both to zero. If you care a lot about adventures, set that higher.

The formula goes:
meat-per-adventure * adventures +
meat-per-substat * substat-granted +
meat per-prime-substat * prime-substat-granted
MINUS
cost of the item
(then divided by fullness/drunkenness/spleenness)

whatever item has the best "value" according to this, wins. A rough rule of thumb is that value per adventure should be equal to whatever you make farming in a day.
 

Raven434

Member
If you don't care about stats, set them both to zero. If you care a lot about adventures, set that higher.

I set prime and non-prime to 50 and ate a bunch of canes and drank a bunch of thistle wine which were huge stat gains, not so huge adventure gains. Ala the typical SCNP pulls you might have on day 1.

Did I read the above wrong?

whatever item has the A rough rule of thumb is that value per adventure should be equal to whatever you make farming in a day.

Do you mean what I make farming per turn, not the total for the day, right? I am 99.9875% sure that is what you mean. :)
 

dj_d

Member
Right, sorry. What I meant to say was:

If you don't care about stats, set prime and nonprime to zero. If you care a lot about adventures, set the stat numbers to zero and the adventure value number higher.
 

Idran

Member
I had a feature suggestion for this: right now for each step, it makes food, checks if you don't have Got Milk, makes magnesium if necessary, uses it, eats, and then continues. Would it be possible for it to make food all one after another before consuming anything, then use milk of magnesium, then consume? When you're in ronin or HC and you don't have a chef-in-the-box, it kinda sucks to have Got Milk run out in the middle of eating so you have to use two goat's milks that day. :(

Maybe even just have this as an option you can set, or even better (if possible), have it decide which to do based on if you have a chef-in-the-box or not? It's less important for booze since Ode just uses MP which isn't as big of a deal, but maybe have something similar for booze anyway too.
 

flypapermonk

New member
Okay, so my problem hasn't been very consistent (only happening when I was watching for it to happen) but it finally happened again. Here is the output:
Code:
Starting EatDrink.ash (version 2.4).
Consuming up to 15 food, 14 booze, and 20 spleen and then finishing off with the stiffest drink we can find.
Considering food from inventory Hagnk's the mall. Per-item budget cap is 25000.0.
Price will not be a factor if you own it already. Hagnk's pulls (if enabled) will cost 3000 meat each.
An adventure has the value of 750 meat. Moxie subpoint is 0. Nonprime stat subpoint is 0.
Loading food records.
Now at fullness of 14, eating to 15.
filtering food based on level & availability
calculating food values
Writing out new food file
Loading drink records.
Now at inebriety of 14, drinking to 14.
It knows that I need and want 1 more fullness and it didn't do anything about it. When I ran the script again immediately after that, it created food and ate it (though it didn't use milk for some reason).
 
Top