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

fronobulax

Developer
Staff member
I tested with like 2 or 3 different versions, following various inter-connected threads across various posts of "here use this copy of EatDrink, bug XYZ has just been eradicated", so I must have missed the right one somewhere in the threading. Or maybe my caffeine quota was too low this morning. Will try again.

I admit to being somewhat short of patience. That said, dj_d, who has received payment for the scripts has been unable to maintain them to the satisfaction of his customers. One unofficial fix was posted by a moderator. I got tired of the whining and offered to help keep the scripts working. dj_d accepted the offer. At this point, any work posted and tested in the Unofficial Ascend Support thread will be rolled up into dj_d's next official release. So based upon this and the posts you did read, is the situation clearer? I'm not sure how to make someone actually read the right posts and threads but if someone does read them and they are not clear then I can always do some editing to try and correct that.

Your "sin" ultimately was just to fail to read a few messages on the same page you posted to. Been there, done that and blamed caffeine too so it is easy to forgive and you are forgiven ;)
 

fronobulax

Developer
Staff member
Interested parties may wish to view this post which contains a new version of EatDrink where I attempt to undo the inadvertent fork.
 

fronobulax

Developer
Staff member
does EatDrink take in mind the fact that someone has access to level 15 guild thingy
Which Level 15 Guild thingie? Since it is EatDrink I can think of two... I have not dissected all of it but basically it starts with a list of all consumables in the game. It assigns them a meat value based upon the adventure and stat gains. Then it computes a cost for obtaining items and picks ones to consume based upon "bang for the buck". Thus it most certainly knows about the Wok, the Still and the cocktail crafting skills. However, out of the box, it is quite possible that the script will decide it is more effective to buy an item than to craft it. That should be enough to answer a vague question or to convince you to be more specific so that I, in turn, will be more concrete. ;)
 

Theraze

Active member
I'm currently using this as an alias for my EatDrink... Looked for predone aliases and the only one was the hardcoded lines, so... this one should realize what your liver, stomach, or spleen can handle, and not properly honour your pathing rules as well. The normal one gets you to full, the overdose makes you too drunk for end of day.

alias eatdrink => ashq import <EatDrink.ash>; SIM_CONSUME=false; eatdrink(fullness_limit(), inebriety_limit(), spleen_limit(), false);
alias eatdrinkod => ashq import <EatDrink.ash>; SIM_CONSUME=false; eatdrink(fullness_limit(), inebriety_limit(), spleen_limit(), true);
 

Theraze

Active member
If you adventure in areas with some alcohol, you may want to use the following alias to do your pre-alcohol adventurings. Do eatdrinknd to get to adventure max pre-alcohol, eatdrink to max with drinks, use up your adventures, and eatdrinkod to prepare for tomorrow. :)

alias eatdrinknd => ashq import <EatDrink.ash>; SIM_CONSUME=false; eatdrink(fullness_limit(), 0, spleen_limit(), false);
 

Theraze

Active member
Unrelated to aliases... well, mostly. First, a random thing. I did recently set the eatdrinknd as my login script... if you copy-paste everything after => it'll use your stuff or buy stuff based on your settings when you login... Haven't quite committed to the eatdrinkod as my logout script, because of still running 4 HCO characters currently and not wanting to maybe screw them up with the booze. Will need to verify that it's fine later.

Now, on to the point. I was looking at the variables that it sets in the character file, and it doesn't actually seem to care about most of them... it just sets them when you run the script, and forget anything else. Is that right? Is it supposed to work like that? If so, why even set the variables, why not just make them set in the script file? Specifically, I was looking at the pause of 3 seconds... I wanted to change that to give my flaky connection a bit more time to process, but it gets overwritten back to 3 seconds every time. Only way to set it is to change the script file itself, which just seemed... wrong. Is my EatDrink file somehow broken? I think I removed the two/three lines where it was still using the outdated price code that doesn't exist anymore and we aren't supposed to use (basically, everything regarding the GetPriceServer), but... It's the version that was posted a few pages back for fixing the code fork.

