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

@hairball - good idea. Not high on my priority list, though - if someone else wants to prep the patch I'll roll it in.
 
ode to booze support (via moods)

I inserted the following code to eatdrink.ash:
(Line numbers, of course, are subject to the insertion of code before it)

Line 67 (prefs to control the use of ode)
Code:
// Do you want to invoke Ode before drinking?
// This only works if you actually possess the skill
boolean wants_ode = true;
if (have_skill($skill[the ode to booze]) == false)
{ wants_ode = false; }

// If you want to invoke "the ode to booze" we will do it via a mood
// list your mood here that contains Ode
string boozeMood = "booze";
string tempMood = "NONENONENONE";

Line 1040 (bold stuff is new code -- this is the boolean consumeone function)
Code:
      if (type == "booze")
      {
[b]	// Lets see if we want to get some ode via a mood!
	if (have_effect($effect[the ode to booze]) == 0 && wants_ode == true)
	{
		// save the current mood
		tempMood = get_property("currentMood");
		print("Invoking Ode to Booze.", "blue");
		cli_execute("mood " + boozeMood);
		cli_execute("mood execute");
	}
	// drinky stuff now [/b]
	if (SUPRESS_OVERDRINK)

And finally, some mood restoration after the final report is generated
(again, bolded code is new code)

Line 1397
Code:
  print_html(finalsummary);
  cli_execute("outfit checkpoint");
[b]  if (tempMood != "NONENONENONE")
  {
	print("Now restoring previous mood ...");
	cli_execute("mood " + tempMood);
	cli_execute("mood execute");
  }[/b]
}

I am also attaching the modified file.
 

Attachments

Cool, Kain! If anyone has a chance to test Kain's changes let me know and I'll roll it in to the next eatdrink.ash update.
 
Instead of invoking a mood, why not just use use_skill( 1 , $skill[Ode to Booze] )?

if you have 3 AT buffs, it won't auto-shrug one if you just try to invoke the skill.

If you invoke a mood, mafia will shrug your lowest-count AT buff to make room for Ode.

Cool, Kain! If anyone has a chance to test Kain's changes let me know and I'll roll it in to the next eatdrink.ash update.

My chars are now using this :)
 
It seems to be having trouble connecting to the items of loathing. It fills the CLI with "Wiki price not found", and then goes on to calculating food values.
 
Is EatDrink not able to figure out what dusty bottle to drink? Right now it seems to like boilermakers for me, I can't imagine that they're significantly better than snake glyph wine.
 
It went through all dusty bottles for me for some reason, it drank a bunch of the bad ones.
This script needs an update.

Also, price.ash is busted, Zarqon no longer supports the wiki part so that needs to be edited out of the script. That is the source of the "wiki price not found"
 
How should it handle the case where you already have 3 AT buffs? Just randomly shrug one? That would suck, since it might be something you have 10k turns of from a buffbot, or something you really need (like Chorale).
 
Well, it could try asking...

Do you want to shrug 10000 turns of Aria of Aptitude?

Do you want to shrug 25 turns of Chorale of Companionship?

Do you want to shrug 300 turn of Moxious Madrigal?

As soon as you get a yes, then shrug that one. To save you a little typing, here's a little something I have lying around:

Code:
int total_at() {
	if(have_equipped($item[plexiglass pendant]) || have_equipped($item[brimstone beret]))
		return 4;
	return 3;
}

