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

lostcalpolydude

Developer
Staff member
That seems like something mafia should check for, I think. A popup is the first thing that comes to mind, with overdrink() (not particularly well named for that purpose, but it already exists) and eatsilent() to skip them in a script.
 

Theraze

Active member
If you don't want to eat/drink those first, easy... just add them to the avoid list. EatDrink won't use them anymore.
If you want to propose switching up the order of things and using spleen before food/drink, that's relatively easy too... All I need to do is switch up a few bits and spleen happens first, then if it decides that they're the cheapest, it would end up with spleen left... though you'd need to re-run ED to fill spleen up again, but that should be a fast execution at that point.

But if you don't like using the (relatively) easy solution of running spleen first, and you want to keep it in the order it's in where food/drink will be completely full and therefore unable to benefit your spleen when it gets done... what does it really matter whether it would have benefited your spleen or not? It's full already, and anything it could have done is useless/hypothetical.

Alternatively, if you think this is a mafia flaw, then make your FReq in the mafia bug board and see if you can word your request clearly enough for a developer.
 
redwulf clearly stated being aware of that, but from an optimisation stand point I would definitely say that using that kind of food and drink before spleening is not optimal. I think it would be a good idea to consider at least :)

Yeah. I wasn't even intending to use it at all (I'm used to eatdrink taking more time considering what to consume than it did last night and thought I'd be able to closet it in time). If I'd intended to use it I would have spleened first, but it seems that if someone DOES want to use the sliders and/or pickle juice in their inventory (or maybe someone's having a killer sale in the mall and the script decides they're cost efficient) that there are ways to alter the script so that using them efficiently remains as simple as executing the script and plugging in 15/19/15. Plus it has the bonus of at least not wasting the spleen cleaning if you forget to closet them.

After all, isn't using food booze and spleen items in the most efficient way possible the point of the script?

Now, my scripting blows but one idea I have on a quick and dirty way to accomplish the task would be to have it spleen (to whatever you input for the spleen counter) first, then eat and drink to the fullness/drunkenness specified then try to spleen again to the same number. I'm not sure how difficult that would be to code or if it would add substantially to run time but it would make use of spleen cleaning food and drink as simple as just using the script.
 
Last edited:

slyz

Developer
Yes, there should be a way for EatDrink to take into account the full/drink/spleen wiping items, like sliders, pickle juice and maybe even melange. It's definitively not easy to do, though.
 

zezima

New member
How come my eatdrink is searching for just about every possible item for consumption each time i run it, it was working quite fast for quite a while then i got this problem.
 

Theraze

Active member
You probably have your eatdrink_maxAge set too low. It defaults to checking the mall if the prices are older than 2 hours, but if you want 6 hours or longer... just raise it.

Alternatively, if it happen as soon as you've launched mafia, and it still checks everything, you might not have the sharePriceData mafia property set to true.
 

Banana Lord

Member
I'm sure there's a simple explanation for this, but I've been testing my development version of Harvest on a different account and ED didn't fill the character's organs completely:
Code:
Refreshing stash contents...
Stash list retrieved.
Internal checkpoint created.
Skipping favorites.
Starting EatDrink.ash (version 3.1.5).
Consuming up to 15 food, 14 booze, and 15 spleen
Considering food from inventory Hagnk's. Per-item budget cap is 25000.0.
Retrieval cap is 20000. Price will be a factor if you own it already.
An adventure has the value of 500 meat. Muscle subpoint is 10.0. Nonprime stat subpoint is 2.0.
Pass 1: food.
food: At 0, consuming to 15 with 5000 meat.
Searching for "bowl of cottage cheese"...
Search complete.
No food available that's good enough. Found 5 items first. Moving on.
Waiting to consume...
bowl of cottage cheese lev:1 gain:2.0 adv:2.0 musc:0.0 myst:0.0 mox:0.0 meat:0 own:0 value:450
Countdown: 3 seconds…a
Countdown: 2 seconds...
Countdown: 1 second...
Waiting completed.
Searching for "milk of magnesium"...
Search complete.
Getting 1 milk of magnesium in 3 seconds
Countdown: 3 seconds...
Countdown: 2 seconds...
Countdown: 1 second...
Waiting completed.
autoBuyPriceLimit => 1242.0
You need 1 more milk of magnesium to continue.
autoBuyPriceLimit => 20000
EatDrink encountered an error: You don't have 1 milk of magnesium and you're not able to shop.
Eating 1 bowl of cottage cheese...
You gain 2 Adventures
Finished eating 1 bowl of cottage cheese.
1: bowl of cottage cheese lev:1 gain:2.0 adv:2.0 musc:0.0 myst:0.0 mox:0.0 meat:0 own:0 value:450
Waiting to consume...
bowl of cottage cheese lev:1 gain:2.0 adv:2.0 musc:0.0 myst:0.0 mox:0.0 meat:0 own:0 value:500
Countdown: 3 seconds...
Countdown: 2 seconds...
Countdown: 1 second...
Waiting completed.
Eating 1 bowl of cottage cheese...
You gain 2 Adventures
Finished eating 1 bowl of cottage cheese.
2: bowl of cottage cheese lev:1 gain:2.0 adv:2.0 musc:0.0 myst:0.0 mox:0.0 meat:0 own:0 value:500
Waiting to consume...
bowl of cottage cheese lev:1 gain:2.0 adv:2.0 musc:0.0 myst:0.0 mox:0.0 meat:0 own:0 value:500
Countdown: 3 seconds...
Countdown: 2 seconds...
Countdown: 1 second...
Waiting completed.
Eating 1 bowl of cottage cheese...
You gain 2 Adventures
Finished eating 1 bowl of cottage cheese.
3: bowl of cottage cheese lev:1 gain:2.0 adv:2.0 musc:0.0 myst:0.0 mox:0.0 meat:0 own:0 value:500
Waiting to consume...
bowl of cottage cheese lev:1 gain:2.0 adv:2.0 musc:0.0 myst:0.0 mox:0.0 meat:0 own:0 value:500
Countdown: 3 seconds...
Countdown: 2 seconds...
Countdown: 1 second...
Waiting completed.
Eating 1 bowl of cottage cheese...
You gain 2 Adventures
Finished eating 1 bowl of cottage cheese.
4: bowl of cottage cheese lev:1 gain:2.0 adv:2.0 musc:0.0 myst:0.0 mox:0.0 meat:0 own:0 value:500
Waiting to consume...
bowl of cottage cheese lev:1 gain:2.0 adv:2.0 musc:0.0 myst:0.0 mox:0.0 meat:0 own:0 value:500
Countdown: 3 seconds...
Countdown: 2 seconds...
Countdown: 1 second...
Waiting completed.
Eating 1 bowl of cottage cheese...
You gain 2 Adventures
Finished eating 1 bowl of cottage cheese.
5: bowl of cottage cheese lev:1 gain:2.0 adv:2.0 musc:0.0 myst:0.0 mox:0.0 meat:0 own:0 value:500
Pass 2: drink.
drink: At 0, consuming to 14 with 5000 meat.
No drink available that's good enough. Found 0 items first. Moving on.
Pass 3: spleen.
spleen: At 0, consuming to 15 with 5000 meat.
No spleen available that's good enough. Found 0 items first. Moving on.
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: 10. Inebriety: 0. Spleen: 0.
Adventures: 10. 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.5).
Consuming up to 15 food, 14 booze, and 15 spleen
Considering food from inventory Hagnk's. Per-item budget cap is 25000.0.
Retrieval cap is 20000. Price will be a factor if you own it already.
An adventure has the value of 500 meat. Muscle subpoint is 10.0. Nonprime stat subpoint is 2.0.
food: At 0, consuming to 15 with 5000 meat.
EatDrink encountered an error: You don't have 1 milk of magnesium and you're not able to shop.
1: bowl of cottage cheese lev:1 gain:2.0 adv:2.0 musc:0.0 myst:0.0 mox:0.0 meat:0 own:0 value:450
2: bowl of cottage cheese lev:1 gain:2.0 adv:2.0 musc:0.0 myst:0.0 mox:0.0 meat:0 own:0 value:500
3: bowl of cottage cheese lev:1 gain:2.0 adv:2.0 musc:0.0 myst:0.0 mox:0.0 meat:0 own:0 value:500
4: bowl of cottage cheese lev:1 gain:2.0 adv:2.0 musc:0.0 myst:0.0 mox:0.0 meat:0 own:0 value:500
5: bowl of cottage cheese lev:1 gain:2.0 adv:2.0 musc:0.0 myst:0.0 mox:0.0 meat:0 own:0 value:500
drink: At 0, consuming to 14 with 5000 meat.
spleen: At 0, consuming to 15 with 5000 meat.
Finished. You had -Ode to Booze in effect. Adventures listed above does not reflect that, but this does:
Spent 0 meat. Gained Fullness: 10. Inebriety: 0. Spleen: 0.
Adventures: 10. Muscle: 0. Moxie: 0. Mysticality: 0.
Eating, drinking, and spleening complete. Commence merrymaking (at your own discretion).
The character has plenty of meat and ED didn't hit its budget cap so I'm not really sure what's going on. Thanks!
 

