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

Theraze

Active member
Not a problem. :) I actually took on the script because dj_d has mostly disappeared to us, and the general consensus was that the script was fairly indecipherable. I took a look and thought I could make sense and hopefully clear out some of the things that were bugging me, and at this point, the only remaining thing that sometimes bugs me is that when you're making milk of magnesium as a Sauceror, mafia will (maybe) sometimes decide to spend more to get 3 for cheaper than the price of one, failing to get anything because it's trying to get goat milk for more than the price of a milk of magnesium. I list this as a maybe, since nobody's complained much about it since it was noted back in post 1200. Could just be that the mall is hiding it again, but... :)

Anyways, if it doesn't work properly for you, let me know and we'll tweak it some more. If you still have chocolates to eat, rerunning the script should make them get consumed. If you're in the 2000+ meat per adventure range, and you're really doing that well, you probably want to turn eatdrink_stepMeat to -1, so it will use as much as it needs to, getting you as many adventures as it can. You really don't want it to stop and get garbage spleens if you're going to get awesome returns anyways...
 

eegee

Member
Thanks for the update, the script finally eats chocolate. I had seen the error, but I hadn't posted about it :p
 

fronobulax

Developer
Staff member
This being said, I need to look at chocolates, apparently. I don't think anyone has actually used them during the whole time I've been working on ED. :D

At some point Bale's code for chocolates was added and I end up having ED use them if I set VOA high enough. So they worked, at least the last time I had a high VOA.
 

Banana Lord

Member
Probably means you don't have zlib.ash installed.

EDIT: It's not entirely obvious from the first post to someone unfamiliar with ash scripts that they need to download zlib. Most other scripts have an explicit "download zlib" instruction in the first post. Maybe someone should add that?
 

Theraze

Active member
Well, I'm guessing that chocolates have been broken since September 16 when 3.1.5 went live. But that's a guess... I've only ever auto-simulated them. Well, recently. :) I did have that time when I bounced my VoA to 2.5k and many chocolates were consumed. Heh.

Edit: Huh.
choc: Checking non-filling crimbo chocolates - all 3 kinds
Getting 1 chocolate saucepan in 0 seconds
autoBuyPriceLimit => 3937.0
Searching for "chocolate saucepan"...
Search complete.
Purchasing chocolate saucepan (1 @ 3,000)...
You acquire an item: chocolate saucepan
Purchases complete.
autoBuyPriceLimit => 10000
Using 1 chocolate saucepan...
You gain 3 Adventures
Finished using 1 chocolate saucepan.
1: chocolate saucepan lev:0 gain:1.0 adv:3.0 musc:0.0 myst:0.0 mox:0.0 meat:3150 own:0 value:600
Best find was chocolate saucepan with a value of -650. That's no good, so not consuming and moving on.
Well, apparently I should have been getting +3 adventures in aftercore for quite some time. Heh.
 

Winterbay

Active member
Hi. Is there any way to ignore certain consumables, like drunki-bears?

Yes there is, but in the case of drunki-bears the best bet is to download the version in post 1319.

In more general terms opening up you vars_charactername.txt file in the /data directory in Notepad or a similar program and adding a line of the type:
Code:
eatdrink_avoid_name_of_thing_to_avoid false
converting all spaces to underscores and making sure you have a tab before the "false" will make eatdrink avoid that foodstuff/drink.
 
Last edited:

Winterbay

Active member
@Theraze: I think there is either some error here or I've set it up oddly. I'm currently a level 11 Sauceror in hardcore and ran eatdrink from 1319 in simulation mode with the following call:
Code:
alias eatdrinks => ash import eatdrink.ash; int value = %%; eatdrink(fullness_limit()-1, inebriety_limit(), spleen_limit(),false,value,5,1,1000,true);
and set VoA to 1250.