int [skill] at_buffs() {
	skill [int] all_at;
		all_at[count(all_at)] = $skill[The Moxious Madrigal];
		all_at[count(all_at)] = $skill[The Magical Mojomuscular Melody];
		all_at[count(all_at)] = $skill[Cletus's Canticle of Celerity];
		all_at[count(all_at)] = $skill[The Power Ballad of the Arrowsmith];
		all_at[count(all_at)] = $skill[The Polka of Plenty];
		all_at[count(all_at)] = $skill[Jackasses' Symphony of Destruction];
		all_at[count(all_at)] = $skill[Fat Leon's Phat Loot Lyric];
		all_at[count(all_at)] = $skill[Brawnee's Anthem of Absorption];
		all_at[count(all_at)] = $skill[The Psalm of Pointiness];
		all_at[count(all_at)] = $skill[Stevedave's Shanty of Superiority];
		all_at[count(all_at)] = $skill[Aloysius' Antiphon of Aptitude];
		all_at[count(all_at)] = $skill[The Ode to Booze];
		all_at[count(all_at)] = $skill[The Sonata of Sneakiness];
		all_at[count(all_at)] = $skill[Carlweather's Cantata of Confrontation];
		all_at[count(all_at)] = $skill[Ur-Kel's Aria of Annoyance];
		all_at[count(all_at)] = $skill[Dirge of Dreadfulness];
		all_at[count(all_at)] = $skill[The Ballad of Richie Thingfinder];
		all_at[count(all_at)] = $skill[Benetton's Medley of Diversity];
		all_at[count(all_at)] = $skill[Elron's Explosive Etude];
		all_at[count(all_at)] = $skill[Chorale of Companionship];
		all_at[count(all_at)] = $skill[Prelude of Precision];
		all_at[count(all_at)] = $skill[Donho's Bubbly Ballad];

	int [skill] current_at;
	foreach key in all_at
		if(all_at[key]. to_effect(). have_effect() > 0)
			current_at[all_at[key]] = all_at[key]. to_effect(). have_effect();
	return current_at;
}

Yes, there is a reason why I was using $skill[] instead of $effect[], but I didn't bother copying over that part of the script. Just assume I'm not stupid and make the change for yourself if you use it this way. :)
 
Last edited:
Cool! I don't like interactive scripts, personally, so I'm not going to make the change, but if someone wants to add it it's a nice addition.
 
So is this script still functioning? I've been away for a while and I've just been looking through scripts that have been written since then and this one looked very interesting.

However, when I attempt to run it, I get this error.

Expected ), found = (eatdrink.ash, line 1027)

The line in question is:
if (type = "food")
 
The version bundled with ascend.ash is functioning; I don't know if the one here is. I'll see about updating it, but for the time being, you can just change the = to a == and it will work.
 
The version bundled with ascend.ash is functioning; I don't know if the one here is. I'll see about updating it, but for the time being, you can just change the = to a == and it will work.

Ah, OK. I'll admit the ascend.ash script also intrigues me. I'm just trying to decide if it's worth a Mr. Accessory to me. It probably is, but I'm notoriously indecisive! ;)

OK, I'll try substituting = to ==. Should I do that throughout the entire script, or just that instance? (So much has changed in my absence I'm fairly hopeless with the ASH at the moment...)

Edit: OK, I had to change a few lines, but I got it working. Looks good so far, now to play around with it a bit. :)

Edit 2: Hmmm... OK. Stuck in a loop?

Loading ItemsOfLoathing file for the day
LastItemsOfLoathingUpdate => 20090728
Wiki price not found
Wiki price not found
Wiki price not found
...I aborted after 50 or so of these. Or is this normal operation and I pulled the plug too soon?
 
Last edited:
Sadly that is normal operation. It's a little broke because one of its functions is no longer supported. It's not really important and if you ignore that, the script will only do it a few hundred times before operating properly.

I'm going to have to check out the version in Ascend.ash to see if it is better.
 
OK, good to know. I'll just let it run and see what happens. Thanks!

Maybe that Ascension script is going to cost me a Mr. Accessory... :p

Edit: Hmmm... Interesting. I guess I'm a little lost as to what this thing is optimizing. Is there a way to tell it you are more interested in adventures than stats? It wants to drink 19 Thistle Wines instead of 3 TPS drinks. Wouldn't 3 TPS drinks and a wine net more adventures than 19 wines?

Would increasing the meat per adventure value switch to TPS drinks?

And it wants to drink me to 19 drunkeness then finish me off with a TPS drink. Does setting the overdrink to False keep it from drinking you into a stupor before you run your adventures?

I guess I can just play around with it a bit more in simulation mode before going for it, but since I'm a bit in the dark about what it's doing, maybe if someone knows the answers it would be a better idea. :)

Please excuse my ignorance!
 
Last edited:
- The ascend.ash version is much better since it uses the more server-intensive approach of querying for the mall price of each item. That particular change is why I forked codebases; this code gets a lot of use, and I didn't want the free, widely-used version to be quite so server-hit-intensive. The comparatively small number of people who use ascend.ash get the faster, more accurate, but more server intensive algorithm.

CHeck through the configurations; there are lots of settings that could lead you to one or the other, for example:
- you're in ronin, or simulating being in ronin
- you're low level, or simulating being low level
- you have your TPS closeted or hagnk'd or something
- you don't have a bartender in your campsite
- your meat-per-adventure (or per-pull, or per-stat) numbers are wonky (likely MPA is too low)
etc.

Also note that the script is optimized for actual consumption; simulation is comparatively buggy. Not reassuring, I know, but keep your hand on the ESC key and it won't do anything without telling you what it's about to do and waiting 3 seconds, so you have time to interrupt if you don't like the action it's about to perform.
 
Oh - and it's almost trivially easy to switch from the slow/buggy price lookup to the server intensive version; feel free to do that yourself and save yourself from having to get ascend.ash. It's not meant to force you to get the other version. :) Just a speedbump to keep from creating too big of a server suck.
 
Back
Top