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

soolar

Member
Hmm, I was under the impression that 1-fullness foods didn't work with the fullness->liver mayo, but now that I'm looking in to that again I don't find anything backing that up, so I must have just gotten it mixed up with the mayolus mayo.

As for this talk about the one 'best' item, what exactly do you mean by that? Only considering one type of mayo in general?

Also, something to keep in mind with the liver mayo is the opportunity cost of not being able to use the +1 adv mayo with that food, in the case of >1 fullness foods.

As for the concern of over-complication turning people away from the script, if you just keep the mayo stuff limited to user variables then it shouldn't be a big problem, since it shouldn't make it more outwardly complex to people as far as needing to provide more arguments each time. I'm all for more complexity if it means a smarter diet planner though, personally :)

Anyway yeah, I look forward to the first pass at mayo support! :D



On an unrelated note, eatdrink has been doing one thing I consider a little bit odd lately. It seems to be using 2 mojo filters every day, and using four 4-toxicity spleen items and a single 1-toxicity spleen item, but it seem like it it's using a single mojo filter to use a 1-spleen item, why isn't it doing that twice??
 

Theraze

Active member
I already had a Mayoflex from my prior consumption which failed to actually use the item, so it doesn't need to get another, but...
> ashq import <EatDrink.ash>; eatdrink(10, inebriety_limit(), spleen_limit(), false);

Refreshing stash contents...
Stash list retrieved.
Internal checkpoint created.
Skipping favorites.
Starting EatDrink.ash (version 3.2).
Consuming up to 10 food, 19 booze, and 15 spleen
Considering food from inventory Hagnk's Coinmasters NPCs the mall. Per-item budget cap is 12500.0.
Retrieval cap is 10000. Price will be a factor if you own it already.
An adventure has the value of 1250 meat. Moxie subpoint is 10.0. Nonprime stat subpoint is 2.0.
Pass 1: booze.
Skipping booze.
Pass 2: food.
food: At 5, consuming to 10 with 20000 meat.
Getting 1 sleazy hi mein in 0 seconds
autoBuyPriceLimit => 6875.0
Searching for "sleazy hi mein"...
Search complete.
Purchasing sleazy hi mein (1 @ 5,500)...
Purchases complete.
autoBuyPriceLimit => 10000
Using 1 Mayoflex...
Finished using 1 Mayoflex.
Eating 1 sleazy hi mein...
You gain 36 Adventures
You gain 29 Beefiness
You gain 28 Wizardliness
You gain 100 Smarm
You acquire an effect: Sleazy Breath (5)
You gain 5 Fullness
You lose some of an effect: Got Milk (-5)
Finished eating 1 sleazy hi mein.
1: sleazy hi mein using Mayoflex lev:7 gain:5.0 adv:30.5 musc:26.5 myst:27.0 mox:73.0 meat:6450 own:0 value:6502
Pass 3: spleen.
Skipping spleen.
Pass 4: booze.
Skipping booze.
choc: Checking non-filling crimbo chocolates - all 3 kinds
Best find was chocolate seal-clubbing club with a value of -400. That's no good, so not consuming and moving on.
Finished. You had Milk of Magnesium in effect. Adventures listed above does not reflect that, but this does:
Spent 5500 meat. Gained Fullness: 5. Inebriety: 0. Spleen: 0.
Adventures: 36. Muscle: 29. Moxie: 100. Mysticality: 28.
Eating, drinking, and spleening complete. Commence merrymaking (at your own discretion).
******************************************
Now, to recap...
******************************************
Starting EatDrink.ash (version 3.2).
Consuming up to 10 food, 19 booze, and 15 spleen
Considering food from inventory Hagnk's Coinmasters NPCs the mall. Per-item budget cap is 12500.0.
Retrieval cap is 10000. Price will be a factor if you own it already.
An adventure has the value of 1250 meat. Moxie subpoint is 10.0. Nonprime stat subpoint is 2.0.
food: At 5, consuming to 10 with 20000 meat.
1: sleazy hi mein using Mayoflex lev:7 gain:5.0 adv:30.5 musc:26.5 myst:27.0 mox:73.0 meat:6450 own:0 value:6502
choc: Checking non-filling crimbo chocolates - all 3 kinds
Best find was chocolate seal-clubbing club with a value of -400. That's no good, so not consuming and moving on.
Finished. You had Milk of Magnesium in effect. Adventures listed above does not reflect that, but this does:
Spent 5500 meat. Gained Fullness: 5. Inebriety: 0. Spleen: 0.
Adventures: 36. Muscle: 29. Moxie: 100. Mysticality: 28.
Eating, drinking, and spleening complete. Commence merrymaking (at your own discretion).
Committing this now. Should be fully working for everything but inebriety. We'll figure that out when people decide how messy they want it. :)