Theraze

Active member
Two things. One, using available locations, it could only find 5 items, as per this:
No food available that's good enough. Found 5 items first. Moving on.
Second, you only allowed your inventory and storage:
Considering food from inventory Hagnk's.
If you want to have it consider NPCs and the mall, you have to allow those...
 

Banana Lord

Member
Thanks, it's been a very long time since I set ED up from scratch on an account. The settings that ED uses could be quite hard for a new user to find don't you think? They're spread across three files (global prefs, vars and <playername> prefs). Is there an ED relay script in the works?
 

Theraze

Active member
Unlikely... the settings it uses on purchasing items are the same settings the characters are using for other automatic scripts, so that's not an EatDrink setting, exactly. If we ever go back to fully custom retrieval and not using mafia's settings... maybe. :)
 

Theraze

Active member
It's actually just a regular mafia preference, VALUE_OF_ADVENTURE, and there are already mafia preference relay editors...
 

Banana Lord

Member
You've already got one. The Value of Adventure setting in Harvest's relay script adjusts mafia's inbuilt valueOfadventure property.
 

crankyflip

New member
Is there any way to have EatDrink take account for food that delevels your stats? Tried putting "int primemeat" at any negative amount, but the script only gets food that doesn't add stats to my mainstat rather than getting food that removes substats instead.
 

fronobulax

Developer
Staff member
@cranky - I don't think so. I suspect that deliberately losing stats is suboptimal in so many cases that it was never even considered as something people would want. If you are going for a trophy or something similar you probably have to do some manual consumption.

@Theraze - since I have gleefully placed the mantle of EatDrink expert on your shoulders how do you expect ED to handle the new fudge stuff? I figure mafia's support is robust enough that it will at least consume them if in inventory and cheap enough in the mall. Will fudge spork as a helper be 'discovered' or will ED need a tweak? Will it choose between wand waving (with the Coinmaster support in place) and mall purchase? Any other expectations? Thanks.
 

Theraze

Active member
We use retrieve_item, so it will get it however mafia thinks is the least expensive way to do it. It doesn't specifically use any consumption helpers currently... if mafia detects and uses them, great, but... no such code as yet, nor for Crimbco mugs or any other helpers. But consumption itself? Sure... it should do that automatically based on mall price.

Regarding cranky's request... just put your primestat value down lower. Ignore primemeat, unless you're actually using the long version of eatdrink(), in which case you wouldn't be defining it, you'd be sending it. The proper value is actually named "VALUE_OF_PRIME_STAT" without the quotes... something like
ashq import <eatdrink.ash> VALUE_OF_PRIME_STAT = -1000; eatdrink(15, 19, 15, false);
should work. Just remember to run a few tests first. I've done that a time or two when I was needing more adventures at level 13 on the NS tower... helped to get me that extra karma. :)

