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

EdFox

Member
Using the test update, build 7708 although this happened with previous daily builds as well:

Got script parsing error on line 272.
Original was: [item] consumable_entry[item][string]grub;
I changed it to: consumable_entry [item][string]grub;
and now it works. :)
 

dj_d

Member
Overhauled version! Half as big, faster, better, etc. Try it out and let me know how it works.
 

Attachments

  • EatDrink.ash
    49.3 KB · Views: 33

CoC

New member
using build 7716 (current as of now):

overhauled version caused an error in ascend.ash wouldn't let it run due to a function call in line 62 (i can't find the error in the log, but it happened twice)

trying to run eatdrink.ash on it's own caused a loop trying to eat a tasty tart. i had 1, it ate it fine. then failed at eating more. (couldn't attempt to recreate the bug, i'm in hardcore and only had 1)

switched back to old version and it ran smoothly

(it's incredibly possible this is somehow my fault, i am kind of half asleep)

thanks for the awesome scripts btw
 

mredge73

Member
EatDrink rarely works well for me, don't know why.

Here is an infinite loop from your newest version two post above:
Code:
10: thistle wine lev:10 gain:1.0 adv:3.0 musc:0.0 myst:0.0 mox:45.0 meat:500 own:0 pull:false make:false value:1950
Choosing drink to consume.
fuzzbump lev:4 gain:4.0 adv:12.0 musc:35.0 myst:0.0 mox:0.0 meat:1193 own:23 pull:false make:false value:1219
Shopping for a thistle wine in 0 seconds
budgeting 625 for 1 additional thistle wine. You have 2668939 meat. You have 0 in inventory already.
Using cached search results for thistle wine...
Purchasing thistle wine (1 @ 599)...
You acquire an item: thistle wine
Purchases complete.
Purchased 1 thistle wine for 599 meat.
Drinking 1 thistle wine...
You gain 3 Adventures
You gain 48 Chutzpah
You lose 65 hit points
You gain 1 Drunkenness
Finished drinking 1 thistle wine.
11: thistle wine lev:10 gain:1.0 adv:3.0 musc:0.0 myst:0.0 mox:45.0 meat:500 own:0 pull:false make:false value:1950
Choosing drink to consume.
fuzzbump lev:4 gain:4.0 adv:12.0 musc:35.0 myst:0.0 mox:0.0 meat:1193 own:23 pull:false make:false value:1219
Shopping for a thistle wine in 0 seconds
budgeting 625 for 1 additional thistle wine. You have 2668340 meat. You have 0 in inventory already.
Searching for "thistle wine"...
Stopped purchasing thistle wine @ 666.
Purchased 0 thistle wine for 0 meat.
Tried to get 1 thistle wine but got 0. Pricing error.
Failed to get thistle wine for a max price of 1.25*500
FAIL: thistle wine lev:10 gain:1.0 adv:3.0 musc:0.0 myst:0.0 mox:45.0 meat:500 own:0 pull:false make:false value:1950
Choosing drink to consume.
fuzzbump lev:4 gain:4.0 adv:12.0 musc:35.0 myst:0.0 mox:0.0 meat:1193 own:23 pull:false make:false value:1219
Shopping for a thistle wine in 0 seconds
budgeting 625 for 1 additional thistle wine. You have 2668340 meat. You have 0 in inventory already.
Using cached search results for thistle wine...
Stopped purchasing thistle wine @ 666.
Purchased 0 thistle wine for 0 meat.
Tried to get 1 thistle wine but got 0. Pricing error.
Failed to get thistle wine for a max price of 1.25*500
FAIL: thistle wine lev:10 gain:1.0 adv:3.0 musc:0.0 myst:0.0 mox:45.0 meat:500 own:0 pull:false make:false value:1950
Choosing drink to consume.
fuzzbump lev:4 gain:4.0 adv:12.0 musc:35.0 myst:0.0 mox:0.0 meat:1193 own:23 pull:false make:false value:1219
Shopping for a thistle wine in 0 seconds
budgeting 625 for 1 additional thistle wine. You have 2668340 meat. You have 0 in inventory already.
Using cached search results for thistle wine...
Stopped purchasing thistle wine @ 666.
Purchased 0 thistle wine for 0 meat.
Tried to get 1 thistle wine but got 0. Pricing error.
Failed to get thistle wine for a max price of 1.25*500
FAIL: thistle wine lev:10 gain:1.0 adv:3.0 musc:0.0 myst:0.0 mox:45.0 meat:500 own:0 pull:false make:false value:1950
Choosing drink to consume.
fuzzbump lev:4 gain:4.0 adv:12.0 musc:35.0 myst:0.0 mox:0.0 meat:1193 own:23 pull:false make:false value:1219
Shopping for a thistle wine in 0 seconds
budgeting 625 for 1 additional thistle wine. You have 2668340 meat. You have 0 in inventory already.
Using cached search results for thistle wine...
Stopped purchasing thistle wine @ 666.
Purchased 0 thistle wine for 0 meat.
Tried to get 1 thistle wine but got 0. Pricing error.
Failed to get thistle wine for a max price of 1.25*500
FAIL: thistle wine lev:10 gain:1.0 adv:3.0 musc:0.0 myst:0.0 mox:45.0 meat:500 own:0 pull:false make:false value:1950
Choosing drink to consume.
fuzzbump lev:4 gain:4.0 adv:12.0 musc:35.0 myst:0.0 mox:0.0 meat:1193 own:23 pull:false make:false value:1219
Shopping for a thistle wine in 0 seconds
budgeting 625 for 1 additional thistle wine. You have 2668340 meat. You have 0 in inventory already.
Using cached search results for thistle wine...
Stopped purchasing thistle wine @ 666.
Purchased 0 thistle wine for 0 meat.
Tried to get 1 thistle wine but got 0. Pricing error.
Failed to get thistle wine for a max price of 1.25*500
FAIL: thistle wine lev:10 gain:1.0 adv:3.0 musc:0.0 myst:0.0 mox:45.0 meat:500 own:0 pull:false make:false value:1950
it is choosing to drink a fuzzbump but is is searching and actually drinking thistle wine?

I ran it again afterward and it is still drinking the wrong thing:
Code:
Refreshing stash contents...
Stash list retrieved.
Internal checkpoint created.
Loading favorite consumables from user settings...
Starting EatDrink.ash (version 2.4).
Consuming up to 15 food, 19 booze, and 15 spleen
Considering food from inventory Hagnk's the mall. Per-item budget cap is 37500.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 10. Nonprime stat subpoint is 2.
Already updated from http://zachbardon.com/mafiatools/updateprices.php?action=getmap in this session.
Already updated from http://nixietube.info/mallprices.txt in this session.
Pass 1: food.
Skipping food.
Pass 2: drink.
drink: At 11, consuming to 19.
Loading drink map from Mafia's datafiles
Filtering by type
Filtering by level
Finding prices
Setting values
Choosing drink to consume.
fuzzbump lev:4 gain:4.0 adv:12.0 musc:35.0 myst:0.0 mox:0.0 meat:1193 own:23 pull:false make:false value:1719
Creating a shot of peach schnapps in 0 seconds
Verifying ingredients for shot of peach schnapps (1)...
Purchasing fermenting powder (1 @ 70)...
You acquire an item: fermenting powder
Purchases complete.
Purchasing peach (1 @ 300)...
You acquire an item: peach
Purchases complete.
Creating shot of peach schnapps (1)...
You acquire an item: shot of peach schnapps
Successfully created shot of peach schnapps (1)
Drinking 1 shot of peach schnapps...
You gain 8 Adventures
You gain 18 Chutzpah
You gain 2 Drunkenness
Finished drinking 1 shot of peach schnapps.
1: shot of peach schnapps lev:8 gain:2.0 adv:6.0 musc:0.0 myst:0.0 mox:17.0 meat:455 own:7209 pull:false make:true value:1858
Choosing drink to consume.
fuzzbump lev:4 gain:4.0 adv:12.0 musc:35.0 myst:0.0 mox:0.0 meat:1193 own:23 pull:false make:false value:1719
Creating a shot of peach schnapps in 0 seconds
Verifying ingredients for shot of peach schnapps (1)...
Purchasing fermenting powder (1 @ 70)...
You acquire an item: fermenting powder
Purchases complete.
Purchasing peach (1 @ 300)...
You acquire an item: peach
Purchases complete.
Creating shot of peach schnapps (1)...
You acquire an item: shot of peach schnapps
Successfully created shot of peach schnapps (1)
Drinking 1 shot of peach schnapps...
You gain 5 Adventures
You gain 18 Smarm
You gain 2 Drunkenness
Finished drinking 1 shot of peach schnapps.
2: shot of peach schnapps lev:8 gain:2.0 adv:6.0 musc:0.0 myst:0.0 mox:17.0 meat:455 own:7209 pull:false make:true value:1858

The script is choosing fuzzbump but creating/drinking peach schnapps this time?
 
Last edited:

Spiny

Member
EatDrink rarely works well for me, don't know why.

Here is an infinite loop from your newest version two post above:
Code:
10: thistle wine lev:10 gain:1.0 adv:3.0 musc:0.0 myst:0.0 mox:45.0 meat:500 own:0 pull:false make:false value:1950
Choosing drink to consume.
fuzzbump lev:4 gain:4.0 adv:12.0 musc:35.0 myst:0.0 mox:0.0 meat:1193 own:23 pull:false make:false value:1219
Shopping for a thistle wine in 0 seconds
budgeting 625 for 1 additional thistle wine. You have 2668939 meat. You have 0 in inventory already.
Using cached search results for thistle wine...
Purchasing thistle wine (1 @ 599)...
You acquire an item: thistle wine
Purchases complete.
Purchased 1 thistle wine for 599 meat.
Drinking 1 thistle wine...
You gain 3 Adventures
You gain 48 Chutzpah
You lose 65 hit points
You gain 1 Drunkenness
Finished drinking 1 thistle wine.
11: thistle wine lev:10 gain:1.0 adv:3.0 musc:0.0 myst:0.0 mox:45.0 meat:500 own:0 pull:false make:false value:1950
Choosing drink to consume.
fuzzbump lev:4 gain:4.0 adv:12.0 musc:35.0 myst:0.0 mox:0.0 meat:1193 own:23 pull:false make:false value:1219
Shopping for a thistle wine in 0 seconds
budgeting 625 for 1 additional thistle wine. You have 2668340 meat. You have 0 in inventory already.
Searching for "thistle wine"...
Stopped purchasing thistle wine @ 666.
Purchased 0 thistle wine for 0 meat.
Tried to get 1 thistle wine but got 0. Pricing error.
Failed to get thistle wine for a max price of 1.25*500
FAIL: thistle wine lev:10 gain:1.0 adv:3.0 musc:0.0 myst:0.0 mox:45.0 meat:500 own:0 pull:false make:false value:1950
Choosing drink to consume.
fuzzbump lev:4 gain:4.0 adv:12.0 musc:35.0 myst:0.0 mox:0.0 meat:1193 own:23 pull:false make:false value:1219
Shopping for a thistle wine in 0 seconds
budgeting 625 for 1 additional thistle wine. You have 2668340 meat. You have 0 in inventory already.
Using cached search results for thistle wine...
Stopped purchasing thistle wine @ 666.
Purchased 0 thistle wine for 0 meat.
Tried to get 1 thistle wine but got 0. Pricing error.
Failed to get thistle wine for a max price of 1.25*500
FAIL: thistle wine lev:10 gain:1.0 adv:3.0 musc:0.0 myst:0.0 mox:45.0 meat:500 own:0 pull:false make:false value:1950
Choosing drink to consume.
fuzzbump lev:4 gain:4.0 adv:12.0 musc:35.0 myst:0.0 mox:0.0 meat:1193 own:23 pull:false make:false value:1219
Shopping for a thistle wine in 0 seconds
budgeting 625 for 1 additional thistle wine. You have 2668340 meat. You have 0 in inventory already.
Using cached search results for thistle wine...
Stopped purchasing thistle wine @ 666.
Purchased 0 thistle wine for 0 meat.
Tried to get 1 thistle wine but got 0. Pricing error.
Failed to get thistle wine for a max price of 1.25*500
FAIL: thistle wine lev:10 gain:1.0 adv:3.0 musc:0.0 myst:0.0 mox:45.0 meat:500 own:0 pull:false make:false value:1950
Choosing drink to consume.
fuzzbump lev:4 gain:4.0 adv:12.0 musc:35.0 myst:0.0 mox:0.0 meat:1193 own:23 pull:false make:false value:1219
Shopping for a thistle wine in 0 seconds
budgeting 625 for 1 additional thistle wine. You have 2668340 meat. You have 0 in inventory already.
Using cached search results for thistle wine...
Stopped purchasing thistle wine @ 666.
Purchased 0 thistle wine for 0 meat.
Tried to get 1 thistle wine but got 0. Pricing error.
Failed to get thistle wine for a max price of 1.25*500
FAIL: thistle wine lev:10 gain:1.0 adv:3.0 musc:0.0 myst:0.0 mox:45.0 meat:500 own:0 pull:false make:false value:1950
Choosing drink to consume.
fuzzbump lev:4 gain:4.0 adv:12.0 musc:35.0 myst:0.0 mox:0.0 meat:1193 own:23 pull:false make:false value:1219
Shopping for a thistle wine in 0 seconds
budgeting 625 for 1 additional thistle wine. You have 2668340 meat. You have 0 in inventory already.
Using cached search results for thistle wine...
Stopped purchasing thistle wine @ 666.
Purchased 0 thistle wine for 0 meat.
Tried to get 1 thistle wine but got 0. Pricing error.
Failed to get thistle wine for a max price of 1.25*500
FAIL: thistle wine lev:10 gain:1.0 adv:3.0 musc:0.0 myst:0.0 mox:45.0 meat:500 own:0 pull:false make:false value:1950
it is choosing to drink a fuzzbump but is is searching and actually drinking thistle wine?

I ran it again afterward and it is still drinking the wrong thing:
Code:
Refreshing stash contents...
Stash list retrieved.
Internal checkpoint created.
Loading favorite consumables from user settings...
Starting EatDrink.ash (version 2.4).
Consuming up to 15 food, 19 booze, and 15 spleen
Considering food from inventory Hagnk's the mall. Per-item budget cap is 37500.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 10. Nonprime stat subpoint is 2.
Already updated from http://zachbardon.com/mafiatools/updateprices.php?action=getmap in this session.
Already updated from http://nixietube.info/mallprices.txt in this session.
Pass 1: food.
Skipping food.
Pass 2: drink.
drink: At 11, consuming to 19.
Loading drink map from Mafia's datafiles
Filtering by type
Filtering by level
Finding prices
Setting values
Choosing drink to consume.
fuzzbump lev:4 gain:4.0 adv:12.0 musc:35.0 myst:0.0 mox:0.0 meat:1193 own:23 pull:false make:false value:1719
Creating a shot of peach schnapps in 0 seconds
Verifying ingredients for shot of peach schnapps (1)...
Purchasing fermenting powder (1 @ 70)...
You acquire an item: fermenting powder
Purchases complete.
Purchasing peach (1 @ 300)...
You acquire an item: peach
Purchases complete.
Creating shot of peach schnapps (1)...
You acquire an item: shot of peach schnapps
Successfully created shot of peach schnapps (1)
Drinking 1 shot of peach schnapps...
You gain 8 Adventures
You gain 18 Chutzpah
You gain 2 Drunkenness
Finished drinking 1 shot of peach schnapps.
1: shot of peach schnapps lev:8 gain:2.0 adv:6.0 musc:0.0 myst:0.0 mox:17.0 meat:455 own:7209 pull:false make:true value:1858
Choosing drink to consume.
fuzzbump lev:4 gain:4.0 adv:12.0 musc:35.0 myst:0.0 mox:0.0 meat:1193 own:23 pull:false make:false value:1719
Creating a shot of peach schnapps in 0 seconds
Verifying ingredients for shot of peach schnapps (1)...
Purchasing fermenting powder (1 @ 70)...
You acquire an item: fermenting powder
Purchases complete.
Purchasing peach (1 @ 300)...
You acquire an item: peach
Purchases complete.
Creating shot of peach schnapps (1)...
You acquire an item: shot of peach schnapps
Successfully created shot of peach schnapps (1)
Drinking 1 shot of peach schnapps...
You gain 5 Adventures
You gain 18 Smarm
You gain 2 Drunkenness
Finished drinking 1 shot of peach schnapps.
2: shot of peach schnapps lev:8 gain:2.0 adv:6.0 musc:0.0 myst:0.0 mox:17.0 meat:455 own:7209 pull:false make:true value:1858

The script is choosing fuzzbump but creating/drinking peach schnapps this time?

I haven't tried the latest version yet, but to me it looks like it's choosing peach schnapps (as that is the drink name next to the 1: and 2:. Fuzzbump is possibly something your favorites list of drinks to check for? The earlier loop looks like you were budgeting less than the cost of the item and perhaps the script isn't handling that well right now. Generally, when I used to run it, it would choose 19 thistle wines as a moxie class unless I changed the stat weight values and adventure values. I never ran EatDrink.ash except to simulate. I don't know how the outcome would be if it was run to purchase rather than simulate.
 

dj_d

Member
The fuzzbump is a default favorite. I strongly recommend setting the flag that skips favorites if you're not using them, as it speeds things up and cleans up the printout quite a bit. And due to a very small bug, the text "This is your favorite: " wasn't printed out.

So basically, it was acting as expected.

But I can't reproduce the infinite loop with unpurchasable items, so I added some more diagnostic print()s around it. Have at it (again).

Also fixed a mojo filter bug.
 

Attachments

  • EatDrink.ash
    49.8 KB · Views: 29
Last edited:

NastyPeasant

New member
Overhauled version! Half as big, faster, better, etc. Try it out and let me know how it works.

Still getting infinite loop on green beer.

Attempting to consume...
green beer lev:1 gain:1.0 adv:2.0 musc:0.0 myst:0.0 mox:0.0 meat:0 own:4 pull:false make:true value:200
Countdown: 3 seconds...
Countdown: 2 seconds...
Countdown: 1 second...
Waiting completed.
Creating a green beer in 3 seconds
Countdown: 3 seconds...
Countdown: 2 seconds...
Countdown: 1 second...
Waiting completed.
Verifying ingredients for green beer (1)...
Creating green beer (1)...
Creation failed, no results detected.
FAIL: green beer lev:1 gain:1.0 adv:2.0 musc:0.0 myst:0.0 mox:0.0 meat:0 own:4 pull:false make:true value:200
Choosing drink to consume.
Attempting to consume...
green beer lev:1 gain:1.0 adv:2.0 musc:0.0 myst:0.0 mox:0.0 meat:0 own:4 pull:false make:true value:200
Countdown: 3 seconds...
Countdown: 2 seconds...
Countdown: 1 second...
Waiting completed.
Creating a green beer in 3 seconds
Countdown: 3 seconds...
Countdown: 2 seconds...
Countdown: 1 second...
Waiting completed.
Verifying ingredients for green beer (1)...
Creating green beer (1)...
Creation failed, no results detected.
FAIL: green beer lev:1 gain:1.0 adv:2.0 musc:0.0 myst:0.0 mox:0.0 meat:0 own:4 pull:false make:true value:200
Choosing drink to consume.
Attempting to consume...
green beer lev:1 gain:1.0 adv:2.0 musc:0.0 myst:0.0 mox:0.0 meat:0 own:4 pull:false make:true value:200
Countdown: 3 seconds...
Countdown: 2 seconds...
Countdown: 1 second...
Waiting completed.
Creating a green beer in 3 seconds
Countdown: 3 seconds...
Countdown: 2 seconds...
Countdown: 1 second...
Waiting completed.
Verifying ingredients for green beer (1)...
Creating green beer (1)...
Creation failed, no results detected.
FAIL: green beer lev:1 gain:1.0 adv:2.0 musc:0.0 myst:0.0 mox:0.0 meat:0 own:4 pull:false make:true value:200
Choosing drink to consume.
Attempting to consume...
green beer lev:1 gain:1.0 adv:2.0 musc:0.0 myst:0.0 mox:0.0 meat:0 own:4 pull:false make:true value:200
Countdown: 3 seconds...

...

Much faster loop though.
 

Spiny

Member
Still getting infinite loop on green beer.

Why is it looking for green beer? It's 1 drunk, 1-3 advs, no stats... it's just plain crappy booze. What weights did you put on your stats/adv value? Or are you in HC with no mall access? I'm just baffled. Is this script even semi-functional without mall access?

Much faster loop though.
Sorry, this made me LOL.
 

dj_d

Member
It should be completely functional in ronin, HC, etc. I did a whole oxycore run using it (obviously for spleenables :) ), and I've done regular HC runs with it too. I use it for everything.

I attached a version that should stop trying to make/pull something if you fail once, which ought to fix the loop.

As to why it's choosing green beer, I can't speak to that without seeing the "setup" text at the start (which discloses all the important settings, if you're in ronin, etc).
 

Attachments

  • EatDrink.ash
    50.1 KB · Views: 35

dj_d

Member
New version with two new major improvements. First, it uses floats instead of ints internally, since there's now a profile command (thanks JH) so I can fine tune performance. This will make a small but real improvement in your recommendations.

Second, it now supports The Chocolate Family: fancy chocolates, fancy but probably evil chocolates, and vitochoconutriment capsules. They tend to only be cost effective if you're fairly rich, so to see them, try simulating with the value-of-adventure set to 10,000.

ed: updated post with the right file.
 

Attachments

  • EatDrink.ash
    52.8 KB · Views: 25
Last edited:

fuzzyevil

New member
Does this script support the cellar wines? I've never had it recommend them, and it's what I was drinking before I installed this script.
 

dj_d

Member
Does now.

Also, upload to the very latest build, and eatdrink is one hebillion times faster.

(ed: minor fix that only affects when you are simulating a session of overdrink-only)
 

Attachments

  • EatDrink.ash
    53.8 KB · Views: 46
Last edited:

codster62

Member
I tried both my .exe and .jar builds with your new update of eatdrink.ash, and we have a problem. Here it is.

Undefined reference to function 'EatDrink' (Ascend.ash, line 62)

I used it on the latest build, and the latest .exe version, so it must be a script error. Maybe something you did?
 

Grotfang

Developer
It looks like you have capitalized the function on that line. Don't.

Ascend.ash imports EatDrink.ash, which has within it a function called eatdrink(). In older versions of Ascend.ash (and still present in farm.ash) the import was made lower case, which screwed up linux systems. The fix is to rename the import eatdrink.ash to import EatDrink.ash.

However, the function "eatdrink()" in EatDrink.ash is still lowercase. For some reason you seem to have capitalized every occurrence of the work "eatdrink". Don't.
 

codster62

Member
It's not me that's the problem. I just downloaded the older version of the script and it works fine on both the .jar version, and the .exe. The newest one on the last page of this thread, however, does not work. It has to be something you did with the update of the script, dj_d. Nobody else has reported this yet, but it has to be something wrong with the update if the old version still works for me.
 
Last edited:

Grotfang

Developer
Solved it. The version posted on this page is missing a condition in it's longest form of the eatdrink function:

Code:
boolean autospadeconsumables_p,

The code for that function should look like this:

Code:
void eatdrink (int foodMax, int drinkMax, int spleenMax, boolean overdrink,

	       boolean use_inv_p, boolean use_closet_p, boolean use_storage_p, 

	       boolean sim_consume_p, boolean supress_overdrink_p, 

	       boolean shop_p, int budget_p, float price_flexibility_p, 

	       boolean consider_cost_when_owned_p, int cost_of_pull_p, 

	       boolean autospadeconsumables_p, int value_of_adventure_p, 

	       int value_of_prime_stat_p, int value_of_nonprime_stat_p, 

	       boolean pie_priority_p, int price_of_nontradeables_p,

	       int price_of_unknowns_p, boolean sim_ronin_p, int sim_level_p)
 

dj_d

Member
Actually, that's deliberate. Support for autospadeconsumables (which has always been broken) was removed. It does mean you'll need to change the invoking functions in farm.ash and ascend.ash, or make the change suggested above, until I release a new version of ascend.zip with new versions of everything. (which will happen just as soon as I get some feedback on this version of eatdrink)
 

codster62

Member
So, what do I need to do? I don't quite understand. Do I need to replace the spader code with what Grotfang's 7 or 8 lines of code, or place that after the spader thing, or just remove the spader line completely? Once, I get it working, I will give some feedback!
 

dj_d

Member
It'll work fine if you run it directly. It's only an issue if you call it from farm.ash or another script.
 
Top