Quick example of time difference. Tracktime says that full MAYO_CLINIC took 1985 ms. MAYO_CLINIC just considering Mayoflex took 1554 ms. MAYO_CLINIC disabled took 1447 ms. I'd happily take an extra tenth of a second to get the extra adventure from mayo. I don't object to getting 800k meat from mayolus in an extra 3 tenths of a second, if I'd ever actually see the meat. That being said, it wouldn't be bad if the mayolus got depreciated down to reasonable levels from having a few more entries in the mall.

I wish...
Simulating only; no purchases or food/drink/spleen consumption.
food: At 10, consuming to 15 with 20000 meat.
0: milk of magnesium price: 666 value: 5584
1: liver and let pie using Mayostat lev:1 gain:2.0 adv:6.0 musc:7.5 myst:7.5 mox:7.5 meat:1050 own:0 value:225499
2: liver and let pie using Mayostat lev:1 gain:2.0 adv:6.0 musc:7.5 myst:7.5 mox:7.5 meat:1050 own:0 value:225499
3: dinner roll using Mayoflex lev:4 gain:1.0 adv:5.5 musc:0.0 myst:0.0 mox:0.0 meat:1450 own:0 value:5425

Edit: And... first bugfix. Can only apply mayo packets to food, not the other iterations. Force an svn update eatdrink if you're stuck on r30.
 
Last edited:

soolar

Member
Awesome! That's not a bad bump in time at all. I'm probably going to leave the mayolus disabled for now just because I really doubt anyone's actually buying any of the non-epic ones for their current ridiculous prices, but yeah, awesome!

I'll try it out after rollover and let you know if I spot anything weird :)
 

Theraze

Active member
So now that we have our 'first commit' post done, going back to your question bits.
Regarding the 'best item' question, what we do now is have our consideration of what is the value (per fullness) of the item we're consuming loop a bit. It has a value for which helper it is considering, and if that is not set, then it will check the current best value against the value using the enabled helpers. If one of the helpers is better, it will replace the current helper (if set) with the new helper and set the current value to the value with the helper included. This new value already includes the price of the mayo packet. It will consider all enabled mayo types during the valuation, but the final object will only have the one 'best' mayo type. As you can see from my post above, that can vary from item to item. It used two Mayostat for the acceptable mayoli and a Mayoflex to bump the dinner roll's adventures.

Regarding mojo filters, EatDrink unfortunately doesn't know for sure what will happen next with spleen and expects to be able to continue spleening at whatever value it's at currently. So if your average for the 4-toxicity is 3 adventures per unit and the 1-toxicity can only get 1 adventure, EatDrink will still work to filter you expecting that it will get another 3 adventures. It's just trying to make sure that it can get as much in there which should make sense as possible, but sometimes it fails. I don't think there's really a great way to avoid that. It's actually why I started dumping mojo filters in the closet while in AoSP runs, because ED would expect that it could get more and would just waste the filters.

Regarding mayolus, I'm going to be dumping some into my store at lower prices because if people buy them, profit. If not, I still help to deflate the massively overinflated values and help to get things closer to when they'll actually be useful. :)
 

soolar

Member
Hmm, now that you have support for helpers in general, what about things like salad forks? Or does it already account for those and I have nowhere near the valueOfAdventure for them to be worth using?

Also thanks for the other answers in general.

Maybe with regards to using mojo filters, it wouldn't make THAT dramatic of a difference to computation time for it to consider every possible outcome (compute using no filters, a single filter, two filters, and three filters) and then pick the one with the highest total value, would it? Like, yeah, it would quadruple the total time for the spleen section, but that part is already the shortest by a longshot.

Also, I mentioned that you've added support for mayo in the thread for the mayo clinic on the main KoL forums, for whatever that's worth :)
 

Theraze

Active member
Helpers besides milk and ode aren't in currently. The new helper code means that we could support them now though. After we get done with the mayo bits, we will probably add some more helpers.

Mojo filters, what we MIGHT be able to do is to consider total size. Rather than consider things normally, we could consider up to 3 extra space. It's not a helper thing though, it's a complete crazy-code-special thing. Should be possible though. We'll definitely need some major work though. One major thing at a time.

Well, it had support before. Darzil is working to fix detection of the Mayo clinic, since it doesn't notice it normally. There are a few unknown plurals that I reported.
 

soolar

Member
It still works as long as you manually visit the clinic once before use, in the meantime. And yeah of course, one thing at a time :p
 

Bale

Minion
Hmm, I was under the impression that 1-fullness foods didn't work with the fullness->liver mayo, but now that I'm looking in to that again I don't find anything backing that up, so I must have just gotten it mixed up with the mayolus mayo.

spaghetti breakfast plus inebriety mayo is awesome and works perfectly. Today I did that before calling eatdrink.
 

Xenthes

Member
I am getting this error:

Bad item value: "uninteresting mayolus" (EatDrink.ash, line 2008)

I have the newest daily build of mafia and I have visited mt mayo clinic in my workshop.
If you need more info let me know what you all need.
 

Theraze

Active member
Just to check - your "newest daily build" is newer than r15797? Because that's the build where Veracity added the uninteresting mayolus...

Suppose I really need to update the 'since' on the script to bump people into remembering there might be newer options available.
 

Xenthes

Member
Huh, looks like the daily build downloader program I was using (Rinn's) stopped actually doing the download since r15739.
I just manually downloaded r r15810 and eatdrink is working fine.
Thanks for pointing me in the right direction.
 

Crowther

Active member
Even though I'm still planning to hold the mayo, I still want to say "Thanks, Theraze!" Handling this over complicated IotM is impressive.
 

Theraze

Active member
No problem. Happy to have it be somewhat useful. :)

Think we'll start with initial Mayodiol support with single-fullness items. I'll tweak the helper check a bit more to make it work differently, I think. It might get more complicated later, but hopefully it should be able to be relatively easy to make this work. Not sure yet. But we'll see.
 

soolar

Member
I'm kind of surprised that mayoflex alone hasn't radically changed my diet. Even with an obscenely high valueOfAdventure it still has me eating hi meins and not high value size-1 foods. I bet once mayodiol support is in though, that'll be a game changer. We'll see!

Haven't actually ascended fresh since getting the mayo clinic though, and I feel like that's where it'll be the biggest diet changer.
 

Theraze

Active member
Well, the Mayodiol support is in now and should be getting used for Bale's Spaghetti Breakfasts and the like without needing to be done manually. Not sure how many cheap 1-size foods will beat out the normal booze options, but... we should see. :)
 

Theraze

Active member
And... default set to consider Mayodiol, though this won't change anyone who has already run EatDrink before.

Possible values for eatdrink_mayoClinic:
Bits:
1 - Mayodiol
2 - Mayostat
4 - Mayozapine
8 - Mayoflex

To get your combined bits, just add the values you want. So for Mayodiol and Mayoflex, 1+8=9. The maximum value is 15 for everything; the current default is 13, everything but 2 - Mayostat.

Alternatively you can set the value with more human-readable names. You can use either the actual mayo name, the plural words for results listed below or the singular - the check should work fine either way.
The following are the names you can use for each.
Mayodiol - drink or inebriety
Mayostat - items or mayoli
Mayozapine - stats or effects
Mayoflex - adventures
 
Last edited:

soolar

Member
Random other minor request. When I manually run eatdrink from the gcli, it has popups for inputs as is generally the case for .ashs with main functions with arguments. Would it be possible to make it so that if I do not enter a value for the max food/drink/spleen thresholds then it will automatically get my maximums? I do appreciate having the option to tell it to eat/drink/spleen much less, but I actually use that a minority of the time. In fact, the main case I use it in is when I'm simulating and I already ate some, since simulating always does it as if you haven't consumed anything. What if simulation didn't do that?

Also, I am consistently getting marginally different results between simulating and actually running eatdrink when it comes to my spleen. In simulation, it always uses 3 mojo filters and then consumes an antimatter wad, but in the real run it uses 2 filters and a transdermal smoke patch. Not a huge issue, but an oddity you might want to check up on?
 
Last edited:

Theraze

Active member
Mojo filter just simulates 3 if it thinks it's a good thing. Because we don't want it to actually try to use mojo filters to see if it will work, which is how it 'tests' if it should use another mojo filter. If you have one and it gets used when you use it, then it worked. We could make it try to waste them and always simulate/use either 0 or 3 depending on whether you've already consumed any mojo bits, but that would be a bad idea.

Why not just use aliases so you don't get any popups at all and it tests exactly what you want it to test? I've posted them before, but here are the aliases I use as my normal execution:
Actually consuming stuff:
Code:
eatdrink	ashq import <EatDrink.ash>; SIM_CONSUME=false; eatdrink(fullness_limit(), inebriety_limit(), spleen_limit(), false);
eatdrinkma	ashq import <EatDrink.ash>; SIM_CONSUME=false; MINIMUM_AVERAGE = %%; eatdrink(fullness_limit(), inebriety_limit(), spleen_limit(), false);
eatdrinkmq	ashq import <EatDrink.ash>; SIM_CONSUME=false; MINIMUM_QUALITY = %%; eatdrink(fullness_limit(), inebriety_limit(), spleen_limit(), false);
eatdrinknd	ashq import <EatDrink.ash>; SIM_CONSUME=false; eatdrink(fullness_limit(), 0, spleen_limit(), false);
eatdrinkndma	ashq import <EatDrink.ash>; SIM_CONSUME=false; MINIMUM_AVERAGE = %%; eatdrink(fullness_limit(), 0, spleen_limit(), false);
eatdrinkndmq	ashq import <EatDrink.ash>; SIM_CONSUME=false; MINIMUM_QUALITY = %%; eatdrink(fullness_limit(), 0, spleen_limit(), false);
eatdrinkne	ashq import <EatDrink.ash>; SIM_CONSUME=false; eatdrink(0, inebriety_limit(), spleen_limit(), false);
eatdrinknema	ashq import <EatDrink.ash>; SIM_CONSUME=false; MINIMUM_AVERAGE = %%; eatdrink(0, inebriety_limit(), spleen_limit(), false);
eatdrinknemq	ashq import <EatDrink.ash>; SIM_CONSUME=false; MINIMUM_QUALITY = %%; eatdrink(0, inebriety_limit(), spleen_limit(), false);
eatdrinkod	ashq import <EatDrink.ash>; SIM_CONSUME=false; eatdrink(fullness_limit(), inebriety_limit(), spleen_limit(), true);
eatdrinkodma	ashq import <EatDrink.ash>; SIM_CONSUME=false; MINIMUM_AVERAGE = %%; eatdrink(fullness_limit(), inebriety_limit(), spleen_limit(), true);
eatdrinkodmq	ashq import <EatDrink.ash>; SIM_CONSUME=false; MINIMUM_QUALITY = %%; eatdrink(fullness_limit(), inebriety_limit(), spleen_limit(), true);
Testing specific items to see how they compare to the 'best' item when they aren't picked:
Code:
edhave	ashq import <eatdrink.ash> update_from_mafia(to_item("%%").item_type()); update_using_mafia(to_item("%%").item_type()); foreach it in grub if (grub[it].it == to_item("%%")) print_html(availability(grub[it]).have);
edvalue	ashq import <eatdrink.ash> update_from_mafia(to_item("%%").item_type()); update_using_mafia(to_item("%%").item_type()); foreach it in grub if (grub[it].it == to_item("%%")) print_html(value(grub[it], false, false, false));
Simulating versions of the consumption bits which will use the current values:
Code:
seatdrink	ashq import <EatDrink.ash>; SIM_CONSUME=true; simfullness = my_fullness(); siminebriety = my_inebriety(); simspleen = my_spleen_use(); eatdrink(fullness_limit(), inebriety_limit(), spleen_limit(), false);
seatdrinkma	ashq import <EatDrink.ash>; SIM_CONSUME=true; MINIMUM_AVERAGE = %%; simfullness = my_fullness(); siminebriety = my_inebriety(); simspleen = my_spleen_use(); eatdrink(fullness_limit(), inebriety_limit(), spleen_limit(), false);
seatdrinkmq	ashq import <EatDrink.ash>; SIM_CONSUME=true; MINIMUM_QUALITY = %%; simfullness = my_fullness(); siminebriety = my_inebriety(); simspleen = my_spleen_use(); eatdrink(fullness_limit(), inebriety_limit(), spleen_limit(), false);
seatdrinknd	ashq import <EatDrink.ash>; SIM_CONSUME=true; simfullness = my_fullness(); siminebriety = my_inebriety(); simspleen = my_spleen_use(); eatdrink(fullness_limit(), 0, spleen_limit(), false);
seatdrinkndma	ashq import <EatDrink.ash>; SIM_CONSUME=true; MINIMUM_AVERAGE = %%; simfullness = my_fullness(); siminebriety = my_inebriety(); simspleen = my_spleen_use(); eatdrink(fullness_limit(), 0, spleen_limit(), false);
seatdrinkndmq	ashq import <EatDrink.ash>; SIM_CONSUME=true; MINIMUM_QUALITY = %%; simfullness = my_fullness(); siminebriety = my_inebriety(); simspleen = my_spleen_use(); eatdrink(fullness_limit(), 0, spleen_limit(), false);
seatdrinkne	ashq import <EatDrink.ash>; SIM_CONSUME=true; simfullness = my_fullness(); siminebriety = my_inebriety(); simspleen = my_spleen_use(); eatdrink(0, inebriety_limit(), spleen_limit(), false);
seatdrinknema	ashq import <EatDrink.ash>; SIM_CONSUME=true; MINIMUM_AVERAGE = %%; simfullness = my_fullness(); siminebriety = my_inebriety(); simspleen = my_spleen_use(); eatdrink(0, inebriety_limit(), spleen_limit(), false);
seatdrinknemq	ashq import <EatDrink.ash>; SIM_CONSUME=true; MINIMUM_QUALITY = %%; simfullness = my_fullness(); siminebriety = my_inebriety(); simspleen = my_spleen_use(); eatdrink(0, inebriety_limit(), spleen_limit(), false);
seatdrinkod	ashq import <EatDrink.ash>; SIM_CONSUME=true; simfullness = my_fullness(); siminebriety = my_inebriety(); simspleen = my_spleen_use(); eatdrink(fullness_limit(), inebriety_limit(), spleen_limit(), true);
seatdrinkodma	ashq import <EatDrink.ash>; SIM_CONSUME=true; MINIMUM_AVERAGE = %%; simfullness = my_fullness(); siminebriety = my_inebriety(); simspleen = my_spleen_use(); eatdrink(fullness_limit(), inebriety_limit(), spleen_limit(), true);
seatdrinkodmq	ashq import <EatDrink.ash>; SIM_CONSUME=true; MINIMUM_QUALITY = %%; simfullness = my_fullness(); siminebriety = my_inebriety(); simspleen = my_spleen_use(); eatdrink(fullness_limit(), inebriety_limit(), spleen_limit(), true);
 

Theraze

Active member
One change I'm thinking of making to simplify the HC MC calculations is to add a variable named mayoMeat or something similar and if you don't have at least that much meat on hand, skip Mayo calculations. By making it user configurable, if you want to simulate level 1 HC optimal mayo usage, you could, but for normal usage, it would skip using mayo until you reach 20k meat or 25k meat or whatever the default is.

Thoughts for/against? Default should be set to?
If nobody else has strong opinions in the next day or two, I'll probably default to a 25k cushion. This should hopefully make it so that you never have HC consumption fail because it's trying to get another mayoflex, even if it does decide to get 15 of them.
 
Top