Page 1 of 218 1 2 3 11 51 101 ... LastLast
Results 1 to 10 of 2180

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

  1. #1
    Senior Member
    Join Date
    Sep 2008
    Posts
    795

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

    EatDrink 3.2
    your fast food source

    EatDrink.ash will attempt to fill you up with the finest vittles, firewater, and spleenables that the kingdom has to offer - and that you can afford. It considers things like prices, the relative value of adventures and stats, whether you have to pull or purchase the item, and so on. It even ends your day with a bang by overdrinking (if you tell it to). Here's how to use it.


    1. From kolmafia, type "EatDrink.ash". At the prompts, enter "15" for foodMax, "19" for drinkMax, "15" for spleen, "true" for overdrink, and "true" for simulate_only. Observe as it recommends a diet, and compares it to your favorite foods.
    2. Edit the config file for your character (see zlib for details on how the config file works) and try modifying VALUE_OF_PRIME_STAT, and VALUE_OF_NONPRIME_STAT. These will affect how much you're willing to spend to get the comparative increases. Then run again, until you like what you see. Be sure to do it in the config file, as changes in the actual script won't make a difference (the script just sets defaults).
    3. Change mafia's valueOfAdventure variable using "set valueOfAdventure=X", filling in the value you want for X.
    4. Ready to turn over your daily diet? Fool! Run it again, choosing "false" for sim_only, and unleash havoc on your belly (and liver, and spleen).

    Since this script uses actual live prices, it will produce different results on different days. That means that if something tasty crashes in price, it will switch you over from your regular diet - or if your regular diet gets bid up in the store, you'll seamlessly move over to something more affordable.

    It will even cope with misreported prices - that is, if the pricing sources are wrong. If it tries to buy something for the reported price and fails, it will update the "last known good" price to reflect that, and recalculate. It may iterate a few times, bidding more each time, but it will eventually figure out that it can't get the item for that price and something else will pop to the top of the stack.

    Other features:

    • Buys milk of magnesium if it's cost-effective, and takes Ode into account
    • Ditto for the chocolate families (fancy chocolates, vitochocanutriment capusles, etc)
    • If you have a TPS, will do smart things with pricing & crafting TPS drinks
    • If you have a key lime pie & don't have the corresponding key, it gets eaten first
    • Lets you simulate low-level ronin play for ascension planning (via SIM_LEVEL and SIM_RONIN)
    • Crafts food if you have all the components
    • Summarizes results/recommendations at the end
    • Uses zlib.ash and plays nicely with it and other scripts that use it
    • Uses live and historical prices
    • If you have ever consumed something, it will permanently put it on the "check daily" list and check pricing more aggressively
    • Consider and use tuxedo shirts

    Bug reports are nice; bug fixes are nicer.



    Installation Instructions
    Distribution has migrated over to SVN. With a current daily build, please copy/paste the following line into KoLmafia's CLI and press enter:
    Code:
    svn checkout https://svn.code.sf.net/p/therazekolmafia/eatdrink/code/


    Huge thanks to Sandiman; I based this on his reportConsumables script. Ditto Zarqon for zlib and general advice and improvements. Ditto zecious babaloni for running the old pricing service that this used to use. Ditto degrassi for the versioning. And most importantly, huge thanks to the kolmafia dev team who made this all possible!


    Moderator update.
    valueOfAdventure is a KoLMafia property. You can set it by typing set valueOfAdventure = 1000 in the gCLI.

    10 MAR 2011
    Fronobulax here, taking advantage of my developer status with elevated editing privileges. The failure of EatDrink to check for updates the way God, or zarqon, intended combined with the proliferation of versions has compelled me to take action. Henceforth I will keep my support for EatDrink in one place, here. I will post versions and update version numbers.

    V3.1 is the "latest" version and re-establishes a baseline. Compared to Theraze's version here this version has code from Bale that improves the handling of fancy chocolates, lacks the code from Bale et. al. that changes the parameters to strings when EatDrink is invoked directly and retains code for handling Ode To Booze as part of a mood that is absent in Theraze's version. I am willing to discuss adding those features but I wanted to start off with a script that I had tested.

    15 MAR 2011
    V3.1.1 - Changed local variable names to avoid name conflict with OCD. Deleted use of moods to control Ode to Booze as per Theraze.

    02 APR 2011
    V3.1.2 - Do not save what was consumed as a eatdrink_daily variable since that tends to clutter up data files for no purpose. Also use $item[none] rather than make a special case for the Genalen bottle.

    16 APR 2011
    V3.1.3 - Theraze's tweaks to better handle cases where item cannot be consumed because of price or other constraints.

    16 SEP 2011
    V3.1.5 - Skipped 3.1.4 to avoid confusion with extended beta development after 3.1.3. DO NOT use this version until after you upgrade to KoLmafia 14.8. In general, this version is better at obtaining items before they are consumed and adjusting The Plan if it cannot get what it expects. See This post for more details.

    01 JAN 2012
    No update but this post has some good information about EatDrink parameters.

    28 JAN 2012
    Updated. See detailed notes in #1433. Most significant change seems to be that drunki-bears are avoided. Also note, since it doesn't seem to be noted elsewhere, that EatDrink requires zlib in your scripts directory in order to run.

    28 JAN 2012 Whoops. Got overdrink failure logic backwards and fixed it. Bumping version because that's how I roll.

    21 OCT 2012 - 3.1.8 - Better handling of lasagnas. Added support for Boris and Zombie runs.

    12 JAN 2013 - 3.1.9 - Better handling of boxen creation. zLib variable is now controls price to create rather than just YES/NO. Better support for Carboloading trophy. Added mr. mediocrebar support. Thanks, Theraze.
    Last edited by fronobulax; 06-17-2013 at 06:09 PM. Reason: Update.

  2. #2
    Senior Member zarqon's Avatar
    Join Date
    Nov 2007
    Location
    Seoul, Korea
    Posts
    3,434

    Default Re: EatDrink:a script to fill up optimally. Tomorrow you may be beaten up!

    Enjoyed the Epicurean thread title. You should include a "Eating and drinking complete. Be merry at your own discretion." at the end of your script.

    This must be that mysterious big project you've been mentioning eh? Looking forward to checking it out later today! (Whereupon I'll have to edit this post so it makes sense. )

    EDIT: Yep, makes no sense now. You even changed the thread title.
    Sig by JakAtk
    My scripts: One-Click Wossname | Om******t (??) | Psychose-a-Matic | RandBot
    Combat suite: Best Between Battle | Mer********d (?!) | SmartStasis | BatMan | BatMan RE
    For script authors: ASH Wiki | ZLib | BatBrain | CLI Links | CanAdv | Script Registry | Map Manager | About Bats
    If you appreciate my work, help me become BAT KING OF THE WORLD! Thanks to all donators!

  3. #3
    Senior Member
    Join Date
    Sep 2008
    Posts
    795

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

    Speak up lurkers! Eager to hear what you think of it.

    Anyone know how to suppress the overdrink prompt? I'd like to give the option of having this run fully unattended. One click moveable feast (OCMF?), if you will.
    My scripts: Ascend for automatic ascensions, Farm to make more money than castlefarming, EatDrink for the maximum number of turns each day, LevelUp to gain a level safely, and PullCrap to manage your pulls in ronin.

  4. #4

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

    [quote author=dj_d link=topic=2038.msg10090#msg10090 date=1228198179]
    Anyone know how to suppress the overdrink prompt? I'd like to give the option of having this run fully unattended. One click moveable feast (OCMF?), if you will.
    [/quote]

    Yes, this.

    Code:
    Revision: 6512
    Author: jasonharper
    Date: 22:07:59, woensdag 19 november 2008
    Message:
    Adds "overdrink" command to CLI, which behaves exactly the same as "drink"
    except that there won't be any confirmation dialogs if this would get you
    falling-down drunk with turns remaining, or if you don't have enough MP to
    cast Ode to Booze. Useful if you need to queue up some actions before
    rollover and won't be around to answer any dialogs.
    Also, the script looks very interesting. I plan on trying it out soon and am excited to see how it works out. Thanks for the hard work.

  5. #5
    Senior Member
    Join Date
    Sep 2008
    Posts
    795

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

    Thanks dangerpin! I'm always surprised what it turns up... it's clear that my diet has usually been suboptimal. And so, I suspect, has almost everyone else's. I have to say that I seriously considered stocking up on a few of the high-value foods the script suggested in anticipation of a price increase...

    Thanks for the info on overdrink(). On a related note, is there some way to conditionally include code depending on the kolmafia version? I hate to produce scripts that can only be run on experimental versions, and there's a few functions I'd add if I could be sure they wouldn't break users of the "release" build.
    My scripts: Ascend for automatic ascensions, Farm to make more money than castlefarming, EatDrink for the maximum number of turns each day, LevelUp to gain a level safely, and PullCrap to manage your pulls in ronin.

  6. #6
    Senior Member zarqon's Avatar
    Join Date
    Nov 2007
    Location
    Seoul, Korea
    Posts
    3,434

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

    Frig, this is a huge and impressive undertaking. (Scripts don't often make me say 'frig.&#039 I'm still processing it, but so far I'm very impressed. I'd like a way for this script to only have to filter stuff once, instead of between every item consumption, particularly if SIM is true, since with SIM on there would be no unexpected results. It would really speed it up. I think moving filter_availability() before the while loop and decrementing map_today[it].numOwned in consume_one() ought to do it.

    Also, I think auto-spading the number of adventures gained (you're doing that right?), unless it can take into consideration moon sign and consumption helpers, is a bit dangerous.

    [quote author=dj_d link=topic=2038.msg10109#msg10109 date=1228279341]
    there's a few functions I'd add if I could be sure they wouldn't break users of the "release" build.
    [/quote]

    As others before me have pointed out, there's not really anything differentiating a release build from a daily build, except that no one knew of anything broken at the time it was released. The most recent "release" build is from before all the crafting changes! (i.e. it basically doesn't work anymore.) Just write for the most recent daily... besides, I think most of the users who d/l scripts from here also keep up with the daily builds.

    Nice work, dj_d! After I test it enough to satisfy myself with it, this script will probably become a vital part of my HC runs.
    Sig by JakAtk
    My scripts: One-Click Wossname | Om******t (??) | Psychose-a-Matic | RandBot
    Combat suite: Best Between Battle | Mer********d (?!) | SmartStasis | BatMan | BatMan RE
    For script authors: ASH Wiki | ZLib | BatBrain | CLI Links | CanAdv | Script Registry | Map Manager | About Bats
    If you appreciate my work, help me become BAT KING OF THE WORLD! Thanks to all donators!

  7. #7
    Senior Member
    Join Date
    Nov 2007
    Posts
    225

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

    Man, this looks sweet, can't wait to try it out.

  8. #8
    Senior Member
    Join Date
    Nov 2007
    Posts
    225

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

    Two things,
    1) The script says it needs to be updated but i can't find a ver 1.03 script, Not sure if maybe you just forgot to change the value or if i can't find the new ver.
    2) Update_from_mafia() keeps causing the scipt to create an unexpected error... i didn't trace it any further then that though.

  9. #9
    Senior Member
    Join Date
    Sep 2008
    Posts
    795

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

    Zarqon, Paragon, thanks! You guys are two of the most impressive script authors around, so I appreciate your feedback.

    ver.ash caches its results for the day. That can cause the version check to fail even when you're current. I've included a fix in 1.04.

    With you 100% on inefficiencies in calculation. While there's more room for improvement, 1.04 recalculates only the values & availability of the items you consume, so each iteration after the first goes faster.

    Autospade suggestion is a good one. 1.04 turns it off by default with a config variable. Suggestions for how to get around this (even as simple as not autospading when stat days or effects are present) are welcome.

    I'll take a look at update_from_mafia, but if you could narrow it down a bit, that'd be helpful.
    My scripts: Ascend for automatic ascensions, Farm to make more money than castlefarming, EatDrink for the maximum number of turns each day, LevelUp to gain a level safely, and PullCrap to manage your pulls in ronin.

  10. #10
    Senior Member
    Join Date
    Sep 2008
    Posts
    795

    Default Re: EatDrink:a script to fill up optimally. Tomorrow you may be beaten up!

    [quote author=zarqon link=topic=2038.msg10061#msg10061 date=1228002585]
    EDIT: Yep, makes no sense now. You even changed the thread title.
    [/quote]

    It's still there in the subtitle, though.
    My scripts: Ascend for automatic ascensions, Farm to make more money than castlefarming, EatDrink for the maximum number of turns each day, LevelUp to gain a level safely, and PullCrap to manage your pulls in ronin.

Similar Threads

  1. 14784: optimize a bit by reusing the same xml serializer
    By RSS Bot in forum Latest SVN Changes
    Replies: 0
    Last Post: 10-02-2014, 02:21 AM
  2. 600 - 700 ADV diet!! T
    By scrambles in forum Item Handling Scripts
    Replies: 20
    Last Post: 08-08-2012, 06:32 AM
  3. 11060: optimize table renderer a bit
    By RSS Bot in forum Latest SVN Changes
    Replies: 0
    Last Post: 06-01-2012, 04:50 PM
  4. consumption.ash -- an EatDrink alternative
    By heeheehee in forum Informational Scripts
    Replies: 6
    Last Post: 11-17-2011, 04:43 AM
  5. PvP Diet Balance and Wine tasting. [spoilers]
    By Darkness in forum Scripting Discussion
    Replies: 2
    Last Post: 03-12-2007, 03:29 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •