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

Okay, I'll need to look into the spleen issue when I hit pulverize levels. Nothing that SHOULD cause that, but I'll go to crazy logging levels when I have spleen items available... It's possible that the shop-price fix is causing it to remove items when it fails to consume them instead of just bumping up the price, but that should fail with a message if verbose is on, as per the following added code (put both into the chocolate consumption and normal consumption sections):
Code:
                    if (oldprice == grub[to_consume].price) {
                        verbose(grub[to_consume].it+" cannot currently be consumed. Skipping.");
                        remove grub[to_consume];
                    }

The 'overconsumption' issue is that if I can make 3 painful penne pastas (3 worthless items, 3+ noodles) and have the appetite to eat 4, EatDrink will try to craft a 4th despite the fact that it's impossible and it knew it when it calculated the "have" for pastas. The "own:" part of the consumption... if you look, it actually goes down in the log above, but doesn't in a normal one. Though it goes down differently on the first consumption and the others... *blinks* Well, I'll be staring at this some more tonight. I THINK I have a character with pulverize permed... if I can just remember who... Heh. On my way to perm it with another now, but they aren't at sufficient level yet.

Edit: Yeah... new seal clubber is level 10 w/o pulverize, Theraze has pulverize but no gear that actually smashes to wads. Looks like it's going to be a day or two before I can test pulverize/spleen, unless I manage to finish getting some smashable stuff for Theraze or someone gets to ascension levels.
 
Last edited:
I know I should have Updated to the new version before running EatDrnk, but hey. I'm bugreporting it anyway.
Or, well, not really a bug report, more like "Not quite a feature-report.
The version before this current one, the script bought me a new Milk of Magnesium after 10 fullness, even though I have the Saucerorskill to make all potionbuffs 15 adv (I still had 5adv left of Got Milk). It did not use it though so no real problem there. Just thought i should mention it.
 
Yeah... the 3.1.2 version should only buy milk if your next consumption will use more than you have turns remaining... if you have 15 turns of milk, 15 fullness possible, and box servants (or, as of mafia 9232, Inigo active), it should only buy/use one milk.
 
Well, this version of EatDrink should actually remove failed purchased items successfully. Had it try and fail with the version posted above (now removed), so trying this instead... what I've got it currently doing is putting failed purchases onto the 'fail' list, which removes them on the next iteration. The version above fails because it removes the entry before it tries to calculate the relative value, so it's checking item type on a non-existent item... unlikely to work, ever. -_-

tl;dr This EatDrink should remove bad purchases properly and not crash.

Edit: Replaced below with one that still allows mall purchases properly.
 
Last edited:
No joy. It still skips spleen items. Since I run the old and new versions from the menu with the same input parameters, they use the same zLib values. I don't see anything in your change, using a diff utility, that should prevent spleen from being considered but, this is not a version that will be released.

P.S. - It just used an ocean motion as a night cap even though I have a TPS in my inventory. I wonder if the problem with my character and your fix is that I have never ascended and am quite willing to spend up to my budget on ingredients which are readily available in the Mall.
 
Last edited:
Re PS: OM instead of TPS drink is probably because of official 'cost'. The whole joyous thing with it thinking that TPS drinks cost millions, which they do if you don't already have the TPS to make them. Unless inventory cost is set to 0, but that screws up farming income calculations...

Re: Spleen... not a clue, but I'll definitely try to figure it out in a day or two when I get to smashing. If it takes it, I'll even *gasps* put off ascending for a day or three while figuring out why it isn't eating. For the record, what spleeners are you expecting it to use?
 
Re PS: OM instead of TPS drink is probably because of official 'cost'. The whole joyous thing with it thinking that TPS drinks cost millions, which they do if you don't already have the TPS to make them. Unless inventory cost is set to 0, but that screws up farming income calculations...

Understood, but when I ran both scripts in simulate mode because I was overdrunk, one gave me a cherry bomb and one gave me ocean motion. The price difference was less than twice my value of adventure so for an overdrink situation it should have picked the 6 adv over the 4 adv.
 
Re: Spleen... not a clue, but I'll definitely try to figure it out in a day or two when I get to smashing. If it takes it, I'll even *gasps* put off ascending for a day or three while figuring out why it isn't eating. For the record, what spleeners are you expecting it to use?

Whatever is cheapest in the mall.

For the record, you are working on a fix to a problem that I have never seen (or never thought was a problem). I will consider your patch successful when it gives identical results while in use. I am content to point a finger at the patch since I'm not changing characters or variables between runs of each script. If you can get identical results with old and new then there is probably some characteristic of my character(s) that are different from yours. A never-ascended Level 69 Pastamancer is definitely an edge-case :-)
 
Yeah, I'd expect the same results between the two executions. Possible that it's the availability check, possible that it's something else... if you feel like testing, try commenting out the
Code:
    grub[i] = availability(grub[i]);
line in filter_final. Means that it will still try to consume items that it can't until they actually fail, but we can see if availability changes is why it's failing.

Edit: Regarding fixing the 'problem', the reasoning behind it is that if I can make EatDrink actually consume the RIGHT amount of items, I should be able to queue up the consumption and have it successfully use that same amount... As long as it continues to have be confused though, I can't implement ConsumeLast and make it actually predict milk and booze accurately. I can guess, but in the cases where someone ends up at 13/15 fullness or 13/14 drunkenness due to not having mall access and not being able to make something that fits into the hole (but having had it be more efficient earlier on to eat richer food), I don't want to waste meat and/or mana buying milk/casting booze again.

Edit2: Just thought about it... the problem is almost certainly tied into that availability check. Since you're buying out of the mall, your actual 'availability' is 0... you just purchase your way to success. :) I'll need to ponder how to do that, but maybe having availability return floor(mall_price/my_meat) or something like that.
 
Last edited:
Did not try your fix above. Might not get a chance to do so soon.

I logged in. Character is already full. I ran the old version with 15,19,15,true, true and then the new version with the same parameters. The TPS is in my DC, not my inventory so it was not considered.
Old
3x bat wing chow mein lev:7 gain:5.0 adv:25.0 musc:0.0 myst:72.5 mox:0.0 meat:4700 own:0 value:4205
19x cup of primitive beer lev:12 gain:1.0 adv:3.5 musc:57.5 myst:0.0 mox:0.0 meat:100 own:0 value:3400
15x stench wad lev:6 gain:1.0 adv:1.0 musc:18.0 myst:27.0 mox:9.0 meat:399 own:0 value:871
1x gimlet lev:6 gain:4.0 adv:16.0 musc:0.0 myst:43.5 mox:0.0 meat:4419 own:0 value:12016

New
5x pear tart lev:7 gain:3.0 adv:11.0 musc:0.0 myst:35.0 mox:0.0 meat:489 own:2149 value:3620
x shot of pear schnapps lev:8 gain:2.0 adv:6.0 musc:0.0 myst:17.0 mox:0.0 meat:399 own:2207 value:2885
1x bloody beer lev:1 gain:1.0 adv:2.0 musc:0.0 myst:0.0 mox:0.0 meat:120 own:201 value:1880
1x shot of pear schnapps lev:8 gain:2.0 adv:6.0 musc:0.0 myst:17.0 mox:0.0 meat:399 own:2207 value:2885
 
Last edited:
That's 39 drunkness. I wonder if it's somehow mistaking available spleen for available drunkness (the original version ends up with 23 drunkness + 15 spleen = 38)?

My bad. It's 9+1 shots. EatDrink's output in the session log is less than useful, IMO, because of the formatting and I clearly had trouble counting when I tried to reformat into a post friendly fashion.
 
Eh, that (updating 'have' with buyable amount) would screw up using inventory and the like... just made it only remove the item from the 'next choice list' if (EAT_SHOP && !get_ronin()) is false, and you don't have any in inventory left. That should still remove from the list if you're crafting in HC, but not remove from the list if you can purchase the item and want to.

Try this version out? Should work for you...
 

Attachments

Spiffy. For the record, the above section where I posted my sample log and 'own' for painful penne pasta remained at 2 for 2 consumptions... I started with 2 adventures left, so the most possible to be crafted at the time were 2, but then I ate one and gained 10 adventures (plus one consumed), so ended at 11 adventures after the first... enough to actually craft both of the others successfully without worrying about adventures stopping the crafting...

Anyways, now that this is done, I'll need to ponder through the best way to do the crafting list. Probably do an int stack similar to the boolean fail stack... we'll see though. Anyways, this will likely take a bit more planning.

Any other requests for EatDrink? When it's done, ConsumeLast will properly handle milk/ode based on how much you're consuming in total as opposed to how much the next bit will take, so we don't need that reiterated... Anything else though?

Edit: Oddly got this when I tried out a profile eatdrink.ash today, though it looks like the first post is updated...
New Version of EatDrink Available: 3.1.2
Upgrade EatDrink from 3.1.3 to 3.1.2 here: http://kolmafia.us/showthread.php?t=1519
Might just be part of the once a day checking feature?
 
Last edited:
Edit: Oddly got this when I tried out a profile eatdrink.ash today, though it looks like the first post is updated...Might just be part of the once a day checking feature?

I've been puzzling this. The zLib code uses a KoLmafia (daily) preference in version checking and my first impression is that the case where a new version is downloaded before the version is checked will not process correctly because zLib never updates the preference. My first thought is to suggest that zLib be modified to compare the version passed to check_version to the preference and update the preference before looking at the web site. I haven't had enough time to verify that and propose it to zarqon because I don't want to be wrong and waste his time.
 
Yeah... the problem with changing it up is that different people use different systems to do their number systems... whether you do 3.1.9.1 or 3.1.12 and as another example... 3.199 or 3.1981 and how those sort... in the first, do you take the 9 as the higher choice because 9 is bigger than 1? In the second, do you compare it as 199 versus 1981? The second is obviously bigger, but in the case of versioning would probably be a semi-major revision behind...

I think random 'bugs' like this are just a feature of saving forum hits. I'll try to remember when I'm working on scripts and not panic. :)
 
Any other requests for EatDrink? Anything else though?

Have it play nicely with CounterChecker? If you are using adventures while crafting, does that decrease the counters? (Out of adventures for the day so I cannot verify.)
 
Last edited:
Any other requests for EatDrink?

Since you ask... while in aftercore the other day, I was idly wondering whether EatDrink considers the clan stash as a source of consumables. Since I have a substantial clan karma balance but don't use the stash for anything else, consumables from the stash are effectively 0 cost. Given that premise, it could be the case in certain situations that the most advs for a given valueOfAdventure budget would be yielded from a mixture of free (from stash) consumables and expensive higher-than-usual-quality consumables (from the mall).

Probably quite a can of worms, but I was wondering if anyone has thought about this.
 
Back
Top