Oh... just checked and the version where I'd removed that was before I found the fixed up version. So that change isn't even in mine yet, the script just doesn't seem to care about most/any of the variables it sets. Is that (currently) right? Is it worthwhile for me to take a version (code fork base maybe), remove the GetPriceServer bit, and make the variables actually matter, and either upload that version here or send it to one of the official people maintaining it to verify that I haven't horrifically broken it before it gets approved for use?

Edit:
It looks the same as the ones that don't overwrite... no clue why it hates me, but it's probably not the script. Only suggestion then that remains would be to remove the GetPriceServer part since that's been depreciated.
 
Last edited:

fronobulax

Developer
Staff member
First, thank you. If there are any changes you feel are significant feel free to pass them to me. dj_d is committed to releasing changes that I have made and have been "tested". I have not released a version with the price updating deleted because it doesn't hurt anything and seems pretty trivial. But maybe I should.

I'm not sure about your concerns with the variables. The code looks right to me. Zarqon (All Hail!) says setvar
sets per-character script variables (but only the first time, after that the stored value will be used, rather than default).
What I have seen is consistent with that. Could you give me one or two specific examples of variables you can't change persistently? If I can and you can't then there is an environment problem. Otherwise we can debug EatDrink or submit a bug report for zLib.

Thanks.
 

Theraze

Active member
When I tried it, I edited all (6) of my vars_<name> files and changed the EatDrink_pause value. When I logged into the next character and it ran my login script (ashq import <EatDrink.ash>; SIM_CONSUME=false; eatdrink(fullness_limit(), 0, spleen_limit(), false); ) it was back to 3 seconds of delay. I then checked my vars file and it had changed it back to 3 seconds there as well. Maybe I was just unlucky... I changed my EatDrink file to have the desired pause instead and it hasn't had issues since, but since I'm going HC on all my characters curently, I don't know if any of the shop values are overwriting. Wonderful script and I enjoy it thoroughly... guessing I just got unlucky that time? I'll play with it more at RO tonight.
 
Last edited:

fronobulax

Developer
Staff member
OK - I'll also play with the pause value and see what happens.

Update: I used a zLib variable editor and my changes were accepted and persisted. I am at a loss to explain why different behavior is being observed.
 
Last edited:

Theraze

Active member
Here's a fun question... is there a good reason why EatDrink thinks that negative stat bonuses are positive? When I have Imp Ale or something like that with negative stat gains to moxie (my prime stat), it uses that over items which don't subtract stats. In the display of the decision, it's showing the gain as positive...

Edit: Also added in a check for (SHOP) before the crimbo chocolate check, since those of us in HC or otherwise not buying aren't hugely likely to combine still having them and running the script for consumption. Or maybe that's just me... but anyways, speeds me up some, since there aren't any other variables to skip it currently (which might be a good alternative thing to add instead... or combining the two, maybe).

Edit 2: When I run your zlib script above, I get the following:
No setting named 'EatDrink_pause' exists.
Appears that it's case sensitive and it's saving lowercase...?
 
Last edited:

slyz

Developer
It's a problem with parsing the Mafia data files.
Look for the range set_range(string rangestring) function, and replace it with this:
PHP:
range set_range(string rangestring)
{
  string[int] splitRange = split_string(rangestring, "-");
  range returnval;
  // If we only got 1 number, return it for both
  if (count(splitRange) == 1)
  {
    returnval.max = to_float(splitRange[0]);
    returnval.min = returnval.max;
    return returnval;
  }
  else if (splitRange[0]=="")
  {
	returnval.max = (-1.0) * to_float(splitRange[1]) ;
	returnval.min = returnval.max;
	return returnval;
  }
  // Return the 2 numbers
  returnval.min = to_float(splitRange[0]);
  returnval.max = to_float(splitRange[1]);
  return returnval;
}
 

