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

Theraze

Active member
There we go... think (again) I finally found the ingredient bug that was plaguing me. Short summary is when checking for creatable items, it would pass back the modified stack as the total 'to try to get' stack. So eventually it would decide that it was possible, if it could reduce the loop by even a single item. So with 1 bottle of whiskey in inventory, and needing 2, it would be possible, because first the stack goes to needing 1 bottle of whiskey that needs to be created, and then you reuse that first bottle of whiskey during the 'can I create another bottle?' query and it decides that yes, you can create a second bottle even though it lied...

Second bug, discovered by adding that... on creatable items that you can't actually make at the time (for example, alcohol if not on a frat war run) it would loop forever to try to make the item. Put a loop-check that if you're already trying to make an item, don't check to see if you can make the item again. When I saw this, it was looping forever trying to make a bottle of whiskey.

Added feature/zlib variable: EatDrink_accordionGet, defaults to false. If false, it will calculate accordion turns based on your best accordion. If true, it will try to get a stolen accordion using chewing gum if you don't have one of the top 3 accordions. If you have at least 2 adventures left, it will try to get a RnR Legend.

Fixed bug: Milk turns needed was adding the value of the currently eaten item, multiplied by how many items were being eaten. So in a 11 stack, where the first item has 5 fullness and the other 10 were 1 fullness, it would calculate out at 55 fullness total. Fixed to properly add the fullness count for each item in the stack instead. Also applying this to the ode stack, now that there is one, which leads to...

Added function: ode_does_liver_good. This checks for if ode is possible to cast, and prices out how much it's worth to you based on your VOA. It also adds Ode summary information.

Goals remaining: Coinmaster features. Otherwise, I think this should be good...
 

Attachments

  • EatDrink.ash
    93.8 KB · Views: 70
Last edited:
Newest version seems unwilling to pull from storage in ronin. I double checked that I am permitting it to and even set the value of a pull to 0 so I know that it's not making the decision based on the cost of a pull.

For example:
Code:
Getting 1 Russian Ice in 0 seconds
Searching for "Russian Ice"...
Search complete.
autoBuyPriceLimit => 1500.0
You need 1 more Russian Ice to continue.
autoBuyPriceLimit => 8000
EatDrink encountered an error: You don't have 1 Russian Ice and you're not able to shop.
Something went wrong with getting Russian Ice for 1250. Recalculating.

But I had one. It was just in Hangks.
 

Theraze

Active member
Any chance you can post this part of your results?
Considering food from inventory Hagnk's the mall. Per-item budget cap is 25000.0.
Also, question... are you using overrides on any of the values, or just using the 4 value (fullness/drink/spleen/overdrink) version?
 
Any chance you can post this part of your results?Also, question... are you using overrides on any of the values, or just using the 4 value (fullness/drink/spleen/overdrink) version?

This part?

Code:
Considering food from inventory Hagnk's NPCs. Per-item budget cap is 7500.0.
Price will not be a factor if you own it already. Hagnk's pulls (if enabled) will cost 0 meat each.
An adventure has the value of 1000 meat. Muscle subpoint is 0.0. Nonprime stat subpoint is 0.0. Hagnk pulls are limited and their 'cost' is incorporated.

I've got my minimum average set to 1.0 and my minimum quality set to 1.

I also noticed today that it wants me to eat my key lime pies, it says I need a Boris's key lime to continue but I have a fully made pie in storage that it seems to be ignoring in favor of wanting the lime to make it.

Edit: Nope. It actually wants the key itself so it can make the lime from scratch when I have the whole pie. Which would be counter productive.
 
Last edited:

fronobulax

Developer
Staff member
Edit: Nope. It actually wants the key itself so it can make the lime from scratch when I have the whole pie. Which would be counter productive.

Any chance that it is actually cheaper, using your settings, to make the pie than to buy it? Cheaper in this case means if you put the pie you already have in the mall, sell it at the current price, and make and eat one you will have more meat than if you just consumed the pie you already have?
 
Any chance that it is actually cheaper, using your settings, to make the pie than to buy it? Cheaper in this case means if you put the pie you already have in the mall, sell it at the current price, and make and eat one you will have more meat than if you just consumed the pie you already have?

Even if that's the case the value of a pull is set to zero and it's set to not consider the price of items in my inventory and I have a fully made pie of the type it's trying to make sitting in Hangks. So even if it's cheaper to make a pie than buy it the best way to go about making the pie would be to pull the one I've already got and eat it so I have the key.
 
Last edited:

Theraze