I got the following output:
Code:
Starting EatDrink.ash (version 3.1.5).
Consuming up to 14 food, 19 booze, and 15 spleen
Considering food from inventory Coinmasters NPCs. Per-item budget cap is 12500.0.
Retrieval cap is 30000. Price will be a factor if you own it already.
An adventure has the value of 1250 meat. Mysticality subpoint is 5.0. Nonprime stat subpoint is 1.0.
Simulating only; no purchases or food/drink/spleen consumption.
food: At 0, consuming to 14 with 20000 meat.
0: milk of magnesium price: 1180 value: 16320
1: long pork casserole lev:9 gain:3.0 adv:11.5 musc:0.0 myst:44.0 mox:0.0 meat:1100 own:0 value:4571
2: long pork casserole lev:9 gain:3.0 adv:11.5 musc:0.0 myst:44.0 mox:0.0 meat:1100 own:0 value:4571
3: gnatloaf casserole lev:9 gain:3.0 adv:11.5 musc:30.0 myst:0.0 mox:0.0 meat:760 own:0 value:4558
4: gnatloaf casserole lev:9 gain:3.0 adv:11.5 musc:30.0 myst:0.0 mox:0.0 meat:760 own:0 value:4558
5: savoy truffle lev:9 gain:2.0 adv:6.5 musc:17.5 myst:17.5 mox:17.5 meat:180 own:1 value:4095
drink: At 0, consuming to 19 with 13860 meat.
0: Ode to Booze price: 0 value: 23750
1: wasabi-infused sake lev:1 gain:3.0 adv:7.0 musc:7.0 myst:8.0 mox:7.0 meat:100 own:0 value:2919
2: wasabi-infused sake lev:1 gain:3.0 adv:7.0 musc:7.0 myst:8.0 mox:7.0 meat:100 own:0 value:2919
3: wasabi-infused sake lev:1 gain:3.0 adv:7.0 musc:7.0 myst:8.0 mox:7.0 meat:100 own:0 value:2919
4: wasabi-infused sake lev:1 gain:3.0 adv:7.0 musc:7.0 myst:8.0 mox:7.0 meat:100 own:0 value:2919
5: wasabi-infused sake lev:1 gain:3.0 adv:7.0 musc:7.0 myst:8.0 mox:7.0 meat:100 own:0 value:2919
6: wasabi-infused sake lev:1 gain:3.0 adv:7.0 musc:7.0 myst:8.0 mox:7.0 meat:100 own:0 value:2919
7: overpriced "imported" beer lev:1 gain:1.0 adv:2.0 musc:0.0 myst:0.0 mox:0.0 meat:100 own:0 value:2400
spleen: At 0, consuming to 15 with 12380 meat.
1: greasy paste lev:4 gain:4.0 adv:7.5 musc:20.0 myst:20.0 mox:20.0 meat:3764 own:0 value:1472
2: greasy paste lev:4 gain:4.0 adv:7.5 musc:20.0 myst:20.0 mox:20.0 meat:3764 own:0 value:1472
3: greasy paste lev:4 gain:4.0 adv:7.5 musc:20.0 myst:20.0 mox:20.0 meat:3764 own:0 value:1472
4: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 mox:9.0 meat:400 own:4 value:976
5: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 mox:9.0 meat:400 own:4 value:976
6: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 mox:9.0 meat:400 own:4 value:976
Finished.
Spent 1960 meat for a value of 18272 meat. Gained Fullness: 14. Inebriety: 19. Spleen: 15.
Adventures: 155. Muscle: 206. Moxie: 146. Mysticality: 240.
Eating, drinking, and spleening complete. Commence merrymaking (at your own discretion).

Looking in my inventory I only seem to have two vouchers so getting hold of 6 voucher based drinks appear to be rather difficult...
 

fronobulax

Developer
Staff member
Probably means you don't have zlib.ash installed.

EDIT: It's not entirely obvious from the first post to someone unfamiliar with ash scripts that they need to download zlib. Most other scripts have an explicit "download zlib" instruction in the first post. Maybe someone should add that?

Keep telling me to do that until it gets done.
 

fronobulax

Developer
Staff member
So the most recent version seems to have some problems with overdrinking. As you can see below, I was full and wanted to drink my nightcap. It made the nightcap but did not actually consume it. I wonder if something got queued and then never consumed because of chocolate checking?

In any event, when I re-ran it (again) failed to consume the sangria del diablo that had just been made. I drank it manually but I'm not sure this version is ready for release.


Code:
> Starting EatDrink.ash (version 3.1.5).
> 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.
> Retrieval cap is 20000. Price will be a factor if you own it already.
> An adventure has the value of <b>1000 meat</b>. 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 1098939 meat.
 > Getting 1 sangria del diablo in 3 seconds

buy 1 fermenting powder for 70 each from Market Demon
You acquire an item: fermenting powder
You spent 70 Meat

buy 1 bunch of square grapes for 130 each from 593688 on 20120124
You acquire an item: bunch of square grapes