fronobulax

Developer
Staff member
@slyz - looks good, makes sense. I have added it to my local version, which it turn means it will be released unofficially or otherwise. Thanks.
 

Theraze

Active member
Awesome, kicked that into my file as well. Will see it run this evening. So my current local changes are doing the following where it uses 0-consumption crimbo chocolates:
Code:
  ConsumptionReportIndex = 1;
  if (SHOP)
  {
      summarize("choc: Checking non-filling crimbo chocolates - all 3 kinds");
      get_choc();
  }
  string finished = "Finished.  ";
so that it skips it for me, the adding of
Code:
  else if (splitRange[0]=="")
  {
    returnval.max = (-1.0) * to_float(splitRange[1]) ;
    returnval.min = returnval.max;
    return returnval;
  }
into the middle of the set_range function, and removing the GetPriceServer variable setting and the lines regarding its checking. Any obvious caveats for what I've done that I'm not understanding properly?
 

fronobulax

Developer
Staff member
Why don't you send me your mods? Obvious user name which is that same as my forum name at G Mail dot com.

Update: New version with (most) of the mods discussed above here.
 
Last edited:

Banana Lord

Member
Wish I'd known about this update before today... Yesterday I ran eatdrink as part of a larger script, walked away, came back half an hour later to find it stuck in a loop buying chef and bartender-in-a-boxen. Anyway, I'm now up 1209 chefs, 347 bartenders, and down about 17M >.<

Ah well, such is life. The thing I really want to know now is, is the latest version likely to do the same thing? It seems to be fine so far, but I don't think I'm overreacting when I say I'm nervous!

Code:
 > Checking for updates (running EatDrink ver. 3.0)...
 > You have a current version of EatDrink.
> Skipping favorites.
> Starting EatDrink.ash (version 3.0).
> Consuming up to 14 food, 19 booze, and 15 spleen
> Considering food from inventory Hagnk's the mall. Per-item budget cap is 125000.0.
> Price will  be a factor if you own it already. Hagnk's pulls (if enabled) will cost 1000 meat each.
> An adventure has the value of <b>1100 meat</b>. Moxie subpoint is 5.0. Nonprime stat subpoint is 1.0.
> Pass 1: food.
> food: At 1, consuming to 14.
> Loading food map from Mafia's datafiles
> Filtering by type
> Filtering by level
> Finding prices
> Setting values
> Choosing food to consume.
> <b>spooky lo mein</b> lev:6 gain:4.0 adv:18.0 musc:0.0 myst:0.0 mox:33.5 meat:1800 own:0 value:5641
> Shopping for a spooky lo mein in 0 seconds
> budgeting 2250 for 1 additional spooky lo mein. You have 132629068 meat.  You have 0 in inventory already.

buy 1 spooky lo mein for 1448 each from 1958828 on 20100910
You acquire an item: spooky lo mein
> Purchased 1 spooky lo mein for 1448 meat.

eat 1 spooky lo mein
You gain 19 Adventures
You gain 32 Smarm
You lose some of an effect:
> 1: <b>spooky lo mein</b> lev:6 gain:4.0 adv:18.0 musc:0.0 myst:0.0 mox:33.5 meat:1800 own:0 value:5641
> Choosing food to consume.
> <b>spooky lo mein</b> lev:6 gain:4.0 adv:18.0 musc:0.0 myst:0.0 mox:33.5 meat:1800 own:0 value:5641
> Shopping for a spooky lo mein in 0 seconds
> budgeting 2250 for 1 additional spooky lo mein. You have 132627620 meat.  You have 0 in inventory already.

buy 1 spooky lo mein for 1800 each from 2015495 on 20100910
You acquire an item: spooky lo mein
> Purchased 1 spooky lo mein for 1800 meat.