Active member
And two replies latest, having quoted the question in the first one... still no answer on how you're launching EatDrink? :(
 

fronobulax

Developer
Staff member
Even if that's the case the value of a pull is set to zero and it's set to not consider the price of items in my inventory and I have a fully made pie of the type it's trying to make sitting in Hangks. So even if it's cheaper to make a pie than buy it the best way to go about making the pie would be to pull the one I've already got and eat it so I have the key.

I have never seen EatDrink actually pull anything from Hagnk's. Perhaps the issue here is that the "pull" logic is incorrect?
 

Theraze

Active member
It just uses retrieve_item currently... you requested it move closer to mafia's system (respect the user's mafia preferences in terms of acquisition) at some point in the last 10 pages or so. Note also that I show 40 posts per page, so that would be the last 40 pages or so for a normal person. :)

I'm feeling somewhat tempted though to scrap the mafia retrieve logic and go back to manually crafting/buying/pulling items. The negative of this is that I'd need to change the current position map to a record type that involves how to get each item. The positive is we can revisit the priority of items. Considering that maybe ronin-pulls should be prioritized lower than the old priority.

So, 2 questions here:
One, do we want to go back to mistrusting mafia's retrieve code? Main benefit here is that we should be able to guarantee that we're getting the item the way we want to get it and we can once again do overrides... currently if you set EAT_SHOP and haven't allowed buying from NPCs in mafia's settings, it will believe it can buy from them, but will fail to actually get it. I was going to have it run through try/finally to allow for these overrides again, but if we're scrapping the retrieve_item bit, we don't need that.
Two, dependent on the first... do we want to change the order of item retrieval? Current/former order:
1) Inventory
2) Closet
3) Create
4) Hagnk
5) NPCs
6) Mall

Coinmasters would need to fit in there somewhere... probably between 5 and 6.
Since Hagnk is free in aftercore, I'd probably put it above crafting if get_ronin is false, and possibly move it below NPCs for ronin times, since cost+3000 is likely to be more than NPC cost.
 
And two replies latest, having quoted the question in the first one... still no answer on how you're launching EatDrink? :(

Is that what this meant?

Also, question... are you using overrides on any of the values, or just using the 4 value (fullness/drink/spleen/overdrink) version?

I didn't fully understand the question and thought it was about my zlib settings. I launch it by typing eatdrink into the cli, nothing else.
 

Theraze

Active member
Ah. *nods* Exactly, yes. So if it's telling the truth in the wiki and the spot where it assumes you're out of ronin (0 cost instead of 3000) is correct... something's up. Because item creation with missing components is the second to last step on the order...

So... back to the question... do we scrap using mafia's built-in item handling, or do I troubleshoot why it's not working the way the wiki says it should?
 

fronobulax

Developer
Staff member
So... back to the question... do we scrap using mafia's built-in item handling, or do I troubleshoot why it's not working the way the wiki says it should?

I can't say that I am following all the subtleties of the discussion but as a general rule if there is even the slightest hint that something in mafia is not working the way it is intended or expected then there would be great service to the community to track that down and depending upon the results make a BR/FR, update the documentation on the wiki or withdraw the suggestion that there was a mafia problem.

So I vote for troubleshooting before any other serious discussion.

My preference is always to have mafia do something it is already doing and if that is not quite what is desired or needed then make a BR/FR.
 

Theraze

Active member
Well, the issue is that mafia doesn't have the capability currently to avoid using an item from your stash/inventory if you so choose... I asked about it and was told retrieve_item will always use your storage if you're in aftercore... no choice to avoid it. As well, if you want to avoid crafting, don't think there's any way to avoid that, if you have all the ingredients in your inventory.

Basically, we can try to trace this out if we want to, but if we want to remain able to say exactly what possible locations we want to use, we need to go back to using custom code.
 

fronobulax

Developer
Staff member
Well, the issue is that mafia doesn't have the capability currently to avoid using an item from your stash/inventory if you so choose... I asked about it and was told retrieve_item will always use your storage if you're in aftercore... no choice to avoid it. As well, if you want to avoid crafting, don't think there's any way to avoid that, if you have all the ingredients in your inventory.

Basically, we can try to trace this out if we want to, but if we want to remain able to say exactly what possible locations we want to use, we need to go back to using custom code.

So now you have identified two specific things that could be investigated and possibly turned into FRs or just changed. Keep reminding me of them so I can investigate.