Edit: Was actually thinking about it and that's not completely true... it does wear the tuxedo shirt if you have one and you're drinking something that will benefit. But that's reusable. :)
 
Last edited:

crankyflip

New member
Yeah, my intent of asking for negative stat food was because I wanted to stay at level 13 for the NS. However, the code that you mentioned Theraze doesn't work as I wanted it to either. It still recommends me eating spooky lo mein instead.

Yeah, spooky lo mein doesn't add mys stats, but it doesn't reduce them either. I have Double Bacon Beelzeburgers that can do that, but EatDrink won't consider them at all.
 

Theraze

Active member
What do you have your VALUE_OF_ADVENTURE set to? Remember that adventures are generally worth a ton more than stats, so it will take quite a bit of negative stat value to balance it out. Also, that's why you go with simulations... Anyways, if 1000 isn't enough, try 10000. Or try dropping VoA temporarily to the 500 that mafia defaults to, if you've raised it. Or just eat your stat dropping burgers. :)
 

fronobulax

Developer
Staff member
I've seen this several times. I have a TPS, boxen and have checked both require and auto repair in mafia. I run ED to fullness and my bartender explodes on the last drink. I adventure then overdrink and ED does not select a TPS drink. I presume that is because there is no bartender at the moment. What I would like would be for mafia to repair immediately after explosion and not wait until my next crafting session, or ED to acquire and use a bartender or tell me one is not present. I can think of numerous reasons why these behaviors, which work for me in permanent aftercore, would not be a good thing for the general population, but how close can I come with existing switches? Which parameters should I be checking?

Thanks.
 

Theraze

Active member
Okay... changelog since 1226, since that's the most recent version. This fixes a personal peeve, noted working correctly thus:
spleen: At 0, consuming to 15 with 4680 meat.
1: oily paste lev:4 gain:4.0 adv:7.5 musc:20.0 myst:20.0 mox:20.0 meat:3795 own:0 value:1465
2: spooky wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:27.0 mox:18.0 meat:519 own:0 value:983
3: spooky wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:27.0 mox:18.0 meat:519 own:0 value:983
choc: Checking non-filling crimbo chocolates - all 3 kinds
Sure, it's only 6 spleen filled... but that's all that can/should be done with 5000 meat. If I drop the adventure value more, it only gets 6 adventures instead of 8.5 for that value... so hopefully STEP_MEAT should finally be working right and limiting total outlay, not looping spleen when it can't be filled but mojo-filters are skipped because they aren't economical.

Also implemented GET_BARTENDER and GET_CHEF. Bit more noting on it below... if we want to tweak this or have it check multiple times before/after getting items, we could do that as well, just let me know.

Implemented since last mentioned:
1259: Finally implemented the GET_BARTENDER and GET_CHEF bits. These have (of longstanding) been set by EatDrink to default to false, but never (that I could find) did anything. Now they will get you a bartender or chef and install them if have_bartender/chef returns false and you have them set to true, while the item retrieval happens.
1260: Fixed another mojo filter loop.

To be done - Definitely:
1069: Coinmaster (besides hermit) handling - Need decision on token mall price, item mall price, or lowest of the two - will probably use retrieve_item on tokens but will need custom override for hermit due to available_amount not calculating how many we can get with gum
1200: Work around mafia's new retrieve_item code - mafia recalculates the 'cheapest' way to get something as spending more money and getting more, which sometimes makes ED fail because it's spending more initially, but there might not be a good way to avoid this - Best solution would be more parameters for a speculative RI that tells us how much meat it's spending to save us meat, which we'll probably use for updating the effective price as well
 

Attachments

  • EatDrink.ash
    92.5 KB · Views: 41
Top