eat 1 spooky lo mein
You gain 23 Adventures
You gain 31 Sarcasm
You lose some of an effect:
> 2: <b>spooky lo mein</b> lev:6 gain:4.0 adv:18.0 musc:0.0 myst:0.0 mox:33.5 meat:1800 own:0 value:5641
> Choosing food to consume.
> <b>spooky lo mein</b> lev:6 gain:4.0 adv:18.0 musc:0.0 myst:0.0 mox:33.5 meat:1800 own:0 value:5641
> Shopping for a spooky lo mein in 0 seconds
> budgeting 2250 for 1 additional spooky lo mein. You have 132625820 meat.  You have 0 in inventory already.

buy 1 spooky lo mein for 1800 each from 2015495 on 20100910
You acquire an item: spooky lo mein
> Purchased 1 spooky lo mein for 1800 meat.

eat 1 spooky lo mein
You gain 21 Adventures
You gain 34 Roguishness
You lose an effect: Got Milk
> 3: <b>spooky lo mein</b> lev:6 gain:4.0 adv:18.0 musc:0.0 myst:0.0 mox:33.5 meat:1800 own:0 value:5641
> Choosing food to consume.
> <b>handful of nuts and berries</b> lev:12 gain:1.0 adv:4.0 musc:0.0 myst:55.0 mox:0.0 meat:875 own:0 value:5046
> Shopping for a handful of nuts and berries in 0 seconds
> budgeting 1093 for 1 additional handful of nuts and berries. You have 132624020 meat.  You have 0 in inventory already.

buy 1 handful of nuts and berries for 875 each from 402280 on 20100910
You acquire an item: handful of nuts and berries
> Purchased 1 handful of nuts and berries for 875 meat.
> Shopping for a milk of magnesium in 0 seconds
> budgeting 1250 for 1 additional milk of magnesium. You have 132623145 meat.  You have 0 in inventory already.

buy 1 milk of magnesium for 1000 each from 112728 on 20100910
You acquire an item: milk of magnesium
> Purchased 1 milk of magnesium for 1000 meat.

use 1 milk of magnesium
You acquire an effect: Got Milk (duration: 10 Adventures)
> 0: <b>milk of magnesium</b> price: 1000 value: 452.0

eat 1 handful of nuts and berries
You gain 4 Adventures
You gain 56 Mysteriousness
You lose some of an effect:
> 4: <b>handful of nuts and berries</b> lev:12 gain:1.0 adv:4.0 musc:0.0 myst:55.0 mox:0.0 meat:875 own:0 value:5046
> Pass 2: drink.
> drink: At 0, consuming to 19.
> Loading drink map from Mafia's datafiles
> Filtering by type
> Filtering by level
> Finding prices
> Setting values
> Choosing drink to consume.
> <b>rockin' wagon</b> lev:4 gain:4.0 adv:12.0 musc:0.0 myst:0.0 mox:35.0 meat:1599 own:2 value:3494
> acquiring a chef-in-the-box in 0 seconds

use 1 chef-in-the-box
> acquiring a bartender-in-the-box in 0 seconds

use 1 bartender-in-the-box
> Creating a rockin' wagon in 0 seconds

buy 1 olive at market price from Hippy Store (Fratboy)
You acquire an item: olive
You spent 70 Meat

buy 1 fermenting powder at market price from Market Demon
You acquire an item: fermenting powder
You spent 70 Meat

buy 1 bowl of rye sprouts at market price from Hippy Store (Fratboy)
You acquire an item: bowl of rye sprouts
You spent 300 Meat

use 1 bartender-in-the-box
> FAIL: <b>rockin' wagon</b> lev:4 gain:4.0 adv:12.0 musc:0.0 myst:0.0 mox:35.0 meat:1599 own:2 value:3494
> Choosing drink to consume.
> <b>rockin' wagon</b> lev:4 gain:4.0 adv:12.0 musc:0.0 myst:0.0 mox:35.0 meat:1599 own:2 value:3494
> acquiring a chef-in-the-box in 0 seconds