That said, are you saying retrieve_item does not honor "Take items from the closet whenever needed" and "Take item from the clan stash whenever needed", the various "buy from" preferences and the "require in-a-boxes", the Creatables "use closet" and the usable/Food or Drink "no create"? Perhaps more precise definitions of "stash/inventory" and "storage" are required before an investigation will be useful?

My preference, based upon simplification and reuse would be to have EatDrink just honor all of those preferences and in whatever order KoLmafia enforces. Thus I think the only thing that is missing is pulls from Hagnk's and special, user enabled, EatDrink specific options would be appropriate for that.

If something is to be avoided for every other purpose but EatDrink the user puts it in the Coloset and unchecks "take from closet". Why not require the EatDrink user to do the same?
 

Theraze

Active member
Nope... I mean there's no "Take item from storage/Hagnk whenever needed" which is a distinction that EatDrink, as it currently stands, does have. As well, you (in EatDrink) can disable using your inventory if you want to only use the mall or something... this is not an option if we keep using retrieve_item.

The question is if we want to reduce functionality that currently exists (opt out of using storage and/or inventory, override your automatic mafia settings by using the 9+ variable execution run, etc) in EatDrink? As it currently stands, those variable versions still exist... they just do nothing in terms of item availability.

If reduced functionality isn't a problem, I'll:
1) Completely scrap the Hagnk elimination while out of ronin (always available if mafia would use it), and scrap existing-inventory elimination always
2) Remove the legacy variable executions... no sense in teasing people with variables that won't work
3) Provide new multi-variable executions with only the functions that actually matter
 

fronobulax

Developer
Staff member
I would be in favor of ED using pulls. If in ronin a pull has a cost and the total number of pulls ED would use is limited to a user preference. Out of ronin a pull is free and they are unlimited. Personally I do not understand why someone would leave stuff in Hagnks once they were out of ronin but there is no point in making everyone conform to my play style ;-)

I see no benefit to ED having a "disable inventory" option. If that is desired then I would provide it by saving the state of the closet flag, setting mafia so it is not allowed to use the closet. moving "everything" into the closet, letting ED do its thing, removing the items just added from the closet and restoring the closet flag to its prior value. So if the existing feature truly has value then I would certainly consider implementing it differently.

I do agree that automation requires some safety checks. In a perfect world, ED would never spend more that XXXX meat in a day and would never buy or use an item that has an historical_price greater than YYYY.

In other news the latest version failed to find anything to consume for a level 4 character with bat-wing stir fry in inventory whereas the old version was happy to consume them. Perhaps we have lost focus?
 

Winterbay

Active member
Personally I do not understand why someone would leave stuff in Hagnks once they were out of ronin but there is no point in making everyone conform to my play style ;-)

Mainly because if you go to the relay browser and pull everything you have an inventory that is neigh unusable due to the vast amount of stuff in it. It is then easier to just pull the things you need instead of having it all there. At least that is my way of seeing it, using Mafia makes searching through things easy, but in the native interface it is most definitely not.
 

lostcalpolydude

Developer
Staff member
I have a script to pull the 150 or so items I use in aftercore (and I add items whenever I realize I want something else regularly) that I run after freeing the king. Even just filtering with the Item Manager is faster when you can type fewer characters because there are fewer items to match against.

Also, someone might want to avoid using something so they have it for their next ascension, maybe.
 

Theraze

Active member
In other news the latest version failed to find anything to consume for a level 4 character with bat-wing stir fry in inventory whereas the old version was happy to consume them. Perhaps we have lost focus?
Any chance this character is in a BHY run? My version has a be_good check, the released version doesn't.

I think we've had some arguments for why avoiding item areas that mafia auto-uses would be a good thing. So... do we go back to custom retrieval or do we keep using mafia and just remove the ability to set consumption locations manually? The way I read Winterbay and lost, the functionality to avoid filling the relay browser is appreciated...
 

fronobulax

Developer
Staff member
Any chance this character is in a BHY run? My version has a be_good check, the released version doesn't.

Nope.

I think we've had some arguments for why avoiding item areas that mafia auto-uses would be a good thing. So... do we go back to custom retrieval or do we keep using mafia and just remove the ability to set consumption locations manually? The way I read Winterbay and lost, the functionality to avoid filling the relay browser is appreciated...

If I sound confused and if I am contradicting myself, some of it must be due to the fact that you never seem to use the same vocabulary in successive posts ;-) "item areas"? "consumption locations"?

I would be in favor of ED using pulls. If in ronin a pull has a cost and the total number of pulls ED would use is limited to a user preference. Out of ronin a pull is free and they are unlimited.
 
Top