Mix 1 fermenting powder + 1 bunch of square grapes
You acquire boxed wine (3)
Crafting used 1 each of fermenting powder and bunch of square grapes

buy 1 cherry for 970 each from 1972007 on 20120124
You acquire an item: cherry

Mix 1 boxed wine + 1 cherry
You acquire an item: sangria
Crafting used 1 each of boxed wine and cherry

buy 1 cherry for 970 each from 1972007 on 20120124
You acquire an item: cherry

Mix 1 cherry + 1 tiny plastic sword
You acquire an item: skewered cherry
Crafting used 1 each of tiny plastic sword and cherry

Mix 1 sangria + 1 skewered cherry
You acquire an item: sangria del diablo
Crafting used 1 each of skewered cherry and sangria
> choc: Checking non-filling crimbo chocolates - all 3 kinds
> Best find was chocolate pasta spoon with a value of -400. That's no good, so not consuming and moving on.
> Finished. 
> Spent 2140 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...
> ******************************************
 

Theraze

Active member
Heh... what killed it actually was the spleen filtering fix. The spleen fix made it not continue (or start) consuming if repeatingstep is set, which it will be as soon as a TPS drink is queued. So... spleen reset consideration time. I'll attach updated post here if there's no further comments, or make a new post once I've puzzled out a good way to do it without too much more script bloat.

Changelog:
Implemented:
1069: Coinmaster (besides hermit) handling - Using lowest of the two prices, with a custom override for the hermit to set the value of his items at the price of a permit (if needed) and the cost of acquiring a worthless item - using retrieve_item on tokens, so it should decide if it's cheaper for buying directly from the mall or using the coinmaster.
1205: Fixed mojo filter infinite loop.
1226: Removed the verbose and verbose2 functions, replacing them with a vprint3 and vprint9. Items that were always printing before are still using logprint, print, or print_html as appropriate.
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.
1281: Better torso awaregness. Explicitly check for the skill, since mafia doesn't (as of 10216). Note that mafia does check as of 10220, but the explicit check won't hurt and helps keep people using out of date mafia for some reason running properly.
1298: Skip items which fill multiple organs - while it may be optimal on one, it's unlikely to be optimal to both.
1303: Removed legacy hermit code, since the new coinmaster code properly purchases from him as well as potentially from other coinmasters.
1310: Implemented initial daily special code. Uses working special code now... should be fully working, but need someone to have this trigger again.
1314: Made "the mall" display the same whether simulating or actually consuming. This might speed up simulating executions for some people.
1316: Added the acquisition of chocolates to the chocolate consumption code, so it should properly use them if you're actually in that budget range.
1316: Made the script recalculate what to consume if either a consumption fails or mojo filters are used, since either is likely to affect how much room is left to fill.
1332: Changed which flag gets set when mojo filters are used, so that it will actually consume TPS drinks and KLP food.
 

Attachments

  • EatDrink.ash
    92.4 KB · Views: 45
Last edited:

Craggles

New member
Code:
FAIL: yellow drunki-bear lev:6 gain:4.0 adv:24.0 musc:0.0 myst:0.0 mox:220.0 meat:5300 own:1 value:6425
Pass 2: drink.
drink: At 15, consuming to 19 with 10000 meat.
yellow drunki-bear is not an alcoholic beverage.

full on food 15/19 drunk.
 

Theraze

Active member
Yeah... on any version attached to a post newer than 1298, the drunki-bears are skipped. As it says in the changelog just above your post:
1298: Skip items which fill multiple organs - while it may be optimal on one, it's unlikely to be optimal to both.
 

fronobulax

Developer
Staff member
I really do intend to make an official release of the latest version. The version I ran today did not overdrink and to my chagrin I realized I was not running the latest. Tomorrow.
 

Theraze

Active member
Not a problem. At least once there's a new main release, we should stop getting the drunki-bear questions and some of those other ones. There's enough progress that it's difficult finding the answer, even if it's been mentioned repeatedly. Which is partially why I default to 40 posts per page. :)
 

fronobulax

Developer
Staff member
Still had failure to overdrink. This time it was a character in HC and ED just gave up when it could not buy what it thought it needed to make something. Hopefully I'll have a chance to investigate more or at least post a log snippet.
 

Theraze

Active member
Yeah... let me know what it thought it could make and failed on. If we can hunt down why it has an incorrect belief, that will help.
 
Top