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

In cases where it's not behaving right, we'd need to try to figure out why. If you feel like working through it, we can see what we can do. Otherwise, unless someone else has similar behaviour happen, fixing it will need to wait until someone else has it happen. There's the possibility that your EAT_MAKE is off or something similar, but... *shrugs*

I'm not sure it's worth working through at the moment. The only problem I'd been having with the version I rolled back to was it's inability to recognize a Bee's Hate You run and thus avoid trying to consume items with a B in their name. I'm not sure the new code that's resulting in so much wasted meat on my end is even designed to do something I see as valuable, today for example with the old version I wasted less meat on handfuls of nuts and berries and shots of blackberry schnapps I couldn't consume than I did on mall price Pumpkin Pies in the two days I ran the Bees compatible version and got a similar (possibly a bit larger) number of adventures. If I knew what you did to make it recognize a Bees Hate You run I could just slap that into the code for the version I have now and call it good (I'm assuming of course that it's other added tweaks that are resulting in buying a bunch of 17K pie and 5K wads because I don't see how "Don't consume items with a B in their name is resulting in that behavior).
 
Oh, there's a LOT of changes I've made the the other code... it's why exactly it's deciding that a 17k pie is better than making it that's the question.

To confirm... on your current version, does it make pumpkin pies, or does it do other things such as try to buy nuts and berries and the like? If your release copy of ED isn't trying to make/buy pies, it's possible that it isn't actually thinking you can make pies or something similar...
 
Worked reasonably for normal character and character in BeeCore.

Milk problem with remaining character. I've got some logs with verbose2 enabled but they don't seem especially helpful. I ran and then got the "Are you sure you want to drink without milk prompt?". I said no, consumption failed and I got into a recompute then consume loop. I bought milk manually before running and this time it just consumed it and ran as expected. The problem appears to be that for some reason EatDrink either decides that milk is not helpful (unlikely given setting of 1000 per adventure but possible) and that conflicts with the parameter that allows the prompt to occur OR eatDrink does not actually buy milk, in this particular case, when it is obtaining the rest of the food. Character has never ascended, has meat on hand and settings such that food is purchased from the mall so I don't know why milk is a special case and not being purchased.

I just checked and the character who had no problems using milk had milk in inventory and as near as I can tell, before EatDrink was run. No record of purchasing it in the session log. So the feature of not buying milk may be general and not tied to one character.

Never ascended character also has problems with TPS. Makes a cherry bomb and then keeps trying to buy remaining stuff. That makes me nervous so I abort. Remind me not to test drinking with that character until you either have specific debugging questions or you think you have handled the TPS.
 
Try simulating the drinking on the character with problems and see what it says for TPS. It's possible that because of other ingredients, it thinks it can only make one TPS drink using what you have on hand.