use 1 chef-in-the-box
> acquiring a bartender-in-the-box in 0 seconds

use 1 bartender-in-the-box
> Creating a rockin' wagon in 0 seconds

use 1 bartender-in-the-box
> FAIL: <b>rockin' wagon</b> lev:4 gain:4.0 adv:12.0 musc:0.0 myst:0.0 mox:35.0 meat:1599 own:2 value:3494
> Choosing drink to consume.
> <b>rockin' wagon</b> lev:4 gain:4.0 adv:12.0 musc:0.0 myst:0.0 mox:35.0 meat:1599 own:2 value:3494
> acquiring a chef-in-the-box in 0 seconds

use 1 chef-in-the-box
> acquiring a bartender-in-the-box in 0 seconds

use 1 bartender-in-the-box
> Creating a rockin' wagon in 0 seconds

use 1 bartender-in-the-box
> FAIL: <b>rockin' wagon</b> lev:4 gain:4.0 adv:12.0 musc:0.0 myst:0.0 mox:35.0 meat:1599 own:2 value:3494
> Choosing drink to consume.
> <b>rockin' wagon</b> lev:4 gain:4.0 adv:12.0 musc:0.0 myst:0.0 mox:35.0 meat:1599 own:2 value:3494
> acquiring a chef-in-the-box in 0 seconds

use 1 chef-in-the-box
> acquiring a bartender-in-the-box in 0 seconds

use 1 bartender-in-the-box
> Creating a rockin' wagon in 0 seconds

use 1 bartender-in-the-box
> FAIL: <b>rockin' wagon</b> lev:4 gain:4.0 adv:12.0 musc:0.0 myst:0.0 mox:35.0 meat:1599 own:2 value:3494
> Choosing drink to consume.
> <b>rockin' wagon</b> lev:4 gain:4.0 adv:12.0 musc:0.0 myst:0.0 mox:35.0 meat:1599 own:2 value:3494
> acquiring a chef-in-the-box in 0 seconds

use 1 chef-in-the-box
> acquiring a bartender-in-the-box in 0 seconds

use 1 bartender-in-the-box
> Creating a rockin' wagon in 0 seconds

use 1 bartender-in-the-box
> FAIL: <b>rockin' wagon</b> lev:4 gain:4.0 adv:12.0 musc:0.0 myst:0.0 mox:35.0 meat:1599 own:2 value:3494
> Choosing drink to consume.
> <b>rockin' wagon</b> lev:4 gain:4.0 adv:12.0 musc:0.0 myst:0.0 mox:35.0 meat:1599 own:2 value:3494
> acquiring a chef-in-the-box in 0 seconds
The loop changes further down to
Code:
use 1 chef-in-the-box
> acquiring a bartender-in-the-box in 0 seconds
> Creating a rockin' wagon in 0 seconds
> FAIL: <b>rockin' wagon</b> lev:4 gain:4.0 adv:12.0 musc:0.0 myst:0.0 mox:35.0 meat:1599 own:2 value:3494
> Choosing drink to consume.
> <b>rockin' wagon</b> lev:4 gain:4.0 adv:12.0 musc:0.0 myst:0.0 mox:35.0 meat:1599 own:2 value:3494
> acquiring a chef-in-the-box in 0 seconds

use 1 chef-in-the-box
> acquiring a bartender-in-the-box in 0 seconds
> Creating a rockin' wagon in 0 seconds
> FAIL: <b>rockin' wagon</b> lev:4 gain:4.0 adv:12.0 musc:0.0 myst:0.0 mox:35.0 meat:1599 own:2 value:3494
> Choosing drink to consume.
> <b>rockin' wagon</b> lev:4 gain:4.0 adv:12.0 musc:0.0 myst:0.0 mox:35.0 meat:1599 own:2 value:3494
> acquiring a chef-in-the-box in 0 seconds
 
Last edited:
Top