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

So to return to a previous question, how can I make it stop doing this?
At drunkenness of 19. Overdrinking with 10000 meat.
Getting 1 sangria del diablo in 3 seconds
Countdown: 3 seconds...
Countdown: 2 seconds...
Countdown: 1 second...
Waiting completed.
autoBuyPriceLimit => 1000.0
Verifying ingredients for sangria del diablo (1)...
Verifying ingredients for skewered cherry (1)...
Searching for "cherry"...
Search complete.
Stopped purchasing cherry @ 1,095.
Using cached search results for cherry...
Stopped purchasing cherry @ 1,095.
You need 1 more cherry to continue.
autoBuyPriceLimit => 20000
Something went wrong with getting sangria del diablo for 2290. Recalculating.

What can I tell ED so that it either does not recompute autoBuyPriceLimit or so that it computes a higher value?
 
Somewhat, yes... I believe in the old way, it would display how many you had left just before/after you ate the item, but the bottom line was that it never showed the same number if you ate more than one. A touch bizarre, but... eh. Least it should work using the 1158 (not the 1157 debug) build.

Easiest thing to do there is raise your price flexibility... it will never go higher than your autoBuyPriceLimit regardless of what you set for flexibility, so if you want it to double its range, set flexibility to 200 and it shouldn't fail on badly malled items.
 
Last edited:
Easiest thing to do there is raise your price flexibility... it will never go higher than your autoBuyPriceLimit regardless of what you set for flexibility, so if you want it to double its range, set flexibility to 200 and it shouldn't fail on badly malled items.

But as noted above, my autoBuyPriceLimit is 20000. What does that mean if it does not give mafia permission to buy whatever it wants so long as it never spends more than 20000 meat on a single item? 1050 < 20000 so what am I not understanding?
 
The EatDrinkO used a function named get_on_budget... actually, let me just paste that little definition in here:
Code:
boolean get_on_budget(int totalquantity, item it, int maxprice)
How many you wanted total, what item, and how much you want to pay, at most, for it. If you had enough meat to buy it, it would do this:
Code:
     int temp = buy(quantity, it, budget);
If there wasn't enough meat to buy the items properly, it would do this:
Code:
     verbose ("That doesn't appear to be enough meat, but maybe it's cheap (or maybe you've got some in the closet).  Either way, let's try.");
     boolean retrieve_return_value = retrieve_item(quantity, it);
Your sangria's creation fell under this:
Code:
  else if (it == $item[sangria del diablo])
  {
    get_on_budget(2, $item[cherry], 
		  mall_price($item[cherry]) * PRICE_FLEXIBILITY);
    get_on_budget(1, $item[boxed wine], 
		  mall_price($item[boxed wine]) * PRICE_FLEXIBILITY);
    special = create(1, it);
  }

Looking at the mall currently, 1095 is the proper 5th price for a cherry. It should have been able to purchase the cherry on budget, just like the EatDrinkO would have...

To get back to how this all relates, since we're using retrieve_item instead of custom code, we can't set different values for different bits, but we do have autoBuyPriceLimit. We don't want to screw someone over by spending 20k for a single item though, so we set autoBuyPriceLimit to mall_price * flexibility, just like EatDrinkO did with its get_on_budget function.
 
Last edited:
Why should I have to tweak price flexibility to handle one special case? Why not make that special case conform and use the buy limit instead?
 
That does buy(2, $item[cherry], price*flexible). We now do autoBuyPriceLimit = price*flexible, retrieve_item(2, $item[cherry]). Same difference one way or another. We're retrieving the item with a price limit.

Long as you haven't disabled buying items, both ways should return the same result. If you disabled buying from the mall... we shouldn't try to buy from the mall against your will. Even on weird items.
 
What do you think autoPriceBuyLimit is supposed to mean? I thought, and my recollection of the mafia code I looked at, is that the preference means that mafia is allowed to buy any single item from the mall at that price. Thus it should buy cherries as long as it can get them for less than 20,000.

You are resetting autoPriceBuyLimit for ED's own nefarious purposes.

I suspect what we have is that autoBuyPriceLimit and ED's PRICE_FLEXIBILITY are being used to control similar things when they should not be. More later.
 
Starting EatDrink.ash (version 3.1.3).
Consuming up to 15 food, 19 booze, and 15 spleen
Considering food from inventory Hangk's 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 500 meat. Moxie subpoint is 1.0 Nonprime stat subpoint is 1.0
Simulating only; no purchases or food/drink/spleen consumption.
food: At 0, consuming to 15.
Best find was none with a value of 0. That's no good, so not consuming and moving on.