It's possible that something similar is happening with redwulf as well... if the Bugbear shop isn't available, but the mall is, manually running "create pumpkin pie" would buy the supplies from the mall and create the pie, but your creatable_amount is still 0, because in the guaranteed resources section, you can't make any... in your case, it's possible that you can only make one TPS using your own mixers. But if I properly understand the way I've told the code to work, as soon as it finishes making your TPS drink it should ode, consume it, and recalculate again... If creatable_amount then becomes 0 or if you've manually created the drink before (so it's not a created drink but an existing one), it keeps moving and considers what else works. Any chance you created the drink manually earlier?

Regarding milk... might be the same thing? The important part in the logs there is, how did it try to acquire the milk? Should say something along one of these lines:
verbose("Taking a "+it+" from the closet");
verbose("Failed to get one from the closet.");
verbose("Creating a "+it+" in "+pause+" seconds");
verbose("Failed to create a "+it+".");
verbose("Pulling a "+it+" in "+pause+" seconds");
verbose("Failed to pull a "+it+" from Hagnk's.");
verbose("Shopping for a "+it+" from NPCs in "+pause+" seconds");
verbose("Failed to get "+it+" for a max price of "
verbose("Shopping for a "+it+" from the mall in "+pause+" seconds");
verbose("Failed to get "+it+" for a max price of "
summarize("EatDrink encountered an error: You don't have "+needed+" "+it+" and you're not able to shop.");
summarize("EatDrink encountered an error: You don't have "+needed+" "+it+" and it has a null price, so you can't buy it.");
Shopping good, failed bad, error means it all failed. I did add the part "from NPCs" and "from the Mall" to the failure buys in the next version whenever we figure out what this issue is, but... what we need to know regarding your milk is, what methods did it try that failed? The only one completely unlikely is buying from NPCs. The others? All possibilities...
 
I'll look at logs in a bit. For the moment I can tell you that the only TPS drink ingredient in inventory is the TPS itself. EatDrink (the other version) routinely buys the remaining ingredients each time it needs them. I refuse to believe that the problem is with a mafia setting or meat available because the released version "works" and the beta doesn't. That strongly suggests to me that it is not a setting but rather what the beta is doing, or not, with a setting. In any event more later when I can mine the logs...
 
I think the issue may be that the release version of ED uses special_purchases in the mall-shop section to actually make the TPS instead of making it inside the EAT_MAKE function... it's never actually tagged as a creation, so that means it won't loop or do anything similar, and if you do have the items on-hand to make one, it's completely different code...

What I may end up doing is scrapping the creatable_amount check completely and seeing what happens. Let it buy ingredients from the mall if it's usable, but count that against the effective price... If we go this route, it'll GREATLY widen the range of items that aftercore/SC EatDrink will make, since anything possible will be considered, but also increase its mallsearch, since any ingredient usable in any food or drink item will be priced out. As long as you've got price sharing on though, this shouldn't be too bad. Sound good?
 
Sound good?
To the extent of my understanding, sure.

The string "agnes" which is what I use because I'm too lazy to deal with case insensitivity, does not occur in the session log until the point where I stopped EatDrink and bought 3 milk of magnesium manually. There is no indication that it was considered in the ED calculations, let alone an indication that ED decided milk was not worth it.
 
You'd need to read the gCLI output, not the session log, unfortunately.

Which is really too bad since with the verbosity tweaked that particular session log had over 50K lines and there was so much loading and sorting the same data that the message would have been missed anyway.
 
Yeah, I tend to run with verbosity2 disabled (per default) and verbosity on. It gives me enough information to know what's actually happening without needing to mirror the gCLI to a file to actually be able to read it because the buffer moves too fast...

Edit: Will be trying a version with a new function, get_ingredients that runs just before the obtaining of items. If it works the way I hope it does, it should (following your preferences) be more willing to craft items. Potential problem (that still exists in version above) is that I haven't forced an override on crafting yet, so it does still consider whether or not mafia says that creatable_amount is greater than 0, and rejects items that are officially uncraftable, even if you can get the ingredients in a way mafia doesn't recognize. I think the way we'd need to check creatable_amount is by doing an ingredients loop, similar to when we're making a final item check to decide if it's possible to make along with everything else...
 
Last edited:
First, I apologize if this has been posted. I searched and the only post I found was from a while ago (build 8k-something) and even that didn't have the same line number.

Running the script, I get "Map modified within foreach (eatdrink.ash, line 1131)" at the very start. I haven't used Mafia in a while so I just got the newest versions of the program, zLib, EatDrink, etc. I then ran this script and got that error. I don't think there's anything else I can update. Any clue what I'm doing wrong? Here's the full script output:

Code:
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 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 1100 meat. Moxie subpoint is 10.0. Nonprime stat subpoint is 2.0.
Already updated from http://nixietube.info/mallprices.txt in this session.
Pass 1: food.
food: At 0, consuming to 15.
Map modified within foreach (eatdrink.ash, line 1131)
 
Last time this came up, it appeared to be some sort of issue where the person's mafia execution had gotten out of sync, as a full restart of mafia fixed it in all of their cases.
 
Oh, there's a LOT of changes I've made the the other code... it's why exactly it's deciding that a 17k pie is better than making it that's the question.

To confirm... on your current version, does it make pumpkin pies, or does it do other things such as try to buy nuts and berries and the like? If your release copy of ED isn't trying to make/buy pies, it's possible that it isn't actually thinking you can make pies or something similar...

My current version isn't making the pies either, I think it's decided that if I don't have a chef in the box I can't make them. But its not buying them either. And now I just ran into a problem with my computer that nuked all my mafia files (unrelated to anything here) and have to re-install and reconfigure all my scripts.
 
Gah... sorry for your loss. So the new script decides it's possible/better, but doesn't sort it completely. Fun.

Anyways, let's see if this version does better for you and fronobulax. It actually tries to acquire and validate the ingredients before it starts to make them, so it should succeed in its crafting better, even when it has to buy components from the mall because you forgot to get the bugbear outfit or whatever. :) Here's a log of it eating from 2-15... it thought it should be able to make spaghetti, decided against it when it realized I didn't have the right skills permed, but moved on to make 3 boris pies instead.
Now, to recap...
******************************************
Starting EatDrink.ash (version 3.1.3).
Consuming up to 15 food, 19 booze, and 15 spleen
Considering food from inventory Hagnk's NPCs . Per-item budget cap is 12500.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 500 meat. Muscle subpoint is 10.0. Nonprime stat subpoint is 2.0. Hagnk pulls are limited and their 'cost' is incorporated.
food: At 2, consuming to 15.
EatDrink encountered an error: You don't have 1 spaghetti con calaveras and you're not able to shop.
food: At 2, consuming to 15.
1: Boris's key lime pie lev:6 gain:4.0 adv:15.0 musc:30.5 myst:0.0 mox:0.0 meat:1300 own:1 value:1626
food: At 6, consuming to 15.
1: Boris's key lime pie lev:6 gain:4.0 adv:15.0 musc:30.5 myst:0.0 mox:0.0 meat:1300 own:1 value:1626
food: At 10, consuming to 15.
1: Boris's key lime pie lev:6 gain:4.0 adv:15.0 musc:30.5 myst:0.0 mox:0.0 meat:1300 own:1 value:1626
food: At 14, consuming to 15.
1: royal jelly taco lev:1 gain:1.0 adv:2.0 musc:12.0 myst:0.0 mox:0.0 meat:132 own:1 value:988
spleen: At 5, consuming to 15.
Best find was none with a value of 0. That's no good, so not consuming and moving on.
Finished.
Spent 320 meat. Gained Fullness: 13. Inebriety: 0. Spleen: 0.
Adventures: 43. Muscle: 95. Moxie: 0. Mysticality: 0.
Eating, drinking, and spleening complete. Commence merrymaking (at your own discretion).
 
#875 version. On the problem character it purchased one milk this time around but the milk lasted for 10 fullness and it was slated to consume 15. Step in the right direction.
 
#875 seems to handle TPS much better. It made then consumed. I didn't see any evidence that it planned on consuming three of them and but the fruit and booze for all three before consuming any but the infinite loop seems to be gone.
 
#875 version. On the problem character it purchased one milk this time around but the milk lasted for 10 fullness and it was slated to consume 15. Step in the right direction.

Assuming you mean that it only bought 1 milk, but needed 2 to complete it? What it's actually supposed to do is buy/consume the milk immediately before it would be used... if you have 2 turns left, and you're eating a 3 fullness item, milk-up. If you're doing a 2 fullness item and then a 3 after... eat the 2 item, and then do the milk after. If it still makes sense based on Value of Adventure, which it should in all cases above 14 of 15 fullness.

#875 seems to handle TPS much better. It made then consumed. I didn't see any evidence that it planned on consuming three of them and but the fruit and booze for all three before consuming any but the infinite loop seems to be gone.

Yes... with items like TPS drinks and KLP food, it can't (easily) predict whether or not the items will be around for the future. Since it's better to have it use the standard stack, what they do is end the processing once it hits one of them and moves on to the next step; it stops deciding what it'll eat next and starts trying to obtain the ingredients to make what it's found (likely one TPS, not 3), then it consumes it, and restarts the same step, checking based on current ingredients available to you.

Still remaining there, I need to check for TPS and KLP being bought or premade. If you have one and consume it, that might change your decision on further eating/drinking choices. Since most people probably don't have 3 TPS, the chance of getting something better between your premade one and the rest of your drinking is moderately low... :)
 
Assuming you mean that it only bought 1 milk, but needed 2 to complete it?

Yes. I got the "Do you want to eat without milk?" prompt which means (AFAIK) that the number or turns of milk left is less than the fullness of the food about to be consumed. The solution is to buy more milk and there was no evidence that it even tried after the first.
 
The message when you have too few turns of milk left is "Milk will run out before you are finished eating, are you sure" or something similar. "Do you want to eat without milk" is, I think, for when you have no milk at all active.
 
Back
Top