This is my first time using this script. I'm in aftercore just wanting to eat efficiently for meat farming. I've read through the script to see what it does, but I haven't programmed in ASH myself. I have ~100k on hand and more in the closet. I also have plenty of food in my inventory. Are there really no foods in the entire kingdom that it would be efficient for me to eat?

Also, when I run the script, I get some error messages:

The string "awesome" is not a float; returning 0.0 (EatDrink.ash, line 303)
The string "good" is not a float; returning 0.0 (EatDrink.ash, line 303)

(etc. many lines of the same error message
 
Last edited:
Whe way I understand autoBuyPriceLimit is that it's the max price for a single item. The way I understand old ED's get_on_budget is it's the max price for a single item. By default, setting aBPL is the only way, using default mafia, to allow for getting an item using retrieve_item while spending a specific cost or less total meat.

If we have custom retrieval code, we can go back to using buy explicitly with a price... but you requested we scrap the custom code dreams back in 1092 and 1094, so... I mention parts where not using the mafia code would make it easier, but haven't been putting it back in. :)

PF is used like this: aBPL = min(mall_price*PF,old aBPL). For the record, even if we go to using custom code, we're still going to use the same aBPL... it's just that we're going to get to explicitly call buy on it, so if you've got some weird thing going on that breaks mafia wanting to buy automatically... it should still work. Also, we wouldn't need to set aBPL, we'd just use it similar to that usage line I gave above... since we can pass the value to buy, we can work with a max value.

It's possible though that creation is actually smarter with this current system than using custom code. If you just run create <item> normally, it will follow your settings and create. If you don't have enough and the parts are purchasable under aBPL (if mall and/or NPCs are on), it will automatically procure them... but it'd use the aBPL of 20k instead of whatever the 'right' price*flexibility is. Hopefully there isn't a run on any of the poorly-stocked items. :) On our system, we tell it not to try to spend more than it should... if there's a price spike, it shouldn't end up burning more meat than it's supposed to, just move on to the next.

One possibility would be to go back to explicitly collecting ingredients. We explicitly collect hermit ingredients on real-runs, because if memory serves, mafia wouldn't automatically buy/use chewing gum to get your worthless items to purchase ketchup... it would happily use your worthless items if you have them, it would happily buy/use chewing gum to get worthless items... but it wouldn't buy/use chewing gum to get ketchup or other hermit items. This might not be the case anymore, but I thought that was how it ran the last time I tested this.

We could go back to collecting all of the ingredients for created items first... we stopped doing this because the ingredient code was wonky, but I think that's been pretty much fixed at this point. That should get the ingredients for whatever is being officially made, which should make mafia actually make it instead of buying it if both are allowed...

Edit: Tested the hermit code and it does auto-get if your preferences are set...
> ash retrieve_item(1, $item[jaba pepper])

Verifying ingredients for jabañero pepper (1)...
Purchasing chewing gum on a string (1 @ 50)...
You acquire an item: chewing gum on a string
You spent 50 Meat
Purchases complete.
Using 1 chewing gum on a string...
You acquire an item: worthless trinket
Finished using 1 chewing gum on a string.
Purchasing jabañero pepper (1 @ 1 worthless item)...
Visiting the Hermit...
You acquire an item: jabañero pepper
Hermit successfully looted!
Successfully created jabañero pepper (1)
Returned: true
That greatly simplifies the actual retrieval, since we shouldn't need to do the extra hermit-collection anymore. :)

Edit2: In the actual script:
food: At 6, consuming to 15 with 10000 meat.
Getting 3 painful penne pasta in 0 seconds
autoBuyPriceLimit => 1000.0
Verifying ingredients for painful penne pasta (3)...
Verifying ingredients for jabañero pepper (2)...
Purchasing chewing gum on a string (2 @ 50)...
You acquire chewing gum on a string (2)
You spent 100 Meat
Purchases complete.
Using 2 chewing gum on a string...
You acquire an item: worthless gewgaw
You acquire an item: worthless trinket
Finished using 2 chewing gum on a string.
Purchasing jabañero pepper (2 @ 1 worthless item)...
Visiting the Hermit...
You acquire jabañero pepper (2)
Hermit successfully looted!
Successfully created jabañero pepper (2)
Creating painful penne pasta (3)...
You acquire painful penne pasta (3)
Successfully created painful penne pasta (3)
I had 1 pepper from the prior quote. It properly bought 2 chewing gums, used them, and then took the 3 to the hermit... I'll need to test this later on a pre-hacked hermit, but otherwise it looks good. We'll need special handling for awareness of available items for the hermit, but shouldn't need special coinmaster retrieval anything anymore...
 
Last edited:
OK. You are (ab)using autoBuyPriceLimit because it is the only way you have to force mafia to get things at the price you are expecting. The price you are expecting is important because it is the price you used to figure out what is best and if that price is wrong enough then it is possible that the best diet may change. That makes sense and is a reasonable side effect of things I asked you to consider.

That said, there are two things you might look at. The first is TPS drinks, in general. I know you do some things differently because you can't make them in advance. If obtaining an ingredient fails, do you recalculate the diet? If not that might be worth considering. Second, when trying to overdrink with a TPS the ingredient failure stops rather than recomputes. Consider recomputing or possibly ignoring PRICE_FLEXIBILITY when overdrinking?

> call scripts\EatDrink.ash

Refreshing stash contents...
Stash list retrieved.
Internal checkpoint created.
Skipping favorites.
Starting EatDrink.ash (version 3.1.4).
Consuming up to 15 food, 19 booze, and 15 spleen and then finishing off with the stiffest drink we can find.
Considering food from inventory Hagnk's Coinmasters 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 1000 meat. Mysticality subpoint is 10.0. Nonprime stat subpoint is 0.0.
Pass 1: food.
Skipping food.
Pass 2: drink.
Skipping drink.
Pass 3: spleen.
Skipping spleen.
Pass 4: drink.
At drunkenness of 19. Overdrinking with 10000 meat.
Getting 1 sangria del diablo in 3 seconds
Countdown: 3 seconds...
Countdown: 2 seconds...
Countdown: 1 second...
Waiting completed.
autoBuyPriceLimit => 1000.0
Verifying ingredients for sangria del diablo (1)...
Searching for "sangria"...
Search complete.
Stopped purchasing sangria @ 1,100.
Using cached search results for sangria...
Stopped purchasing sangria @ 1,100.
You need 1 more sangria to continue.
autoBuyPriceLimit => 20000
Something went wrong with getting sangria del diablo for 2240. Recalculating.
choc: Checking non-filling crimbo chocolates - all 3 kinds
Best find was chocolate pasta spoon with a value of -750. That's no good, so not consuming and moving on.
Finished.
Spent 0 meat. Gained Fullness: 0. Inebriety: 0. Spleen: 0.
Adventures: 0. 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.4).
Consuming up to 15 food, 19 booze, and 15 spleen and then finishing off with the stiffest drink we can find.
Considering food from inventory Hagnk's Coinmasters 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 1000 meat. Mysticality subpoint is 10.0. Nonprime stat subpoint is 0.0.
At drunkenness of 19. Overdrinking with 10000 meat.
choc: Checking non-filling crimbo chocolates - all 3 kinds
Best find was chocolate pasta spoon with a value of -750. That's no good, so not consuming and moving on.
Finished.
Spent 0 meat. Gained Fullness: 0. Inebriety: 0. Spleen: 0.
Adventures: 0. Muscle: 0. Moxie: 0. Mysticality: 0.
Eating, drinking, and spleening complete. Commence merrymaking (at your own discretion).
 
Hmm... for curiosity's sake, what's your PRICE_FLEXIBILITY set to? Looks almost like you've set it below 100%, since it's setting to a max aBPL of 1000 for your 1100 sangria purchase, which is somewhat insane...
 
eatdrink_priceFlexibility 1.25 from vars_ I'm pretty sure after one of our go-arounds I deleted all of the ED preferences in the vars file and let the script restore the defaults but that's the value that is there right now and presumably was in effect when the run was made.
 
Eh, apparently something went wrong there then... wonder if I swapped min and max by accident. Don't think so, but... here's what it's setting, and I'm going to try to talk through the bits.
Code:
    set_property("autoBuyPriceLimit", max((initialvalue >= 1000 ? 1000 : 0), min(initialvalue * PRICE_FLEXIBILITY, floor(mall_price(it) * PRICE_FLEXIBILITY))));
1) The bigger of a. and b.
a1. If initialvalue > 999, 1000.
a2. 0.
b. The lower of i) and ii)
i) aBPL * PF
ii) price * PF

So, with aBPL of 20k, a price of 1.1k, and a PF of 1.25, it should come out to...
Code:
    set_property("autoBuyPriceLimit", max(1000, min(20000 * 1.25, floor(1100 * 1.25))));
and it should have set your aBPL temporarily to 1375, not 1000...

Edit: Old ED always used the price of manually making it all from scratch... which included buying 2 cherries and a boxed wine. Each cherry costs 1080, the boxed wine costs 100 and a sangria costs 1150... as such, it's cheaper to buy the sangria made then buy the boxed wine and cherry. Not sure if this relates, but it's possible...

Edit2: No clue what went on there. Fist change... sets STEP_MEAT to 0 if you're in a fist run.
 
Last edited:
Back
Top