View Full Version : EatDrink.ash: Optimize your daily diet (and see how your old diet stacks up).
EatDrink 3.1.7
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.
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.
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).
Change mafia's valueOfAdventure variable using "set valueOfAdventure=X", filling in the value you want for X.
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. :)
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 (http://kolmafia.us/showthread.php?1519-EatDrink.ash-Optimize-your-daily-diet-%28and-see-how-your-old-diet-stacks-up%29.&p=44638&viewfull=1#post44638) 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 (http://kolmafia.us/showthread.php?1519-EatDrink.ash-Optimize-your-daily-diet-%28and-see-how-your-old-diet-stacks-up%29.&p=59840&viewfull=1#post59840) for more details.
01 JAN 2012
No update but this post (http://kolmafia.us/showthread.php?1519-EatDrink-ash-Optimize-your-daily-diet-%28and-see-how-your-old-diet-stacks-up%29&p=65677&viewfull=1#post65677) has some good information about EatDrink parameters.
28 JAN 2012
Updated. See detailed notes in #1433 (http://kolmafia.us/showthread.php?1519-EatDrink-ash-Optimize-your-daily-diet-%28and-see-how-your-old-diet-stacks-up%29&p=66946&viewfull=1#post66946). 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 (http://kolmafia.us/showthread.php?2072-ZLib-Zarqon-s-useful-function-library) in your scripts directory in order to run.
28 JAN 2012 Whoops (http://kolmafia.us/showthread.php?1519-EatDrink-ash-Optimize-your-daily-diet-%28and-see-how-your-old-diet-stacks-up%29&p=67061&viewfull=1#post67061). Got overdrink failure logic backwards and fixed it. Bumping version because that's how I roll.
zarqon
11-29-2008, 10:49 PM
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.
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.
dangerpin
12-02-2008, 05:37 AM
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.
Yes, this.
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.
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.
zarqon
12-03-2008, 05:10 AM
Frig, this is a huge and impressive undertaking. (Scripts don't often make me say 'frig.') 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.
there's a few functions I'd add if I could be sure they wouldn't break users of the "release" build.
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.
Paragon
12-03-2008, 07:37 AM
Man, this looks sweet, can't wait to try it out.
Paragon
12-03-2008, 08:15 AM
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.
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.
EDIT: Yep, makes no sense now. You even changed the thread title.
It's still there in the subtitle, though. :)
I'm going to start posting new versions in the thread so the old versions are archived somewhere. Don't use this, use the one in the first post.
Also, moving version history to the thread.
Version history:
* 1.0: release
* 1.01: fixed divide-by-zero bug that only manifests on build 6517 and later
* 1.02: If you don't have enough meat in your inventory, it will still recommend eating items (but not buying them). Also, you can call with more parameters if you're calling from a script. You will need the attached eatdrink_drink_data.txt and eatdrink_drink_data.txt (or add a column of 0s to the right of your existing one).
* 1.03: Fixed a bug wherein if you aborted over-drinking, it would conclude that the drink provided 0 adventures and enter autospade results accordingly. Also, don't recommend shop-ables if you're not simulating and you're in ronin or hardcore.
* 1.04: If an item can't be bought, it re-calcs the value of the item at the new, higher price. Minor efficiencies in recalculating. You can import the script and call it with custom parameters (void eatdrink(int foodMax, int drinkMax, boolean overdrink, int advmeat, int primemeat, int offmeat, int pullmeat)). Fixed the version number and changed ver.ash to not fail the version check twice in one day (gets around a bug as well as being less annoying).
caphector
12-08-2008, 07:26 PM
Could you provide a summary at the end of the report? The calculations for drinks started too soon for me to read the food recommendations.
vampirewolf3
12-10-2008, 05:10 AM
Could you provide a summary at the end of the report? The calculations for drinks started too soon for me to read the food recommendations.
Something that sums it all up is definitely needed. I'm confused at to what my new diet should be...
Ask and ye shall receive. 1.05 now prints a summary at the end of the report.
1.06 cleans up summary output and fixes a bug in pricing - basically, the "cost" of a pull was added to the price. No longer. It also prints out the assumptions being used in the summary to facilitate debugging. New functionality for planning ascensions: set SIM_LEVEL to your planned level (e.g. 4) and SIM_RONIN to true, and it'll calculate as if you were level 4 ronin (i.e. include pull costs). Known bug: if you're simulating, it will recommend consuming the same item many times, even if you only own one.
I just updated getonbudget.ash as well to fix a significant bug with buying multiple items at once. eatdrink.ash doesn't do that so the bug wasn't affecting users of the script.
caphector
12-10-2008, 10:50 PM
I'm trying to understand the recommendations that EatDrink.ash is making. Trying to get max adventures from food/drink, don't care about stats. So currently VALUE_OF_ADVENTURE is 100,000, budget is 1,000,000. For my diet it's recommending Jarlsberg's Key Lime Pie x3, a cup of Mulligan Stew, and a Knob Pasty, which it calculates at 71 adventures.
I'd been eating three Hi Meins a day, which average at 75 adventures. Is there a reason that pies are getting recommended over meins?
Drinks calculations make a lot more sense; it recommends either Knob Coffee or Ralph IX cognac, which are far better than my normal Dirty Martinis.
Thanks for the script; it's nice being able to run simulations.
That's not a bug, it's a feature! :)
The attached version has a PIE_PRIORITY flag. If true, then if you're missing a key (and your level permits) you'll make the corresponding pie a priority. That's the current behavior. You want that set to "false". It's very handy for brainless consumption during an ascension, though, as you never find yourself at the NS with 15 fullness, three pies, and no keys.
I'm not going to rev main yet but when I do this'll be in it.
I haven't run it with high thresholds, let me know what you wind up with! Just paste the summary in to the thread.
caphector
12-11-2008, 06:28 PM
Bug fix:
Line 807 should be:
summarize("Now at fullness of "+get_fullness()+", eating to "+foodMax+".");
Thanks for the PIE_PRIORITY flag; that made a big difference.
It's interesting watching the interplay between VALUE_OF_ADVENTURE and BUDGET; if you leave the VALUE_OF_ADVENTURE low with BUDGET high it goes for the most cost-effective expensive consumables.
Here are my test runs:
With BUDGET = 100,000, Value_of_Adventure at 10,000:
Now at fullness of 0, eating to 15.
2: frozen banquet lev:15 gain:6.0 adv:45.0 musc:194.5 myst:194.5 moxie:194.5 price:54000 own:0 value:66097
5: Knob pasty lev:1 gain:1.0 adv:6.5 musc:5.5 myst:5.5 moxie:5.5 price:10969 own:0 value:54047
Now at inebriety of 0, drinking to 19.
19: thermos full of Knob coffee lev:1 gain:1.0 adv:6.5 musc:5.5 myst:5.5 moxie:5.5 price:16400 own:0 value:48616
Now finishing with one big stiff drink.
20: jar of squeeze lev:8 gain:7.0 adv:28.0 musc:35.0 myst:35.0 moxie:35.0 price:43990 own:0 value:202384
Finished. Spent 496497 meat. Gained Fullness: 15. Inebriety: 26. Adventures: 250. Muscle: 533. Moxie: 533. Mysticality: 533.
With BUDGET at 20-50,000, Value_of_Adventure at 10-20,000:
Now at fullness of 0, eating to 15.
15: Knob pasty lev:1 gain:1.0 adv:6.5 musc:5.5 myst:5.5 moxie:5.5 price:10969 own:0 value:54047
Now at inebriety of 0, drinking to 19.
19: thermos full of Knob coffee lev:1 gain:1.0 adv:6.5 musc:5.5 myst:5.5 moxie:5.5 price:16400 own:0 value:48616
Now finishing with one big stiff drink.
20: jar of squeeze lev:8 gain:7.0 adv:28.0 musc:35.0 myst:35.0 moxie:35.0 price:43990 own:0 value:202384
Finished. Spent 520125 meat. Gained Fullness: 15. Inebriety: 26. Adventures: 232. Muscle: 205. Moxie: 205. Mysticality: 205.
Eating and drinking complete. Commence merrymaking (at your own discretion).
With BUDGET at 200,000, Value_of_Adventure at 100,000:
Now at fullness of 0, eating to 15.
7: tin cup of mulligan stew lev:15 gain:2.0 adv:17.0 musc:487.5 myst:656.0 moxie:544.0 price:98500 own:4 value:801593
8: Knob pasty lev:1 gain:1.0 adv:6.5 musc:5.5 myst:5.5 moxie:5.5 price:10969 own:0 value:639047
Now at inebriety of 0, drinking to 19.
9: Hodgman's blanket lev:15 gain:2.0 adv:15.0 musc:550.0 myst:550.0 moxie:550.0 price:129000 own:1 value:686325
10: thermos full of Knob coffee lev:1 gain:1.0 adv:6.5 musc:5.5 myst:5.5 moxie:5.5 price:16400 own:0 value:633616
Now finishing with one big stiff drink.
11: jar of fermented pickle juice lev:13 gain:5.0 adv:32.0 musc:90.0 myst:90.0 moxie:90.0 price:90000 own:0 value:2488220
Finished. Spent 1967869 meat. Gained Fullness: 15. Inebriety: 24. Adventures: 298. Muscle: 8459. Moxie: 8858. Mysticality: 9642.
With BUDGET at 10,000, Value_of_Adventure at 10,000:
Now at fullness of 0, eating to 15.
3: sleazy hi mein lev:7 gain:5.0 adv:25.0 musc:26.5 myst:27.0 moxie:73.0 price:288 own:7 value:49968
Now at inebriety of 0, drinking to 19.
4: prussian cathouse lev:6 gain:4.0 adv:16.0 musc:0.0 myst:0.0 moxie:43.5 price:320 own:0 value:39930
7: cup of primitive beer lev:12 gain:1.0 adv:3.5 musc:57.5 myst:0.0 moxie:0.0 price:1250 own:0 value:33807
Now finishing with one big stiff drink.
8: grogtini lev:6 gain:6.0 adv:24.0 musc:18.0 myst:0.0 moxie:0.0 price:2156 own:0 value:198222
Finished. Spent 8050 meat. Gained Fullness: 15. Inebriety: 25. Adventures: 172. Muscle: 267. Moxie: 391. Mysticality: 81.
Good catch on the bugfix, it'll be in the next update.
The way I designed it (but by no means the way you should necessarily use it) is that you fine-tune the cost-per-adventure until it produces the kind of results you want. Then you set the max budget to something that's high enough it's irrelevant, and it's basically just a safety valve in case the code goes wonky and tries to buy something too expensive. You can definitely use it at a low enough value that it contributes to the filter, but it will disproportionately punish high-fullness items (since it only filters based on item cost).
Glad the TPS code is seeing some use, too. :) One gotcha about that - if you have, say, a grogtini in inventory, then grogtinis will be cheap but other TPS drinks will be expensive. If you have a TPS, then all TPS drinks will be cheap. So if you want to get optimal TPS recommendations, drink your grogtini before running eatdrink.
Here's what I ate today. There's some folks selling cheap food and booze with a limit of one - the cool thing is that the code picks up on it, buys the cheap one, then switches to something else. When you're simulating it can't do that (it has no way to know that only one hi mein is available at that price) but when you're actually buying it gets it right (note the simulation you ran incorrectly assumed you could buy a bunch of hi meins at 300 meat).
Consuming up to 15 food and 19 booze and then finishing off with the stiffest drink we can find.
Considering food from inventory Hagnk's the mall. Per-item budget cap is 25000.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 200 meat. Prime stat subpoint is 4. Nonprime is 1.
Ronin (e.g. everything costs 1 pull) is not being simulated (but will be calculated anyway if true).
Now at fullness of 0, eating to 15.
1: Crimbo pie lev:7 gain:3.0 adv:11.0 musc:35.0 myst:0.0 moxie:0.0 price:160 own:0 value:691
2: pear tart lev:7 gain:3.0 adv:11.0 musc:0.0 myst:35.0 moxie:0.0 price:445 own:0 value:631
3: pear tart lev:7 gain:3.0 adv:11.0 musc:0.0 myst:35.0 moxie:0.0 price:450 own:0 value:629
4: pear tart lev:7 gain:3.0 adv:11.0 musc:0.0 myst:35.0 moxie:0.0 price:450 own:0 value:629
5: pear tart lev:7 gain:3.0 adv:11.0 musc:0.0 myst:35.0 moxie:0.0 price:450 own:0 value:629
Now at inebriety of 0, drinking to 19.
1: horizontal tango lev:4 gain:4.0 adv:12.0 musc:0.0 myst:35.0 moxie:0.0 price:230 own:0 value:578
2: fuzzbump lev:4 gain:4.0 adv:12.0 musc:35.0 myst:0.0 moxie:0.0 price:230 own:0 value:551
3: fuzzbump lev:4 gain:4.0 adv:12.0 musc:35.0 myst:0.0 moxie:0.0 price:230 own:0 value:551
4: fuzzbump lev:4 gain:4.0 adv:12.0 musc:35.0 myst:0.0 moxie:0.0 price:230 own:0 value:551
5: can of Swiller lev:10 gain:1.0 adv:3.0 musc:12.5 myst:0.0 moxie:0.0 price:156 own:0 value:456
6: can of Swiller lev:10 gain:1.0 adv:3.0 musc:12.5 myst:0.0 moxie:0.0 price:170 own:0 value:442
7: can of Swiller lev:10 gain:1.0 adv:3.0 musc:12.5 myst:0.0 moxie:0.0 price:170 own:0 value:442
Now finishing with one big stiff drink.
8: sangria del diablo lev:6 gain:6.0 adv:24.0 musc:0.0 myst:18.0 moxie:0.0 price:2105 own:0 value:2310
Finished. Spent 5720 meat. Gained Fullness: 15. Inebriety: 25. Adventures: 162. Muscle: 175. Moxie: 0. Mysticality: 212.
Eating and drinking complet
Here's an even better example. Not to toot my own - but the code is a terrific bargain hunter (when you're actually consuming; because of pricing restrictions, it's not so efficient at simulating). It picks up on very small price efficiencies - so note the variety in consumption, and how the code scooped up the dirt-cheap one-off spooky hi mein. And if you're meatfarming, you have to be pretty darn productive to justify paying the price premium for noodle dishes vs. pear tarts...
Anyone else have interesting diets?
An adventure has the value of 200 meat. Prime stat subpoint is 4. Nonprime is 1.
1: spooky hi mein lev:7 gain:5.0 adv:25.0 musc:17.5 myst:73.0 moxie:32.5 price:288 own:0 value:1011
2: Crimbo pie lev:7 gain:3.0 adv:11.0 musc:35.0 myst:0.0 moxie:0.0 price:160 own:0 value:691
3: pear tart lev:7 gain:3.0 adv:11.0 musc:0.0 myst:35.0 moxie:0.0 price:450 own:0 value:629
4: pear tart lev:7 gain:3.0 adv:11.0 musc:0.0 myst:35.0 moxie:0.0 price:450 own:0 value:629
5: brain-meltingly-hot chicken wings lev:10 gain:1.0 adv:3.0 musc:22.5 myst:22.5 moxie:0.0 price:170 own:0 value:542
1: Mae West lev:6 gain:4.0 adv:16.0 musc:0.0 myst:0.0 moxie:43.5 price:320 own:0 value:730
2: fuzzbump lev:4 gain:4.0 adv:12.0 musc:35.0 myst:0.0 moxie:0.0 price:230 own:0 value:551
3: sangria del diablo lev:6 gain:6.0 adv:24.0 musc:0.0 myst:18.0 moxie:0.0 price:2109 own:0 value:461
4: shot of pear schnapps lev:8 gain:2.0 adv:6.0 musc:0.0 myst:17.0 moxie:0.0 price:437 own:0 value:416
5: white lightning lev:3 gain:3.0 adv:7.5 musc:0.0 myst:0.0 moxie:0.0 price:295 own:0 value:402
Now finishing with one big stiff drink.
6: cherry bomb lev:6 gain:6.0 adv:24.0 musc:0.0 myst:18.0 moxie:0.0 price:2131 own:0 value:2286
Finished. Spent 7328 meat. Gained Fullness: 15. Inebriety: 25. Adventures: 172. Muscle: 119. Moxie: 98. Mysticality: 203.
asturia
12-15-2008, 06:58 AM
Here is mine:
Now, to recap...
******************************************
Consuming up to 15 food and 19 booze
Considering food from inventory Hagnk's the mall. Per-item budget cap is 25000.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 1000 meat. Prime stat subpoint is 20. Nonprime is 5.
Ronin (e.g. everything costs 1 pull) is not being simulated (but will be calculated anyway if true).
Now at fullness of 0, drinking to 15.
1: spooky hi mein lev:7 gain:5.0 adv:25.0 musc:17.5 myst:73.0 moxie:32.5 price:288 own:0 value:5118
2: spooky hi mein lev:7 gain:5.0 adv:25.0 musc:17.5 myst:73.0 moxie:32.5 price:288 own:0 value:5118
3: spooky hi mein lev:7 gain:5.0 adv:25.0 musc:17.5 myst:73.0 moxie:32.5 price:360 own:0 value:5103
4: spooky hi mein lev:7 gain:5.0 adv:25.0 musc:17.5 myst:73.0 moxie:32.5 price:450 own:0 value:5085
5: spooky hi mein lev:7 gain:5.0 adv:25.0 musc:17.5 myst:73.0 moxie:32.5 price:562 own:0 value:5063
6: spooky hi mein lev:7 gain:5.0 adv:25.0 musc:17.5 myst:73.0 moxie:32.5 price:702 own:0 value:5035
7: spooky hi mein lev:7 gain:5.0 adv:25.0 musc:17.5 myst:73.0 moxie:32.5 price:877 own:0 value:5000
8: spooky hi mein lev:7 gain:5.0 adv:25.0 musc:17.5 myst:73.0 moxie:32.5 price:1096 own:0 value:4956
9: spooky hi mein lev:7 gain:5.0 adv:25.0 musc:17.5 myst:73.0 moxie:32.5 price:1370 own:0 value:4901
10: spooky hi mein lev:7 gain:5.0 adv:25.0 musc:17.5 myst:73.0 moxie:32.5 price:1712 own:0 value:4833
11: spooky hi mein lev:7 gain:5.0 adv:25.0 musc:17.5 myst:73.0 moxie:32.5 price:2140 own:0 value:4747
12: fancy canapés lev:5 gain:2.0 adv:8.5 musc:32.5 myst:32.5 moxie:32.5 price:100 own:0 value:4687
13: fancy canapés lev:5 gain:2.0 adv:8.5 musc:32.5 myst:32.5 moxie:32.5 price:125 own:0 value:4675
14: fancy canapés lev:5 gain:2.0 adv:8.5 musc:32.5 myst:32.5 moxie:32.5 price:156 own:0 value:4659
15: fancy canapés lev:5 gain:2.0 adv:8.5 musc:32.5 myst:32.5 moxie:32.5 price:195 own:0 value:4640
16: spooky hi mein lev:7 gain:5.0 adv:25.0 musc:17.5 myst:73.0 moxie:32.5 price:2675 own:0 value:4640
17: fancy canapés lev:5 gain:2.0 adv:8.5 musc:32.5 myst:32.5 moxie:32.5 price:243 own:0 value:4616
18: fancy canapés lev:5 gain:2.0 adv:8.5 musc:32.5 myst:32.5 moxie:32.5 price:303 own:0 value:4586
19: fancy canapés lev:5 gain:2.0 adv:8.5 musc:32.5 myst:32.5 moxie:32.5 price:378 own:0 value:4548
20: spooky hi mein lev:7 gain:5.0 adv:25.0 musc:17.5 myst:73.0 moxie:32.5 price:3343 own:0 value:4507
21: fancy canapés lev:5 gain:2.0 adv:8.5 musc:32.5 myst:32.5 moxie:32.5 price:472 own:0 value:4501
22: fancy canapés lev:5 gain:2.0 adv:8.5 musc:32.5 myst:32.5 moxie:32.5 price:590 own:0 value:4442
23: fancy canapés lev:5 gain:2.0 adv:8.5 musc:32.5 myst:32.5 moxie:32.5 price:737 own:0 value:4369
24: spooky hi mein lev:7 gain:5.0 adv:25.0 musc:17.5 myst:73.0 moxie:32.5 price:4178 own:0 value:4340
25: Knob sausage chow mein lev:7 gain:5.0 adv:25.0 musc:74.0 myst:0.0 moxie:0.0 price:5000 own:0 value:4296
26: Knob sausage chow mein lev:7 gain:5.0 adv:25.0 musc:74.0 myst:0.0 moxie:0.0 price:4989 own:0 value:4299
Now at inebriety of 0, drinking to 19.
1: Mon Tiki lev:6 gain:4.0 adv:16.0 musc:43.5 myst:0.0 moxie:0.0 price:320 own:14 value:4137
2: Mon Tiki lev:6 gain:4.0 adv:16.0 musc:43.5 myst:0.0 moxie:0.0 price:320 own:13 value:4137
3: Mon Tiki lev:6 gain:4.0 adv:16.0 musc:43.5 myst:0.0 moxie:0.0 price:320 own:12 value:4137
4: Mon Tiki lev:6 gain:4.0 adv:16.0 musc:43.5 myst:0.0 moxie:0.0 price:320 own:11 value:4137
5: cup of primitive beer lev:12 gain:1.0 adv:3.5 musc:57.5 myst:0.0 moxie:0.0 price:1150 own:0 value:3500
6: cup of primitive beer lev:12 gain:1.0 adv:3.5 musc:57.5 myst:0.0 moxie:0.0 price:1100 own:0 value:3550
7: cup of primitive beer lev:12 gain:1.0 adv:3.5 musc:57.5 myst:0.0 moxie:0.0 price:1100 own:0 value:3550
Finished. Spent 13566 meat. Gained Fullness: 15. Inebriety: 19. Adventures: 184. Muscle: 520. Moxie: 43. Mysticality: 71.
Eating and drinking complete. Commence merrymaking (at your own discretion).
Thanks asturia... you motivated me to clean up the output code. The new version, 1.07, should produce cleaner output. It also fixes some other details, like prompting you if you want to simulate or not at runtime.
asturia
12-16-2008, 07:15 PM
no problem will post another log tomorrow.
asturia
12-17-2008, 06:27 AM
here is another log of mine:
Consuming up to 15 food and 19 booze
Considering food from inventory Hagnk's the mall. Per-item budget cap is 12500.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 200 meat. Prime stat subpoint is 4. Nonprime is 1.
Ronin (e.g. everything costs 1 pull) is not being simulated (but will be calculated anyway if true).
Now at fullness of 0, eating to 15.
1: blob-shaped Crimbo cookie lev:7 gain:2.0 adv:9.0 musc:0.0 myst:0.0 moxie:0.0 price:100 own:2 value:850
2: blob-shaped Crimbo cookie lev:7 gain:2.0 adv:9.0 musc:0.0 myst:0.0 moxie:0.0 price:100 own:1 value:850
3: Crimbo pie lev:7 gain:3.0 adv:11.0 musc:35.0 myst:0.0 moxie:0.0 price:160 own:0 value:726
4: Crimbo pie lev:7 gain:3.0 adv:11.0 musc:35.0 myst:0.0 moxie:0.0 price:390 own:0 value:649
5: Crimbo pie lev:7 gain:3.0 adv:11.0 musc:35.0 myst:0.0 moxie:0.0 price:450 own:0 value:629
6: Genalen™ Bottle lev:10 gain:1.0 adv:3.0 musc:22.5 myst:22.5 moxie:0.0 price:100 own:10 value:612
7: Genalen™ Bottle lev:10 gain:1.0 adv:3.0 musc:22.5 myst:22.5 moxie:0.0 price:100 own:9 value:612
Now at inebriety of 0, drinking to 19.
1: black & tan lev:7 gain:2.0 adv:6.5 musc:11.0 myst:11.0 moxie:11.0 price:100 own:3 value:633
2: black & tan lev:7 gain:2.0 adv:6.5 musc:11.0 myst:11.0 moxie:11.0 price:100 own:2 value:633
3: black & tan lev:7 gain:2.0 adv:6.5 musc:11.0 myst:11.0 moxie:11.0 price:100 own:1 value:633
4: fuzzbump lev:4 gain:4.0 adv:12.0 musc:35.0 myst:0.0 moxie:0.0 price:230 own:1 value:578
5: thistle wine lev:10 gain:1.0 adv:3.0 musc:0.0 myst:0.0 moxie:45.0 price:170 own:11 value:475
6: thistle wine lev:10 gain:1.0 adv:3.0 musc:0.0 myst:0.0 moxie:45.0 price:170 own:10 value:475
7: thistle wine lev:10 gain:1.0 adv:3.0 musc:0.0 myst:0.0 moxie:45.0 price:170 own:9 value:475
8: thistle wine lev:10 gain:1.0 adv:3.0 musc:0.0 myst:0.0 moxie:45.0 price:170 own:8 value:475
9: thistle wine lev:10 gain:1.0 adv:3.0 musc:0.0 myst:0.0 moxie:45.0 price:170 own:7 value:475
10: thistle wine lev:10 gain:1.0 adv:3.0 musc:0.0 myst:0.0 moxie:45.0 price:170 own:6 value:475
11: thistle wine lev:10 gain:1.0 adv:3.0 musc:0.0 myst:0.0 moxie:45.0 price:170 own:5 value:475
12: thistle wine lev:10 gain:1.0 adv:3.0 musc:0.0 myst:0.0 moxie:45.0 price:170 own:4 value:475
13: thistle wine lev:10 gain:1.0 adv:3.0 musc:0.0 myst:0.0 moxie:45.0 price:170 own:3 value:475
Finished. Spent 1060 meat. Gained Fullness: 15. Inebriety: 19. Adventures: 144. Muscle: 209. Moxie: 453. Mysticality: 80.
Eating and drinking complete. Commence merrymaking (at your own discretion).
Cool! Now, simulating is a very imperfect art because there's often only one (or none!) available at the price the websites list. I'd love to see the log when you turn off "sim" and use it to consume for real. Note that if you do this and watch closely with your finger on the escape key, you have plenty of time to abort any actions before they're committed (in case you're curious but not fully trusting!).
asturia
12-19-2008, 06:04 AM
that was a real log :)
I'll submit another one soon.
Doh! Sorry, just looked at the absurdly low price of the first item. Unfortunately, if you have the item in inventory, it has to use the web lookup for the price - which can be wildly inaccurate. It's at its best when it's shopping for you, since it can refine the prices very precisely.
Big update coming shortly, with full milk of magnesium support and more...
asturia
12-19-2008, 07:42 AM
Latest log.
If you could include milk of magnesium that would be great.
******************************************
Now, to recap...
******************************************
Consuming up to 15 food and 19 booze
Considering food from inventory Hagnk's the mall. Per-item budget cap is 18750.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 2000 meat. Prime stat subpoint is 4. Nonprime is 1.
Ronin (e.g. everything costs 1 pull) is not being simulated (but will be calculated anyway if true).
Now at fullness of 0, eating to 15.
1: Knob sausage chow mein lev:7 gain:5.0 adv:25.0 musc:74.0 myst:0.0 moxie:0.0 price:4999 own:0 value:9060
2: Knob sausage chow mein lev:7 gain:5.0 adv:25.0 musc:74.0 myst:0.0 moxie:0.0 price:4970 own:0 value:9065
3: bat wing chow mein lev:7 gain:5.0 adv:25.0 musc:0.0 myst:72.5 moxie:0.0 price:4995 own:0 value:9015
Now at inebriety of 0, drinking to 19.
1: grogtini lev:6 gain:6.0 adv:24.0 musc:18.0 myst:0.0 moxie:0.0 price:2358 own:0 value:7619
2: grogtini lev:6 gain:6.0 adv:24.0 musc:18.0 myst:0.0 moxie:0.0 price:2322 own:0 value:7625
3: grogtini lev:6 gain:6.0 adv:24.0 musc:18.0 myst:0.0 moxie:0.0 price:2322 own:0 value:7625
4: cup of primitive beer lev:12 gain:1.0 adv:3.5 musc:57.5 myst:0.0 moxie:0.0 price:999 own:0 value:6231
Finished. Spent 26655 meat. Gained Fullness: 15. Inebriety: 19. Adventures: 170. Muscle: 261. Moxie: 0. Mysticality: 88.
Eating and drinking complete. Commence merrymaking (at your own discretion).
Try this. It should automatically determine if milk is a good investment, and, if so, buy and use it. When choosing food & drink, it will take milk & ode effects into account as well.
And finally...
Spleen!
I'm not going to update the first post until it gets a bit more testing. I'd really like to hear how it works for you.
asturia
12-19-2008, 11:30 AM
Will try it tomorrow since I'm already full today.
but thanks for this update
asturia
12-21-2008, 11:50 AM
another log:
btw is it possible to make the script a little faster as it seems that it takes a long time to run now. But I'm very hapy with it.
******************************************
Now, to recap...
******************************************
Consuming up to 15 food, 19 booze, and 15 spleen
Considering food from inventory Hagnk's the mall. Per-item budget cap is 12500.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 1100 meat. Muscle subpoint is 0. Nonprime stat subpoint is 0.
Now at fullness of 0, eating to 15.
0: milk of magnesium price: 1100
1: Knob sausage chow mein lev:7 gain:5.0 adv:25.0 musc:74.0 myst:0.0 moxie:0.0 price:4970 own:1 value:4506
2: Knob sausage chow mein lev:7 gain:5.0 adv:25.0 musc:74.0 myst:0.0 moxie:0.0 price:4970 own:0 value:5386
3: Knob sausage chow mein lev:7 gain:5.0 adv:25.0 musc:74.0 myst:0.0 moxie:0.0 price:4800 own:0 value:5420
Now at inebriety of 0, drinking to 19.
1: grogtini lev:6 gain:6.0 adv:24.0 musc:18.0 myst:0.0 moxie:0.0 price:2112 own:0 value:4781
2: grogtini lev:6 gain:6.0 adv:24.0 musc:18.0 myst:0.0 moxie:0.0 price:2100 own:0 value:4783
3: grogtini lev:6 gain:6.0 adv:24.0 musc:18.0 myst:0.0 moxie:0.0 price:2100 own:0 value:4783
4: shot of blackberry schnapps lev:3 gain:1.0 adv:3.0 musc:6.0 myst:6.0 moxie:6.0 price:260 own:0 value:4140
Now at spleen of 0, spleening to 15.
1: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:200 own:292 value:900
2: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:200 own:291 value:900
3: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:200 own:290 value:900
4: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:200 own:289 value:900
5: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:200 own:288 value:900
6: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:200 own:287 value:900
7: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:200 own:286 value:900
8: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:200 own:285 value:900
9: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:200 own:284 value:900
10: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:200 own:283 value:900
11: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:200 own:282 value:900
12: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:200 own:281 value:900
13: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:200 own:280 value:900
14: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:200 own:279 value:900
15: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:200 own:278 value:900
Finished. You had -milk--ode to booze-Adventures listed above does not reflect that, but this does:
Spent 17497 meat. Gained Fullness: 15. Inebriety: 19. Spleen: 15. Adventures: 200. Muscle: 425. Moxie: 146. Mysticality: 145.
Eating, drinking, and spleening complete. Commence merrymaking (at your own discretion).
I would love to find a way to speed it up but I'm stumped as to how. Any ideas?
asturia
12-21-2008, 07:36 PM
To be honest, your programming skill level is much better then mine.
I can only grasp the most simple concepts in your script.
I've made some myself, but like I said, they are much simpler.
DerDrongo
12-22-2008, 01:39 AM
I would love to find a way to speed it up but I'm stumped as to how. Any ideas?
ive got a similar script (not as complex) but its search for the best item is what takes the most time during a run, a simple change to only recalculating the best when it couldnt afford/consume the current best seamed to increase its speed quite a bit, i got a bit lost reading through your script so apologies if yours already does that
im also working on an overloading the buy function which can take a maximum price, buy(count, item, maxPrice), which could help speed up purchasing (and reduce sever load from all the mall searches/hiding meat)... i think its working but needs some more testing (and come to think about it ive got no idea how to upload these changes)
You guys are too kind... and I think you may be confusing good code with spaghetti code. :) This thing is a barely-maintainable monster. Plus all the hard parts were lifted from Zarqon and Sandiman.
By far the slowest part is fetching the price estimates from the server. I wish the mafia devs could do something about that but I respect their decision not to.
The second slowest part is all the meat closeting and uncloseting, so if you've got a solution, I'd love to see it! Just reply, click "additional options", and you'll see an option to attach a file to your post.
DerDrongo
12-22-2008, 01:23 PM
both files just have minor changes... Runtime imports 3 new librarys, defines the new buy (i would like to just call "buy <count> <item> max price <price>" but couldnt understand enough about the regex/pattens)... kolmafia.java makes changes to makePurchases (and makes a wrapper so it can be called without a max price)
i just updated from the SVN so you should be able to drop the source files in, compile and be ready to test
testBuy.ash trys to buy 1 fuzzbump for 800 meat
edit: i should mention you will need to compile your own source (see http://kolmafia.us/index.php/topic,374.0.html to learn about building from the SVN)
Aha! I was wondering what sort of black voodoo you had figured out to make that work. Modifying Mafia qualifies. :)
Haven't tried it yet, but it sounds like adding this to mafia would be a good thing since it would speed up scripts and reduce server load.
2.0 now posted! I've been using it to spleen and magnesium for a few days and it seems to be working flawlessly. Make sure to download the new spleen data file if you're upgrading, too.
morgad
12-23-2008, 07:24 PM
is shopping supposed to be this inefficient?
(this is with most recent version, but have seen it with previous versions too)
Mafia version is 6640.
I killed the script after about ten minutes, as it was repeatedly trying and failing to buy anything. I was worried I might trigger Jick's bot filter :-(
(zipped mafia log attached as plain text was a a bit long)
thanks for the script
Dave
is shopping supposed to be this inefficient?
I killed the script after about ten minutes, as it was repeatedly trying and failing to buy anything. I was worried I might trigger Jick's bot filter :-(
Kind of, unfortunately, yes. Thanks for bringing it up though - with Crimbo, that's really unacceptable. I made a quick fix in 2.01 that'll require about 4x fewer attempts to buy something that's mispriced, on average.
This is an unfortunate side effect of the workarounds due to Mafia not having a way to buy something for a certain maximum price, and not having a way to get approximate real-time mall prices.
morgad
12-24-2008, 06:20 PM
Thanks dj_d, that was much better :-)
******************************************
Now, to recap...
******************************************
Consuming up to 15 food, 12 booze, and 15 spleen
Considering food from inventory Hagnk's the mall. Per-item budget cap is 40000.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 500 meat. Muscle subpoint is 10. Nonprime stat subpoint is 2.
Now at fullness of 0, eating to 15.
0: milk of magnesium price: 150
1: Crimbo pie lev:7 gain:3.0 adv:11.0 musc:35.0 myst:0.0 moxie:0.0 price:160 own:0 value:1896
2: Crimbo pie lev:7 gain:3.0 adv:11.0 musc:35.0 myst:0.0 moxie:0.0 price:160 own:0 value:1896
3: Crimbo pie lev:7 gain:3.0 adv:11.0 musc:35.0 myst:0.0 moxie:0.0 price:320 own:0 value:1843
4: Crimbo pie lev:7 gain:3.0 adv:11.0 musc:35.0 myst:0.0 moxie:0.0 price:430 own:0 value:1806
5: Crimbo pie lev:7 gain:3.0 adv:11.0 musc:35.0 myst:0.0 moxie:0.0 price:430 own:0 value:1806
Now at inebriety of 0, drinking to 12.
1: ocean motion lev:4 gain:4.0 adv:12.0 musc:26.0 myst:9.0 moxie:0.0 price:230 own:23 value:1512
2: ocean motion lev:4 gain:4.0 adv:12.0 musc:26.0 myst:9.0 moxie:0.0 price:230 own:22 value:1512
3: ocean motion lev:4 gain:4.0 adv:12.0 musc:26.0 myst:9.0 moxie:0.0 price:230 own:21 value:1512
Now at spleen of 0, spleening to 15.
1: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:180 own:0 value:446
2: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:180 own:0 value:446
3: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:180 own:0 value:446
4: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:180 own:0 value:446
5: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:180 own:0 value:446
6: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:180 own:0 value:446
7: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:180 own:0 value:446
8: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:250 own:0 value:376
9: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:250 own:0 value:376
10: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:250 own:0 value:376
11: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:250 own:0 value:376
12: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:250 own:0 value:376
13: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:250 own:0 value:376
14: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:250 own:0 value:376
15: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:250 own:0 value:376
Finished. You had -milk-Adventures listed above does not reflect that, but this does:
Spent 4960 meat. Gained Fullness: 15. Inebriety: 12. Spleen: 15. Adventures: 117. Muscle: 500. Moxie: 130. Mysticality: 164.
Eating, drinking, and spleening complete. Commence merrymaking (at your own discretion).
best regards
Dave
You bet. Happy Crimbo all!
morgad
12-25-2008, 04:04 PM
spoke too soon, it hates Genalen bottles ... doe not incearse budget for them
budgeting 200 for 1 additional Genalen&#8482; Bottle. You have 8215068 meat. You have 0 in inventory already.
You have more meat than budgeted, so putting the excess 8214868 meat in closet.
Placing meat into closet...
Searching for "Genalen&#8482; Bottle"...
Removing meat from closet...
Purchased 0 Genalen&#8482; Bottle for 0 meat.
Failed to get Genalen&#8482; Bottle for a max price of 2.0*100
FAIL: Genalen&#8482; Bottle lev:10 gain:1.0 adv:3.0 musc:22.5 myst:22.5 moxie:0.0 price:100 own:0 value:1670
Getting prices and calculating total food scores
Choosing food to consume.
Attempting to consume...
budgeting 200 for 1 additional Genalen&#8482; Bottle. You have 8215068 meat. You have 0 in inventory already.
You have more meat than budgeted, so putting the excess 8214868 meat in closet.
Placing meat into closet...
Searching for "Genalen&#8482; Bottle"...
Removing meat from closet...
Purchased 0 Genalen&#8482; Bottle for 0 meat.
Failed to get Genalen&#8482; Bottle for a max price of 2.0*100
FAIL: Genalen&#8482; Bottle lev:10 gain:1.0 adv:3.0 musc:22.5 myst:22.5 moxie:0.0 price:100 own:0 value:1670
Getting prices and calculating total food scores
Choosing food to consume.
Attempting to consume...
budgeting 200 for 1 additional Genalen&#8482; Bottle. You have 8215068 meat. You have 0 in inventory already.
You have more meat than budgeted, so putting the excess 8214868 meat in closet.
Placing meat into closet...
Searching for "Genalen&#8482; Bottle"...
Removing meat from closet...
Purchased 0 Genalen&#8482; Bottle for 0 meat.
Failed to get Genalen&#8482; Bottle for a max price of 2.0*100
FAIL: Genalen&#8482; Bottle lev:10 gain:1.0 adv:3.0 musc:22.5 myst:22.5 moxie:0.0 price:100 own:0 value:1670
Getting prices and calculating total food scores
Choosing food to consume.
Attempting to consume...
budgeting 200 for 1 additional Genalen&#8482; Bottle. You have 8215068 meat. You have 0 in inventory already.
You have more meat than budgeted, so putting the excess 8214868 meat in closet.
Placing meat into closet...
Searching for "Genalen&#8482; Bottle"...
Removing meat from closet...
Purchased 0 Genalen&#8482; Bottle for 0 meat.
Failed to get Genalen&#8482; Bottle for a max price of 2.0*100
FAIL: Genalen&#8482; Bottle lev:10 gain:1.0 adv:3.0 musc:22.5 myst:22.5 moxie:0.0 price:100 own:0 value:1670
Getting prices and calculating total food scores
Choosing food to consume.
Attempting to consume...
budgeting 200 for 1 additional Genalen&#8482; Bottle. You have 8215068 meat. You have 0 in inventory already.
You have more meat than budgeted, so putting the excess 8214868 meat in closet.
Placing meat into closet...
Searching for "Genalen&#8482; Bottle"...
Removing meat from closet...
Purchased 0 Genalen&#8482; Bottle for 0 meat.
Failed to get Genalen&#8482; Bottle for a max price of 2.0*100
FAIL: Genalen&#8482; Bottle lev:10 gain:1.0 adv:3.0 musc:22.5 myst:22.5 moxie:0.0 price:100 own:0 value:1670
Getting prices and calculating total food scores
Choosing food to consume.
Attempting to consume...
budgeting 200 for 1 additional Genalen&#8482; Bottle. You have 8215068 meat. You have 0 in inventory already.
You have more meat than budgeted, so putting the excess 8214868 meat in closet.
Placing meat into closet...
Searching for "Genalen&#8482; Bottle"...
Removing meat from closet...
Purchased 0 Genalen&#8482; Bottle for 0 meat.
Failed to get Genalen&#8482; Bottle for a max price of 2.0*100
FAIL: Genalen&#8482; Bottle lev:10 gain:1.0 adv:3.0 musc:22.5 myst:22.5 moxie:0.0 price:100 own:0 value:1670
Getting prices and calculating total food scores
Choosing food to consume.
Attempting to consume...
budgeting 200 for 1 additional Genalen&#8482; Bottle. You have 8215068 meat. You have 0 in inventory already.
You have more meat than budgeted, so putting the excess 8214868 meat in closet.
Placing meat into closet...
Searching for "Genalen&#8482; Bottle"...
Removing meat from closet...
Purchased 0 Genalen&#8482; Bottle for 0 meat.
Failed to get Genalen&#8482; Bottle for a max price of 2.0*100
FAIL: Genalen&#8482; Bottle lev:10 gain:1.0 adv:3.0 musc:22.5 myst:22.5 moxie:0.0 price:100 own:0 value:1670
Getting prices and calculating total food scores
Choosing food to consume.
Attempting to consume...
budgeting 200 for 1 additional Genalen&#8482; Bottle. You have 8215068 meat. You have 0 in inventory already.
You have more meat than budgeted, so putting the excess 8214868 meat in closet.
Placing meat into closet...
Searching for "Genalen&#8482; Bottle"...
Removing meat from closet...
Purchased 0 Genalen&#8482; Bottle for 0 meat.
Failed to get Genalen&#8482; Bottle for a max price of 2.0*100
FAIL: Genalen&#8482; Bottle lev:10 gain:1.0 adv:3.0 musc:22.5 myst:22.5 moxie:0.0 price:100 own:0 value:1670
Getting prices and calculating total food scores
Choosing food to consume.
Attempting to consume...
budgeting 200 for 1 additional Genalen&#8482; Bottle. You have 8215068 meat. You have 0 in inventory already.
You have more meat than budgeted, so putting the excess 8214868 meat in closet.
Placing meat into closet...
Searching for "Genalen&#8482; Bottle"...
Removing meat from closet...
Purchased 0 Genalen&#8482; Bottle for 0 meat.
Failed to get Genalen&#8482; Bottle for a max price of 2.0*100
FAIL: Genalen&#8482; Bottle lev:10 gain:1.0 adv:3.0 musc:22.5 myst:22.5 moxie:0.0 price:100 own:0 value:1670
Getting prices and calculating total food scores
Choosing food to consume.
Attempting to consume...
budgeting 200 for 1 additional Genalen&#8482; Bottle. You have 8215068 meat. You have 0 in inventory already.
You have more meat than budgeted, so putting the excess 8214868 meat in closet.
Placing meat into closet...
Searching for "Genalen&#8482; Bottle"...
Removing meat from closet...
Purchased 0 Genalen&#8482; Bottle for 0 meat.
Failed to get Genalen&#8482; Bottle for a max price of 2.0*100
FAIL: Genalen&#8482; Bottle lev:10 gain:1.0 adv:3.0 musc:22.5 myst:22.5 moxie:0.0 price:100 own:0 value:1670
Getting prices and calculating total food scores
Choosing food to consume.
Attempting to consume...
budgeting 200 for 1 additional Genalen&#8482; Bottle. You have 8215068 meat. You have 0 in inventory already.
You have more meat than budgeted, so putting the excess 8214868 meat in closet.
Placing meat into closet...
Searching for "Genalen&#8482; Bottle"...
Removing meat from closet...
Purchased 0 Genalen&#8482; Bottle for 0 meat.
Failed to get Genalen&#8482; Bottle for a max price of 2.0*100
FAIL: Genalen&#8482; Bottle lev:10 gain:1.0 adv:3.0 musc:22.5 myst:22.5 moxie:0.0 price:100 own:0 value:1670
Getting prices and calculating total food scores
Choosing food to consume.
Attempting to consume...
budgeting 200 for 1 additional Genalen&#8482; Bottle. You have 8215068 meat. You have 0 in inventory already.
You have more meat than budgeted, so putting the excess 8214868 meat in closet.
Placing meat into closet...
Searching for "Genalen&#8482; Bottle"...
Removing meat from closet...
KoLmafia declares world peace.
Retrieving character data...
Requests complete.
There was a note on this in the original post, but I never hit the bug the way you are... tell me if the attached fixes your problem (it should just ignore Genalen bottles).
so ... this is possibly a stupid question ...
I didn't want all the extraneous data files in my root scripts directory, so I made an individual directory for eatdrink and put everything there. But it seems to read/write files out of scripts\ , not scripts\eat\.
I guess I don't really understand how read/write works, but I'll start to look into it
Mafia's search path is a dark mystery to me as well, so let us know what you come up with.
morgad
12-26-2008, 09:08 AM
There was a note on this in the original post, but I never hit the bug the way you are... tell me if the attached fixes your problem (it should just ignore Genalen bottles).
string EATDRINK_VERSION = "2.01";
string EATDRINK_VERSION_PAGE = "2038";
sorry - this does not fix it for me, still fails to increase budget for Genalen bottles
@kain - have you tried moving the data files to /data from /scripts ?
best regards
DAve
morgad
12-27-2008, 08:50 AM
No attempt to buy Genalan this time :-)
******************************************
Now, to recap...
******************************************
Consuming up to 15 food, 13 booze, and 15 spleen
Considering food from inventory Hagnk's the mall. Per-item budget cap is 40000.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 500 meat. Muscle subpoint is 10. Nonprime stat subpoint is 2.
Now at fullness of 0, eating to 15.
0: milk of magnesium price: 1135
1: Hell ramen lev:6 gain:6.0 adv:25.5 musc:25.5 myst:25.5 moxie:25.5 price:122 own:16 value:2164
2: Hell ramen lev:6 gain:6.0 adv:25.5 musc:25.5 myst:25.5 moxie:25.5 price:122 own:15 value:2164
3: Crimbo pie lev:7 gain:3.0 adv:11.0 musc:35.0 myst:0.0 moxie:0.0 price:161 own:0 value:1896
Now at inebriety of 0, drinking to 13.
1: gimlet lev:6 gain:4.0 adv:16.0 musc:0.0 myst:43.5 moxie:0.0 price:320 own:0 value:1941
2: fuzzbump lev:4 gain:4.0 adv:12.0 musc:35.0 myst:0.0 moxie:0.0 price:230 own:0 value:1530
3: ocean motion lev:4 gain:4.0 adv:12.0 musc:26.0 myst:9.0 moxie:0.0 price:230 own:19 value:1512
4: can of Swiller lev:10 gain:1.0 adv:3.0 musc:12.5 myst:0.0 moxie:0.0 price:272 own:0 value:1353
Now at spleen of 0, spleening to 15.
1: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:270 own:35 value:356
2: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:270 own:34 value:356
3: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:270 own:33 value:356
4: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:270 own:32 value:356
5: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:270 own:31 value:356
6: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:270 own:30 value:356
7: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:270 own:29 value:356
8: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:270 own:28 value:356
9: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:270 own:27 value:356
10: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:270 own:26 value:356
11: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:270 own:25 value:356
12: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:270 own:24 value:356
13: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:270 own:23 value:356
14: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:270 own:22 value:356
15: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:270 own:21 value:356
Finished. You had -milk-Adventures listed above does not reflect that, but this does:
Spent 956 meat. Gained Fullness: 15. Inebriety: 13. Spleen: 15. Adventures: 127. Muscle: 300. Moxie: 191. Mysticality: 307.
Eating, drinking, and spleening complete. Commence merrymaking (at your own discretion).
many thanks
Dave
putting the data files into /data worked like a charm! No more data files cluttering up my scripts directory.
Fixed a small bug with vespers that could cause the script to hang when trying to drink them.
Oh - and you'll now use mojo filters if they are cost effective (which they usually are when the adventure variable is set to a spendy 3,000 meat).
ironsting
12-30-2008, 12:12 AM
I wanted to post to thank you for your script. I have used it successfully for a week or so and it works great. The only issue I have had is remembering to set
boolean PIE_PRIORITY = false for each new version.
For myself, I start the day with a fortune cookie, run eatdrink.ash with food set to 14, then when the cookie numbers are exhausted eat another cookie. It has worked well so far.
Lastly a request, is there a way to fire the summary after an abort?
Thanks again for all your hard work.
Try the attached... it has a looooooong form calling convention where you can specify EVERY flag, like so:
eatdrink (fullness_limit(), inebriety_limit(), spleen_limit, true,
true, true, true, false, true,
true, 10000, 2.0, true, 1000, false, 600, 10, 2,
false, 999999999, 999999999, false, 0);
You can make that function call from a script, and it will call eatdrink with the appropriate parameters every time - even after downloading a new build. If you like it, I'll roll it in to main, so it'll always work with new versions.
Unfortunately I don't know any easy way to get the summary on abort. If it were easier to write & read strings to/from files I might make it so it prints any aborted output on next run, but that's a PITA right now. :)
By the way - why is pie_priority giving you trouble? What's the situation where you don't have the keys but don't want to eat the pies?
Eatdrink cooks! The attached version should create anything for which you have the skills and ingredients (and bartender/chef-in-the-box). Costing rules are observed, so if you have consider_price_when_owned set it will avoid cooking expensive things if you're being cheap.
Let me know if this works for you; if so, I'll update the main version.
This also includes some significant bugfixes, including a divide-by-zero error when you're at low levels, plus run a bit faster.
You will have to either replace your data files with the attached, or add two columns of 'false' to your own.
morgad
01-02-2009, 06:25 PM
attempting to try the new version (your files not modified) -
> call scripts\EatDrink.ash
Refreshing stash contents...
Stash list retrieved.
Consuming up to 15 food, 13 booze, and 15 spleen
Considering food from inventory Hagnk's the mall. Per-item budget cap is 40000.0.
Price will be a factor if you own it already. Hagnk's pulls (if enabled) will cost 2000 meat each.
An adventure has the value of 500 meat. Muscle subpoint is 10. Nonprime stat subpoint is 2.
Loading food records.
Now at fullness of 0, eating to 15.
Loading mafia food records for today
filtering food based on level & availability
Loading ItemsOfLoathing file for the day
LastItemsOfLoathingUpdate => 20090102
Wiki price not found
calculating food values
Choosing food to consume.
Attempting to consume...
Shopping for a sandwich of the gods in 5 seconds
Countdown: 5 seconds...
Countdown: 4 seconds...
Countdown: 3 seconds...
Countdown: 2 seconds...
Countdown: 1 second...
Waiting completed.
budgeting 0 for 1 additional sandwich of the gods. You have 9104612 meat. You have 0 in inventory already.
You have more meat than budgeted, so putting the excess 9104612 meat in closet.
Placing meat into closet...
Placing meat into closet...
Placing meat into closet...
Placing meat into closet...
Searching for "sandwich of the gods"...
'sandwich of the gods' is not tradeable. Aborting.
Retrieving character data...
Requests complete.
???
Dave
Thanks for letting me know how it works for you; I appreciate it! I found both bugs (trying to buy it, and the buy repeating itself infinitely) and updated the previous post with fixes. Try downloading it again and letting me know if it works for you.
I just realized that I only tested it in ronin, hence not finding the problem...
morgad
01-03-2009, 09:04 AM
looking better :-)
******************************************
Now, to recap...
******************************************
Consuming up to 15 food, 13 booze, and 15 spleen
Considering food from inventory Hagnk's . Per-item budget cap is 40000.0.
Price will be a factor if you own it already. Hagnk's pulls (if enabled) will cost 2000 meat each.
An adventure has the value of 500 meat. Muscle subpoint is 10. Nonprime stat subpoint is 2.
Now at fullness of 0, eating to 15.
1: Hell ramen lev:6 gain:6.0 adv:25.5 musc:25.5 myst:25.5 moxie:25.5 price:122 own:14 pull:false make:false value:2164
2: Hell ramen lev:6 gain:6.0 adv:25.5 musc:25.5 myst:25.5 moxie:25.5 price:122 own:13 pull:false make:false value:2164
3: cactus fruit lev:7 gain:2.0 adv:6.5 musc:13.0 myst:3.0 moxie:3.0 price:100 own:2 pull:false make:false value:1646
4: desiccated apricot lev:2 gain:1.0 adv:2.5 musc:16.0 myst:0.0 moxie:0.0 price:111 own:5 pull:false make:false value:1299
Now at inebriety of 0, drinking to 13.
1: ocean motion lev:4 gain:4.0 adv:12.0 musc:26.0 myst:9.0 moxie:0.0 price:1100 own:18 pull:false make:false value:1294
2: ocean motion lev:4 gain:4.0 adv:12.0 musc:26.0 myst:9.0 moxie:0.0 price:1100 own:17 pull:false make:false value:1294
3: ocean motion lev:4 gain:4.0 adv:12.0 musc:26.0 myst:9.0 moxie:0.0 price:1100 own:16 pull:false make:false value:1294
4: cup of primitive beer lev:12 gain:1.0 adv:3.5 musc:57.5 myst:0.0 moxie:0.0 price:1119 own:7 pull:false make:false value:1206
Now at spleen of 0, spleening to 15.
1: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:250 own:1 pull:false make:false value:376
No item found with a positive score. Not consuming.
Finished.
Spent -41 meat. Gained Fullness: 15. Inebriety: 13. Spleen: 1. Adventures: 94. Muscle: 210. Moxie: 59. Mysticality: 91.
Eating, drinking, and spleening complete. Commence merrymaking (at your own discretion).
I did not see it make or buy anything
I was expecting it to buy some more wads
so I went any bought some myself, and it was happy to use them
******************************************
Now, to recap...
******************************************
Consuming up to 15 food, 13 booze, and 15 spleen
Considering food from inventory Hagnk's . Per-item budget cap is 40000.0.
Price will be a factor if you own it already. Hagnk's pulls (if enabled) will cost 2000 meat each.
An adventure has the value of 500 meat. Muscle subpoint is 10. Nonprime stat subpoint is 2.
Now at spleen of 1, spleening to 15.
1: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:250 own:20 pull:false make:false value:376
2: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:250 own:19 pull:false make:false value:376
3: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:250 own:18 pull:false make:false value:376
4: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:250 own:17 pull:false make:false value:376
5: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:250 own:16 pull:false make:false value:376
6: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:250 own:15 pull:false make:false value:376
7: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:250 own:14 pull:false make:false value:376
8: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:250 own:13 pull:false make:false value:376
9: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:250 own:12 pull:false make:false value:376
10: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:250 own:11 pull:false make:false value:376
11: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:250 own:10 pull:false make:false value:376
12: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:250 own:9 pull:false make:false value:376
13: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:250 own:8 pull:false make:false value:376
14: twinkly wad lev:6 gain:1.0 adv:1.0 musc:9.0 myst:9.0 moxie:9.0 price:250 own:7 pull:false make:false value:376
Finished.
Spent 0 meat. Gained Fullness: 0. Inebriety: 0. Spleen: 14. Adventures: 14. Muscle: 127. Moxie: 125. Mysticality: 124.
Eating, drinking, and spleening complete. Commence merrymaking (at your own discretion).
Dave
Glad that's working! I just use ASH calls to figure out what's smithable, so I guess those calls won't pulverize/combine for you.
morgad
01-03-2009, 04:02 PM
thanks dj_d,
is the fact it has stopped buying stuff for me a bug or a feature?
Dave
A bug. But a number of people have reported that Mafia's "buy stuff for you" setting has changed without them meaning for it to. Go to General, Preferences, and make sure that "Buy items from the mall" is checked; that could be the problem.
morgad
01-03-2009, 07:42 PM
that gave a wierd result ... I only had a 2 booze points available to consume
it has got confused somewhere, it says I own some blackbury scnapps (made 1 giving 5?), and I don't (none in inventionary). it also got into a loop trying to overdrink while drunk.
my purchase checkboxes were unselected - I have selected them again
was my -in-a-box creation down to your script, or just a Mafia thing?
Refreshing stash contents...
Stash list retrieved.
Consuming up to 15 food, 15 booze, and 15 spleen and then finishing off with the stiffest drink we can find.
Considering food from inventory Hagnk's . Per-item budget cap is 40000.0.
Price will be a factor if you own it already. Hagnk's pulls (if enabled) will cost 2000 meat each.
An adventure has the value of 500 meat. Muscle subpoint is 10. Nonprime stat subpoint is 2.
Loading drink records.
Now at inebriety of 13, drinking to 15.
Filtering remaining drinks for level and availability.
ItemsOfLoathingPrices.txt already cached today.
Calculating drink values.
Choosing drink to consume.
Attempting to consume...
Creating a shot of blackberry schnapps in 5 seconds
Countdown: 5 seconds...
Countdown: 4 seconds...
Countdown: 3 seconds...
Countdown: 2 seconds...
Countdown: 1 second...
Waiting completed.
Verifying ingredients for shot of blackberry schnapps (1)...
Verifying ingredients for bartender-in-the-box (1)...
Verifying ingredients for bartender-skull-in-the-box (1)...
Verifying ingredients for nothing-in-the-box (1)...
Creating nothing-in-the-box (1)...
You acquire an item: nothing-in-the-box
Successfully created nothing-in-the-box (1)
Verifying ingredients for bartender skull (1)...
Verifying ingredients for brainy skull (1)...
Creating brainy skull (1)...
You acquire an item: brainy skull
Successfully created brainy skull (1)
Verifying ingredients for beer goggles (1)...
Searching for "beer lens"...
Purchasing beer lens (1 @ 3,800)...
You acquire an item: beer lens
Purchases complete.
Creating beer goggles (1)...
You acquire an item: beer goggles
Successfully created beer goggles (1)
Creating bartender skull (1)...
You acquire an item: bartender skull
Successfully created bartender skull (1)
Creating bartender-skull-in-the-box (1)...
You acquire an item: bartender-skull-in-the-box
Successfully created bartender-skull-in-the-box (1)
Creating bartender-in-the-box (1)...
You acquire an item: bartender-in-the-box
Successfully created bartender-in-the-box (1)
Using 1 bartender-in-the-box...
Finished using 1 bartender-in-the-box.
Creating shot of blackberry schnapps (1)...
You acquire an item: shot of blackberry schnapps
Successfully created shot of blackberry schnapps (1)
Drinking 1 shot of blackberry schnapps...
You gain 1 Adventure
You gain 7 Fortitude
You gain 6 Magicalness
You gain 5 Roguishness
You gain 1 Drunkenness
Finished drinking 1 shot of blackberry schnapps.
1: shot of blackberry schnapps lev:3 gain:1.0 adv:3.0 musc:6.0 myst:6.0 moxie:6.0 price:130 own:5 pull:false make:true value:1454
Calculating drink values.
Choosing drink to consume.
Attempting to consume...
Creating a shot of blackberry schnapps in 5 seconds
Countdown: 5 seconds...
Countdown: 4 seconds...
Countdown: 3 seconds...
Countdown: 2 seconds...
Countdown: 1 second...
Waiting completed.
Verifying ingredients for shot of blackberry schnapps (1)...
Purchasing fermenting powder (1 @ 66)...
You acquire an item: fermenting powder
Purchases complete.
Creating shot of blackberry schnapps (1)...
You acquire an item: shot of blackberry schnapps
Successfully created shot of blackberry schnapps (1)
Drinking 1 shot of blackberry schnapps...
You gain 4 Adventures
You gain 5 Beefiness
You gain 6 Enchantedness
You gain 5 Cheek
You gain 1 Drunkenness
Finished drinking 1 shot of blackberry schnapps.
2: shot of blackberry schnapps lev:3 gain:1.0 adv:3.0 musc:6.0 myst:6.0 moxie:6.0 price:130 own:4 pull:false make:true value:1454
Now finishing with one big stiff drink.
Calculating values for final drink.
Choosing final drink to consume.
Attempting to consume...
3: ocean motion lev:4 gain:4.0 adv:12.0 musc:26.0 myst:9.0 moxie:0.0 price:1100 own:21 pull:false make:false value:5176
Choosing final drink to consume.
Attempting to consume...
4: ocean motion lev:4 gain:4.0 adv:12.0 musc:26.0 myst:9.0 moxie:0.0 price:1100 own:21 pull:false make:false value:5176
Choosing final drink to consume.
Attempting to consume...
5: ocean motion lev:4 gain:4.0 adv:12.0 musc:26.0 myst:9.0 moxie:0.0 price:1100 own:21 pull:false make:false value:5176
Choosing final drink to consume.
Attempting to consume...
6: ocean motion lev:4 gain:4.0 adv:12.0 musc:26.0 myst:9.0 moxie:0.0 price:1100 own:21 pull:false make:false value:5176
Choosing final drink to consume.
Attempting to consume...
7: ocean motion lev:4 gain:4.0 adv:12.0 musc:26.0 myst:9.0 moxie:0.0 price:1100 own:21 pull:false make:false value:5176
Choosing final drink to consume.
Attempting to consume...
8: ocean motion lev:4 gain:4.0 adv:12.0 musc:26.0 myst:9.0 moxie:0.0 price:1100 own:21 pull:false make:false value:5176
Choosing final drink to consume.
Attempting to consume...
9: ocean motion lev:4 gain:4.0 adv:12.0 musc:26.0 myst:9.0 moxie:0.0 price:1100 own:21 pull:false make:false value:5176
Choosing final drink to consume.
Attempting to consume...
10: ocean motion lev:4 gain:4.0 adv:12.0 musc:26.0 myst:9.0 moxie:0.0 price:1100 own:21 pull:false make:false value:5176
Choosing final drink to consume.
Attempting to consume...
11: ocean motion lev:4 gain:4.0 adv:12.0 musc:26.0 myst:9.0 moxie:0.0 price:1100 own:21 pull:false make:false value:5176
Choosing final drink to consume.
Attempting to consume...
12: ocean motion lev:4 gain:4.0 adv:12.0 musc:26.0 myst:9.0 moxie:0.0 price:1100 own:21 pull:false make:false value:5176
Choosing final drink to consume.
Attempting to consume...
13: ocean motion lev:4 gain:4.0 adv:12.0 musc:26.0 myst:9.0 moxie:0.0 price:1100 own:21 pull:false make:false value:5176
Choosing final drink to consume.
Attempting to consume...
14: ocean motion lev:4 gain:4.0 adv:12.0 musc:26.0 myst:9.0 moxie:0.0 price:1100 own:21 pull:false make:false value:5176
Choosing final drink to consume.
Attempting to consume...
15: ocean motion lev:4 gain:4.0 adv:12.0 musc:26.0 myst:9.0 moxie:0.0 price:1100 own:21 pull:false make:false value:5176
Choosing final drink to consume.
Attempting to consume...
16: ocean motion lev:4 gain:4.0 adv:12.0 musc:26.0 myst:9.0 moxie:0.0 price:1100 own:21 pull:false make:false value:5176
Choosing final drink to consume.
Attempting to consume...
17: ocean motion lev:4 gain:4.0 adv:12.0 musc:26.0 myst:9.0 moxie:0.0 price:1100 own:21 pull:false make:false value:5176
Choosing final drink to consume.
Attempting to consume...
18: ocean motion lev:4 gain:4.0 adv:12.0 musc:26.0 myst:9.0 moxie:0.0 price:1100 own:21 pull:false make:false value:5176
Choosing final drink to consume.
Attempting to consume...
19: ocean motion lev:4 gain:4.0 adv:12.0 musc:26.0 myst:9.0 moxie:0.0 price:1100 own:21 pull:false make:false value:5176
Choosing final drink to consume.
Attempting to consume...
20: ocean motion lev:4 gain:4.0 adv:12.0 musc:26.0 myst:9.0 moxie:0.0 price:1100 own:21 pull:false make:false value:5176
Choosing final drink to consume.
Attempting to consume...
21: ocean motion lev:4 gain:4.0 adv:12.0 musc:26.0 myst:9.0 moxie:0.0 price:1100 own:21 pull:false make:false value:5176
Choosing final drink to consume.
Attempting to consume...
22: ocean motion lev:4 gain:4.0 adv:12.0 musc:26.0 myst:9.0 moxie:0.0 price:1100 own:21 pull:false make:false value:5176
Choosing final drink to consume.
Attempting to consume...
23: ocean motion lev:4 gain:4.0 adv:12.0 musc:26.0 myst:9.0 moxie:0.0 price:1100 own:21 pull:false make:false value:5176
Choosing final drink to consume.
Attempting to consume...
24: ocean motion lev:4 gain:4.0 adv:12.0 musc:26.0 myst:9.0 moxie:0.0 price:1100 own:21 pull:false make:false value:5176
Choosing final drink to consume.
Attempting to consume...
25: ocean motion lev:4 gain:4.0 adv:12.0 musc:26.0 myst:9.0 moxie:0.0 price:1100 own:21 pull:false make:false value:5176
Choosing final drink to consume.
Attempting to consume...
26: ocean motion lev:4 gain:4.0 adv:12.0 musc:26.0 myst:9.0 moxie:0.0 price:1100 own:21 pull:false make:false value:5176
Choosing final drink to consume.
Attempting to consume...
27: ocean motion lev:4 gain:4.0 adv:12.0 musc:26.0 myst:9.0 moxie:0.0 price:1100 own:21 pull:false make:false value:5176
Choosing final drink to consume.
Attempting to consume...
28: ocean motion lev:4 gain:4.0 adv:12.0 musc:26.0 myst:9.0 moxie:0.0 price:1100 own:21 pull:false make:false value:5176
Choosing final drink to consume.
Attempting to consume...
29: ocean motion lev:4 gain:4.0 adv:12.0 musc:26.0 myst:9.0 moxie:0.0 price:1100 own:21 pull:false make:false value:5176
Choosing final drink to consume.
Attempting to consume...
30: ocean motion lev:4 gain:4.0 adv:12.0 musc:26.0 myst:9.0 moxie:0.0 price:1100 own:21 pull:false make:false value:5176
Choosing final drink to consume.
Attempting to consume...
31: ocean motion lev:4 gain:4.0 adv:12.0 musc:26.0 myst:9.0 moxie:0.0 price:1100 own:21 pull:false make:false value:5176
Choosing final drink to consume.
Attempting to consume...
32: ocean motion lev:4 gain:4.0 adv:12.0 musc:26.0 myst:9.0 moxie:0.0 price:1100 own:21 pull:false make:false value:5176
Choosing final drink to consume.
Attempting to consume...
33: ocean motion lev:4 gain:4.0 adv:12.0 musc:26.0 myst:9.0 moxie:0.0 price:1100 own:21 pull:false make:false value:5176
Choosing final drink to consume.
Attempting to consume...
34: ocean motion lev:4 gain:4.0 adv:12.0 musc:26.0 myst:9.0 moxie:0.0 price:1100 own:21 pull:false make:false value:5176
Choosing final drink to consume.
KoLmafia declares world peace.
Helper autocreation is a mafia thing - you can change the setting in preferences too, if you want. Try this version - it has some additional fixes that should address your problem.
morgad
01-04-2009, 10:58 AM
Refreshing stash contents...
Stash list retrieved.
Starting EatDrink.ash (version 2.02).
Consuming up to 15 food, 13 booze, and 15 spleen
Considering food from inventory Hagnk's the mall. Per-item budget cap is 40000.0.
Price will be a factor if you own it already. Hagnk's pulls (if enabled) will cost 2000 meat each.
An adventure has the value of 500 meat. Muscle subpoint is 10. Nonprime stat subpoint is 2.
Loading food records.
Now at fullness of 0, eating to 15.
Loading mafia food records for today
filtering food based on level & availability
Loading ItemsOfLoathing file for the day
LastItemsOfLoathingUpdate => 20090104
Wiki price not found
Wiki price not found
Wiki price not found
Wiki price not found
Wiki price not found
calculating food values
Choosing food to consume.
Attempting to consume...
Shopping for a elven <i>limbos</i> gingerbread in 5 seconds
Countdown: 5 seconds...
Countdown: 4 seconds...
Countdown: 3 seconds...
Countdown: 2 seconds...
Countdown: 1 second...
Waiting completed.
budgeting 11380 for 1 additional elven <i>limbos</i> gingerbread. You have 9126595 meat. You have 0 in inventory already.
You have more meat than budgeted, so putting the excess 9115215 meat in closet.
Placing meat into closet...
Searching for "elven limbos gingerbread"...
Purchasing elven limbos gingerbread (1 @ 7,500)...
Unknown item found: elven
You acquire an item: elven
Wrong item received - possibly its name has changed.
Desired purchase quantity not reached (wanted 1, got 0)
Removing meat from closet...
Purchased 0 elven <i>limbos</i> gingerbread for 7500 meat.
Failed to get elven <i>limbos</i> gingerbread for a max price of 2.0*5690
FAIL: elven limbos gingerbread lev:5 gain:3.0 adv:10.0 musc:31.0 myst:31.0 moxie:201036.0 price:5690 own:0 pull:false make:false value:133918
Choosing food to consume.
Attempting to consume...
Shopping for a elven <i>limbos</i> gingerbread in 5 seconds
Countdown: 5 seconds...
Countdown: 4 seconds...
Countdown: 3 seconds...
Countdown: 2 seconds...
Countdown: 1 second...
Waiting completed.
budgeting 22760 for 1 additional elven <i>limbos</i> gingerbread. You have 9119095 meat. You have 0 in inventory already.
You have more meat than budgeted, so putting the excess 9096335 meat in closet.
Placing meat into closet...
Searching for "elven limbos gingerbread"...
Purchasing elven limbos gingerbread (1 @ 7,500)...
Unknown item found: elven
You acquire an item: elven
Wrong item received - possibly its name has changed.
Desired purchase quantity not reached (wanted 1, got 0)
Removing meat from closet...
Purchased 0 elven <i>limbos</i> gingerbread for 7500 meat.
Failed to get elven <i>limbos</i> gingerbread for a max price of 2.0*11380
FAIL: elven limbos gingerbread lev:5 gain:3.0 adv:10.0 musc:31.0 myst:31.0 moxie:201036.0 price:11380 own:0 pull:false make:false value:132021
Choosing food to consume.
Attempting to consume...
Shopping for a stinky hi mein in 5 seconds
Countdown: 5 seconds...
Countdown: 4 seconds...
Countdown: 3 seconds...
Countdown: 2 seconds...
Countdown: 1 second...
Waiting completed.
budgeting 576 for 1 additional stinky hi mein. You have 9111595 meat. You have 0 in inventory already.
You have more meat than budgeted, so putting the excess 9111019 meat in closet.
Placing meat into closet...
Searching for "stinky hi mein"...
Desired purchase quantity not reached (wanted 1, got 0)
Removing meat from closet...
Purchased 0 stinky hi mein for 0 meat.
Failed to get stinky hi mein for a max price of 2.0*288
FAIL: stinky hi mein lev:7 gain:5.0 adv:25.0 musc:32.5 myst:73.0 moxie:17.5 price:288 own:0 pull:false make:false value:2544
Choosing food to consume.
Attempting to consume...
Shopping for a stinky hi mein in 5 seconds
Countdown: 5 seconds...
Countdown: 4 seconds...
Countdown: 3 seconds...
Countdown: 2 seconds...
Countdown: 1 second...
Waiting completed.
budgeting 1152 for 1 additional stinky hi mein. You have 9111595 meat. You have 0 in inventory already.
You have more meat than budgeted, so putting the excess 9110443 meat in closet.
Placing meat into closet...
Searching for "stinky hi mein"...
Desired purchase quantity not reached (wanted 1, got 0)
Removing meat from closet...
Purchased 0 stinky hi mein for 0 meat.
Failed to get stinky hi mein for a max price of 2.0*576
FAIL: stinky hi mein lev:7 gain:5.0 adv:25.0 musc:32.5 myst:73.0 moxie:17.5 price:576 own:0 pull:false make:false value:2486
Choosing food to consume.
Attempting to consume...
Shopping for a stinky hi mein in 5 seconds
Countdown: 5 seconds...
Countdown: 4 seconds...
Countdown: 3 seconds...
Countdown: 2 seconds...
Countdown: 1 second...
Waiting completed.
budgeting 2304 for 1 additional stinky hi mein. You have 9111595 meat. You have 0 in inventory already.
You have more meat than budgeted, so putting the excess 9109291 meat in closet.
Placing meat into closet...
Searching for "stinky hi mein"...
Desired purchase quantity not reached (wanted 1, got 0)
Removing meat from closet...
Purchased 0 stinky hi mein for 0 meat.
Failed to get stinky hi mein for a max price of 2.0*1152
FAIL: stinky hi mein lev:7 gain:5.0 adv:25.0 musc:32.5 myst:73.0 moxie:17.5 price:1152 own:0 pull:false make:false value:2371
Choosing food to consume.
Attempting to consume...
Shopping for a fancy canapés in 5 seconds
Countdown: 5 seconds...
Countdown: 4 seconds...
Countdown: 3 seconds...
Countdown: 2 seconds...
Countdown: 1 second...
Waiting completed.
budgeting 200 for 1 additional fancy canapés. You have 9111595 meat. You have 0 in inventory already.
You have more meat than budgeted, so putting the excess 9111395 meat in closet.
Placing meat into closet...
Searching for "fancy canapés"...
Removing meat from closet...
Purchased 0 fancy canapés for 0 meat.
Failed to get fancy canapés for a max price of 2.0*100
FAIL: fancy canapés lev:5 gain:2.0 adv:8.5 musc:32.5 myst:32.5 moxie:32.5 price:100 own:0 pull:false make:false value:2302
Choosing food to consume.
Attempting to consume...
Shopping for a fancy canapés in 5 seconds
Countdown: 5 seconds...
Countdown: 4 seconds...
Countdown: 3 seconds...
Countdown: 2 seconds...
Countdown: 1 second...
Waiting completed.
budgeting 400 for 1 additional fancy canapés. You have 9111595 meat. You have 0 in inventory already.
You have more meat than budgeted, so putting the excess 9111195 meat in closet.
Placing meat into closet...
Searching for "fancy canapés"...
Removing meat from closet...
Purchased 0 fancy canapés for 0 meat.
Failed to get fancy canapés for a max price of 2.0*200
FAIL: fancy canapés lev:5 gain:2.0 adv:8.5 musc:32.5 myst:32.5 moxie:32.5 price:200 own:0 pull:false make:false value:2252
Choosing food to consume.
Attempting to consume...
You have at least one Hell ramen in inventory.
Creating a milk of magnesium in 5 seconds
Countdown: 5 seconds...
Countdown: 4 seconds...
Countdown: 3 seconds...
Countdown: 2 seconds...
Countdown: 1 second...
Waiting completed.
Verifying ingredients for milk of magnesium (1)...
Verifying ingredients for chef-in-the-box (1)...
Verifying ingredients for chef-skull-in-the-box (1)...
Verifying ingredients for nothing-in-the-box (1)...
Purchasing spring (1 @ 19)...
You acquire an item: spring
Purchases complete.
Creating nothing-in-the-box (1)...
You acquire an item: nothing-in-the-box
Successfully created nothing-in-the-box (1)
Verifying ingredients for chef skull (1)...
Verifying ingredients for brainy skull (1)...
Searching for "smart skull"...
Purchasing smart skull (1 @ 1,095)...
You acquire an item: smart skull
Purchases complete.
Creating brainy skull (1)...
You acquire an item: brainy skull
Successfully created brainy skull (1)
Creating chef skull (1)...
You acquire an item: chef skull
Successfully created chef skull (1)
Creating chef-skull-in-the-box (1)...
You acquire an item: chef-skull-in-the-box
Successfully created chef-skull-in-the-box (1)
Purchasing E-Z Cook Oven™ (1 @ 950)...
You acquire an item: E-Z Cook Oven™
Purchases complete.
Creating chef-in-the-box (1)...
You acquire an item: chef-in-the-box
Successfully created chef-in-the-box (1)
Using 1 chef-in-the-box...
Finished using 1 chef-in-the-box.
Creating milk of magnesium (1)...
You acquire an item: milk of magnesium
Successfully created milk of magnesium (1)
Using 1 milk of magnesium...
You acquire an effect: Got Milk (duration: 5 Adventures)
Finished using 1 milk of magnesium.
0: milk of magnesium price: 1075 value: 9237
Eating 1 Hell ramen...
You gain 31 Adventures
You gain 23 Fortitude
You gain 30 Magicalness
You gain 26 Smarm
You gain 21 Meat
Finished eating 1 Hell ramen.
1: Hell ramen lev:6 gain:6.0 adv:25.5 musc:25.5 myst:25.5 moxie:25.5 price:122 own:12 pull:false make:false value:2164
Choosing food to consume.
Attempting to consume...
You have at least one Hell ramen in inventory.
Eating 1 Hell ramen...
You gain 27 Adventures
You gain 26 Strengthliness
You gain 35 Mysteriousness
You gain 23 Chutzpah
You gain 22 Meat
KoLmafia declares world peace.
I now have elven limbos gingerbread in inventionary, looks like the purchase succeeded.
only one aparent food eaten, now at 12 fullness. Is this behaviuor expected?
as to why Mafia purchased all the oven bits oven I have no idea, I assume I have a setting wrong (already had all the bitys in inventionary) :-/
This is with the new 12.8 mafia version
update: did some more testing - looking good :-) but it put on a bugbear costume to make a crimbo pie, and did not switch back to what I was wearing before when it had finished.
best regards
DAve
New build up! This version will cook food for you if you have all the ingredients. It will auto-obtain the chef and bartender in some cases (the TPS code doesn't use this yet) as well. Many bugfixes, including the outfit one just mentioned.
Don't forget to grab the new datafiles, which are required!
Enjoy!
ironsting
01-18-2009, 03:33 AM
Ever since the new build eatdrink is not running for me. Unable to load the eatdrink_food_data.txt. I loaded the newest ones with no success. I love the script and would like to get it working again. Let me know what you need to trouble shoot. I have been using the daily builds each day and it has the same problem on my HC main and SC multi.
Per the build notes, you need to download the new data files as well. Alternately, you can follow the instructions in the thread above to modify yours (involves opening them in a spreadsheet and adding an extra column or two). Good luck!
ironsting
01-20-2009, 01:24 AM
This time I removed all the eatdrink*.txt files and replaced them and now it works /shrug. I don't know if it is a consideration as I don't know how many foods/drinks out there take HP (Hell Ramen, Thistle Wine) but it was a shock to run it one day and come out the other side beaten up.
darius180
05-07-2009, 03:59 PM
This script is no longer doing any drinking for me - it correctly identifies my fullness, but it seems unable to see how drunk I am (or how much spleen i have for that manner). Help please!
Raven434
05-09-2009, 12:14 PM
How do I set it to *not* finish off the with the stiffest drink I can find?
I just want it to 15-19-15 and I'll get the nightcap drink at the end of my adventuring for the day.
Thanks.
StormCrow42
05-09-2009, 06:36 PM
How do I set it to *not* finish off the with the stiffest drink I can find?
I just want it to 15-19-15 and I'll get the nightcap drink at the end of my adventuring for the day.
Thanks.
You just tell it overdrink false.
Raven434
05-09-2009, 09:02 PM
I must have mixed that up with the "prompt to confirm that you want to overdrink".
Thanks.
Darius, has it started working for you again? It sounds like Mafia got out of sync on fullness (happens sometimes). If not, please paste in the eatdrink output so I can try to help.
johngnash
05-12-2009, 05:11 PM
call *very long list of sub directories*/KoLmafia/scripts/EatDrink.ash
Expected ), found = (EatDrink.ash, line 1027)
DeathPhoenyx
05-13-2009, 09:49 PM
same problem as johngnash here...
Alhifar
05-13-2009, 10:35 PM
This was broken by a somewhat recent update. Simply change "=" to "==" at the line(s) given
hairball
06-02-2009, 03:14 PM
Can we tell it that it shouldn't use my enchanted bean if I'm in bad moon and not level 10? I don't want to have to go back at level 10 and farm another bean, but because my diet is very limited due to bad moon, enchanted bean burrito becomes part of my diet if I have a bean. Even if I put the bean in my closet, mafia pulls it out to consume it.
I'd imagine bird rib, lion oil, stunt nuts, wet stew and wet stunt nut stew should be special as well. :)
So I've been using this script for a while on a variety of multis. Prior to running the part that makes me drink, I have to remember to shrug one of my AT buffs so I can use ode.
Actually, that's not entirely true. I usually invoke a mood called booze and then execute, and mafia takes care of the shrugging and casting for me. When I finish, I just call my previous mood.
Can I request an option to use invoke a "drinking mood" so that ode gets cast properly if I call eatdrink from a script (ascend.ash, for example) or if that's too niche, I'll employ my workaround/haxxor! And if it's not too ugly, maybe I'll post it!
Go for it, Kain! I haven't permed Ode so I lack both the means and motivation to test it. :)
@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)
// 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)
if (type == "booze")
{
// 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
if (SUPRESS_OVERDRINK)
And finally, some mood restoration after the final report is generated
(again, bolded code is new code)
Line 1397
print_html(finalsummary);
cli_execute("outfit checkpoint");
if (tempMood != "NONENONENONE")
{
print("Now restoring previous mood ...");
cli_execute("mood " + tempMood);
cli_execute("mood execute");
}
}
I am also attaching the modified file.
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.
Alhifar
06-06-2009, 05:06 AM
Instead of invoking a mood, why not just use use_skill( 1 , $skill[Ode to Booze] )?
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 :)
fuzzyevil
06-13-2009, 08:11 PM
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.
StormCrow42
06-14-2009, 08:50 PM
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.
mredge73
06-19-2009, 01:48 PM
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:
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. :)
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.
Heffed
07-28-2009, 05:14 AM
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.
Heffed
07-28-2009, 05:51 PM
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?
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.
Heffed
07-28-2009, 07:54 PM
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!
- 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.
Heffed
07-29-2009, 03:20 AM
OK, I'll mess around with it. Thanks!
That FN Ninja
08-03-2009, 01:00 AM
Hey, I've tried to run this a couple of times and I keep getting the following:
Undefined reference to function 'report_price' (getonbudget.ash, line 36)
Anyone else have this problem?
jambosque
08-06-2009, 07:23 AM
Checking ashref, it looks like that function should probably be 'mall_price' instead.
New test version! If you download and try it, please post your results here so I know if I should update the main version.
Just two improvements: It plays nice with zlib (and also ascend.ash), and it's much much much faster.
Please let me know if it works. If you think it chose the wrong diet for you, please post the complete output here so I can try to debug.
Oh: you MUST DELETE YOUR OLD DATA FILES and replace them with the attached 3 data files.
Sputnik1
08-10-2009, 06:03 AM
> call scripts\EatDrink.ash
Function 'verbose' defined multiple times (EatDrink.ash, line 166)
StormCrow42
08-13-2009, 12:10 AM
Total WTF here. The updated version here on the last page seems to have suddenly decided it wants to drink food.
Starting EatDrink.ash (version 2.1).
Consuming up to 13 food, 19 booze, and 15 spleen
Considering food from inventory Hagnk's the mall. Per-item budget cap is 25000.0.
Price will be a factor if you own it already. Hagnk's pulls (if enabled) will cost 3000 meat each.
An adventure has the value of 900 meat. Muscle subpoint is 0. Nonprime stat subpoint is 0.
Loading drink records.
Now at inebriety of 0, drinking to 19.
Updating drink map with Mafia's datafiles (slow, happens once per week)
Filtering remaining drinks for level and availability.
Calculating drink values.
Choosing drink to consume.
Attempting to consume...
Shopping for a spooky lo mein in 3 seconds
Countdown: 3 seconds...
Countdown: 2 seconds...
Countdown: 1 second...
Waiting completed.
budgeting 1993 for 1 additional spooky lo mein. You have 9681288 meat. You have 0 in inventory already.
You have more meat than budgeted, so putting the excess 9679295 meat in closet.
Placing meat into closet...
Searching for "spooky lo mein"...
Purchasing spooky lo mein (1 @ 1,595)...
You acquire an item: spooky lo mein
Purchases complete.
Removing meat from closet...
Purchased 1 spooky lo mein for 1595 meat.
spooky lo mein is not an alcoholic beverage.
FAIL: spooky lo mein lev:6 gain:4.0 adv:18.0 musc:0.0 myst:0.0 moxie:33.0 price:1595 own:0 pull:false make:false value:3652
Calculating drink values.
Choosing drink to consume.
Attempting to consume...
You have at least one spooky lo mein in inventory.
Countdown: 3 seconds...
Edit: It appears that somehow both my drink and spleen data files have food items in them as well. Perhaps the new version is corrupting them?
So you're saying you *don't* want to drink food?
Sigh. Fine.
The previous post is updated so it gets drinks from the drink file and spleenables from the spleen file. Be sure to nuke your datafiles and re-download them as they've been "updated" in a way you seem not to prefer. Keep the bug reports coming.
:)
StormCrow42
08-13-2009, 05:56 AM
This version seems to want to make TPS drinks on my non-TPS alt, perhaps caused by being first run on my TPS bearing main. Luckily it figures it out and fails pretty quickly.
tgetgel
08-15-2009, 08:04 PM
I love the script. Some questions though.
Why does it only purchase things one at a time? If it is going to buy 5 of something, can it budget for 5 appropriately and buy them all at the same time if they are at the budgeted (same) price? Similarly, if you have a number of items in inventory, can it calculate the number needed and consume them all at once?
It only purchases one at a time because that way, if it costs more than anticipated (each successive purchase might be priced higher in the mall) the script can catch the error and adjust its expectations of pricing by purchasing a less expensive item.
tl;dr: Because dj_d is clever and wants to outsmart mafia's limited pricing info.
Righto. And it's not hypothetical; it happens quite a bit - someone makes a small number of something available at price X, and when you go to buy it, it's unavailable or there's not a sufficient quantity available at the price you asked for.
Incidentally, an update that uses historical_prices is in the todo list.
tgetgel
08-17-2009, 04:26 PM
Righto. And it's not hypothetical; it happens quite a bit - someone makes a small number of something available at price X, and when you go to buy it, it's unavailable or there's not a sufficient quantity available at the price you asked for.
By unavailable, I take that as the seller has limited the number that you can buy in a day, or if using historic prices that no one is selling at that price.
It seems like you could find out the lowest price and buy up to X number at that price. If the price was more than the expected, recalculate like you do now.
Alternatively, you could say while there are X remaining to purchase and since the cost of the last one was Y (found from buying the first or some other method), keep buying at price Y until there were no more at that price or you purchased enough of them. You would have to budget more when you went to buy, but that can be limited to Y*X.
That is unless there is something in the Mafia purchasing mechanics that I do not understand. Maybe I am trying to force a script to do things the way I would do it in a browser (chrome BTW).
tg
That is unless there is something in the Mafia purchasing mechanics that I do not understand.This.
Purchasing in mafia is like juggling in a strait jacket. It will tell you the price of the 5th item available for purchase rather than the current one, it will not tell you anything else about prices or quantities, and it will only check once per session. If someone purchases those items while you are continuing to compute the best choice, you cannot simply check the price again to ensure it hasn't changed. A lot can happen around mafia's limitations so dj_d is trying to save your ass.
Although I confess to having noodled on ways that I could use my scripts for nefarious purposes. If you ever find yourself filling up on grimacite bocks from dj_d's store, you'll know that I've gone to the dark side. ;)
On a happier note, a WAY faster eatdrink that uses historical prices! The data files from the earlier post should be compatible. Please post feedback!
Ed: You must use the data files from post #103: http://kolmafia.us/showpost.php?p=15665&postcount=103
Sputnik1
08-18-2009, 06:20 AM
sorry to bring bad news, something came up with the new version
Simulating only; no purchases or food/drink/spleen consumption.
Loading food records.
Now at fullness of 0, eating to 30.
Unexpected error, debug log printed.
Error loading eatdrink_food_data.txt, aborting
there's something up with the old data files that the new version isn't having a good time with
On a happier note, a WAY faster eatdrink that uses historical prices! The data files from the earlier post should be compatible.I'll look forward to testing this out.
You should update that first post. I assume getonbudget.ash, price.ash and pricelist.txt are no longer necessary?
I'll update the first post as soon as I hear from a few folks that this version is stable and working from them. And yes - they're gone!
That FN Ninja
08-18-2009, 04:45 PM
I got this:
Simulating only; no purchases or food/drink/spleen consumption.
Loading food records.
Now at fullness of 0, eating to 30.
Unexpected error, debug log printed.
Error loading eatdrink_food_data.txt, aborting
I tried it with eatdrink_food_data.txt in the actual scripts folder and I tried it with it in the data folder, but it failed to load from both places.
You need to use the data files from post 103. http://kolmafia.us/showpost.php?p=15665&postcount=103
tgetgel
08-22-2009, 05:05 AM
This.
Purchasing in mafia is like juggling in a strait jacket. It will tell you the price of the 5th item available for purchase rather than the current one, it will not tell you anything else about prices or quantities, and it will only check once per session. If someone purchases those items while you are continuing to compute the best choice, you cannot simply check the price again to ensure it hasn't changed. A lot can happen around mafia's limitations so dj_d is trying to save your ass.
That definitely changes the thought process. Thanks dj_d for saving us all! Thanks Bale for the enlightenment!
That FN Ninja
08-22-2009, 07:07 AM
The new version you uploaded seems to be working just fine for me. Awesome. Thanks.
StormCrow42
08-22-2009, 06:56 PM
Just another chime in that the new version seems to be working fine.
the_great_cow_guru
08-25-2009, 12:59 PM
I can't get it to run, it says:
Undefined reference to function 'historical_age' (eatdrink.ash, line 875)
I don't know if this is a problem with eatdrink or with zlib, or maybe something else entirely
Metraxis
08-25-2009, 02:48 PM
historical age(item) premiered in 7531, so the first question is, are you running a build at least that new?
the_great_cow_guru
08-25-2009, 03:07 PM
ah ok, i didn't realize it was a mafia function i thought it was something he wrote
Someone asked in a PM:
Firstly, how're nightcaps handled? I'm trying to integrate it into my daily collection of scripts, but I'm not sure how to set it so that it consumes my nightcap after I'm done adventuring, and not before while it's filling up the rest of my fullstats.
Also, is there a way for me to skip the the input steps at the prompts every time I run it? Like I said I want to run it in amongst a bunch of other scripts so it'd be handy to not have to wait around the computer for the prompts every time I run my daily set of scripts.
There are a bunch of ways to call it, depending on how much fine-grained control you want over its parameters. This is a good way to do breakfast:
eatdrink(fullness_limit(),inebriety_limit(), spleen_limit(), false,500,5,1,1000,false);
and here's your nightcap:
eatdrink(fullness_limit(), inebriety_limit(), spleen_limit(), 500,5,1,1000,false);Prompts are automatically supressed if you call it programmatically. Don't forget to put
import <eatdrink.ash>; at the top of your script.
Also also, does your script take the bonus provided by tuxedo shirts into account?
It does now. :)
Banana Lord
08-29-2009, 11:58 PM
Thanks dj_d! I'll remember to ask here for help in future.
No problem. I check here more often than my ingame messages. :)
Banana Lord
08-30-2009, 06:53 AM
Hmm. EatDrink's decided that nothing's good enough for me to consume. I haven't changed anything since the last time I ran the script so I assume this is something to do with price data?
It's probably the settings you're using. I need to know what it says at the end of running it - from "Now, to recap" on - to help diagnose it.
Banana Lord
08-30-2009, 07:17 AM
******************************************
Now, to recap...
******************************************
Starting EatDrink.ash (version 2.3).
Consuming up to 15 food, 19 booze, and 15 spleen
Considering food from inventory Hagnk's the mall. Per-item budget cap is 25000.0.
Price will be a factor if you own it already. Hagnk's pulls (if enabled) will cost 3000 meat each.
An adventure has the value of 500 meat. Moxie subpoint is 10. Nonprime stat subpoint is 2.
Simulating only; no purchases or food/drink/spleen consumption.
Now at fullness of 0, eating to 15.
Now at inebriety of 0, drinking to 19.
Now at spleen of 0, spleening to 15.
Finished. You had -Ode to Booze in effect. Adventures listed above does not reflect that, but this does:
Spent 0 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).
And here's the non-simulated version (ignore the difference in stat point values, I was tinkering with them in between the two runnings):
******************************************
Now, to recap...
******************************************
Starting EatDrink.ash (version 2.3).
Consuming up to 15 food, 19 booze, and 15 spleen
Considering food from inventory Hagnk's the mall. Per-item budget cap is 25000.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 500 meat. Moxie subpoint is 5. Nonprime stat subpoint is 1.
Now at fullness of 0, eating to 15.
Now at inebriety of 0, drinking to 19.
Now at spleen of 0, spleening to 15.
Finished. You had -Ode to Booze in effect. Adventures listed above does not reflect that, but this does:
Spent 0 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).
Also, the nightcap line you gave me:
eatdrink(fullness_limit(), inebriety_limit(), spleen_limit(), 500,5,1,1000,false);
Returns "Undefined reference to function 'eatdrink' (Farming Logout.ash, line 93)".
EDIT: Nevermind, I changed it to:
eatdrink(fullness_limit(), inebriety_limit(), spleen_limit(), true,500,5,1,1000,false);
and it works perfectly (well, at least in the sense that it now runs, I still can't get it to consume stuff). Unless that makes it do something weird that I don't know about?
I'm stumped. Post your session log as an attachment and I'll take a look. First, though, make sure it still happens today after restarting mafia.
Banana Lord
08-31-2009, 05:17 AM
Yeah, it's still doing it. Here's yesterday's log.
BL, I'm not sure what's going on there - and the log files are useless, unfortunately (a separate problem I'll have to investigate) - but I noticed that version checking was broken. Try downloading 2.3 (and don't forget to download the new data files and delete the old ones) and see if it works.
Banana Lord
08-31-2009, 06:31 AM
Re-downloaded everything. Version checking's working again but it's still not consuming. Would it be worth letting you take a look at my vars_banana_lord.txt flie?
> call scripts/EatDrink/EatDrink.ash
Internal checkpoint created.
Already updated from http://zachbardon.com/mafiatools/updateprices.php?action=getmap in this session.
Already updated from http://nixietube.info/mallprices.txt in this session.
Refreshing stash contents...
Stash list retrieved.
Checking for updates (running EatDrink ver. 2.3)...
_version_eatdrink => 2.3
Starting EatDrink.ash (version 2.3).
Consuming up to 15 food, 19 booze, and 15 spleen
Considering food from inventory Hagnk's the mall. Per-item budget cap is 25000.0.
Price will be a factor if you own it already. Hagnk's pulls (if enabled) will cost 3000 meat each.
An adventure has the value of 500 meat. Moxie subpoint is 5. Nonprime stat subpoint is 1.
Simulating only; no purchases or food/drink/spleen consumption.
foo
Now at fullness of 0, eating to 15.
foo
foo
foo
If there are any favorites still in consideration, they'll be listed here:
No food available that's good enough for you. Moving on.
foo
foo
Now at inebriety of 0, drinking to 19.
foo
foo
foo
If there are any favorites still in consideration, they'll be listed here:
No booze available that's good enough for you. Moving on.
foo
foo
Now at spleen of 0, spleening to 15.
foo
foo
foo
If there are any favorites still in consideration, they'll be listed here:
No final spleen available that's good enough for you. Moving on.
foo
Already submitted to http://zachbardon.com/mafiatools/updateprices.php in this session.
Finished.
Spent 0 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...
******************************************
Starting EatDrink.ash (version 2.3).
Consuming up to 15 food, 19 booze, and 15 spleen
Considering food from inventory Hagnk's the mall. Per-item budget cap is 25000.0.
Price will be a factor if you own it already. Hagnk's pulls (if enabled) will cost 3000 meat each.
An adventure has the value of 500 meat. Moxie subpoint is 5. Nonprime stat subpoint is 1.
Simulating only; no purchases or food/drink/spleen consumption.
Now at fullness of 0, eating to 15.
Now at inebriety of 0, drinking to 19.
Now at spleen of 0, spleening to 15.
Finished.
Spent 0 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).
Try downloading the latest build of Mafia.
Banana Lord
09-01-2009, 08:22 AM
Done. Still no luck. :(
Are you maybe oxy (forgot to drop path) without any spleen items available?
I posted a new version that fixes a problem with purchasing items where there's 5 or more that are cheap, but you want to buy more than 5. It might solve your problem (let me know), but I'm still investigating.
Banana Lord
09-02-2009, 05:12 AM
I'm not oxy, and no, the new version hasn't fixed whatever's going on.
Spiny
09-02-2009, 06:40 AM
I suppose this is a no-brainer comment, but are your map files intact? Could they have become corrupted?
-Spiny
Good question - deleting and re-downloading them is harmless, and a good idea.
I'm still stumped on why your session log is printing a variable name (foo) instead of the contents of the variable. Makes this virtually impossible to debug.
Spiny
09-02-2009, 07:30 AM
Did some messing around. Moved the 3 map files into someplace else altogether to see if the script would abort, and it didn't. It just kept trucking merrily along finding nothing to consume and then dumped empty data files into the data folder. In the instructions where you download this script, at least as of last night, you state to put the data files into the scripts folder. I could not get "foo" to print out no matter what level of verbosity I tried. So I could not duplicate Banana's "foo"ness. This was tested with EatDrink.ash version 2.3. Btw, is there a way to make it so the script can be ran regardless of what case the script is called? ie eatdrink.ash does not work, but EatDrink.ash does.
-Spiny
Hm. This is very odd. Spiny, BL, what OSs are you using?
Spiny
09-02-2009, 08:41 PM
Hm. This is very odd. Spiny, BL, what OSs are you using?
Which part is odd? :) The fact that the script did not abort without data files or that calling the script required case sensitivity?
I'm running Gentoo Linux x86_64.
Just to be clear, the v2.3 script works fine for me, at least while simulating. I haven't run it for the purpose of non-simulation. I was just intentionally trying different things to see if the word "foo" would appear somehow as it did for BL. The word "foo" never appeared.
Testing without any data files:
> Loading food records.
> filtering food based on level & availability
> calculating food values
> Choosing food to consume.
> If there are any favorites still in consideration, they'll be listed here:
> No food available that's good enough for you. Moving on.
> Writing out new food file
> Loading drink records.
> Filtering remaining drinks for level and availability.
> Calculating drink values.
> Choosing drink to consume.
> If there are any favorites still in consideration, they'll be listed here:
> No booze available that's good enough for you. Moving on.
> Calculating values for final drink.
> Choosing final drink to consume.
> If there are any favorites still in consideration, they'll be listed here:
> No final drink available that's good enough for you. Moving on.
> Writing out new drink file
> Loading spleen records
> filtering spleenables based on level & availability
> Getting prices and calculating total spleen scores
> Choosing spleenable to consume.
> If there are any favorites still in consideration, they'll be listed here:
> No final spleen available that's good enough for you. Moving on.
> Writing out new spleen file
-Spiny
I've never tested on a linux OS. It doesn't surprise me that it'd be case sensitive (since the underlying filesystem is) where it's not on Windows, and unfortunately, I don't think there's anything that can be done about it.
BL, corrupt data files are a good possibility. There may be a version of it tucked in /scripts or /data or some otther subdirectory that's not obvious as well. Try deleting all the data files and re-downloading.
I'm still stumped about the "foo" though.
Banana Lord
09-03-2009, 05:26 AM
Well it's working again! I have no idea why, I haven't changed anything.
I can help you with "foo". There's an option for removing verbosity in your script, I took it. Sorry, I should have thought of this earlier.
// Uncomment the print statement for moderate verbosity
void verbose(string foo)
{
print("foo");
}
// Uncomment the print statement for extreme verbosity
void verbose2(string foo)
{
// print("foo");
}They're uncommented by default.
EDIT: I checked to see if having "foo" in comments was what stuffed up the script. It's not. Works fine with or without the comments.
EDIT2: Is it still worth re-downloading those files? If so how do I go about it? Where do I download them from, and where do I put them?
Spiny
09-03-2009, 07:27 AM
Well it's working again! I have no idea why, I haven't changed anything.
I can help you with "foo". There's an option for removing verbosity in your script, I took it. Sorry, I should have thought of this earlier.
// Uncomment the print statement for moderate verbosity
void verbose(string foo)
{
print("foo");
}
// Uncomment the print statement for extreme verbosity
void verbose2(string foo)
{
// print("foo");
}They're uncommented by default.
For me the script starts out as you have them here, when I was trying to duplicate being spammed by "foo" I ran tests with both uncommented and both commented and as is. I never saw foo... I'm foo-less lol.
As for the case sensitivity in names of scripts... I really think that's a new thing, but I was looking over my scripts file and there are only 3 scripts there that have caps in their names and I don't use them very much so I can't say for certain. I suspect renaming them to lower case should work just fine as I'm more inclined to type them that way. But not going out of my way to test that presently ;)
-Spiny
Banana Lord
09-03-2009, 07:40 AM
I'm foo-less
Strange. Although it does make me feel like a ninja (or is that "fu"?) :). Any theories on the miraculous recovery of the script?
Spiny
09-03-2009, 08:10 AM
Strange. Although it does make me feel like a ninja (or is that "fu"?) :). Any theories on the miraculous recovery of the script?
Not a clue. If it works, be happy :)
-Spiny
No clue, but if it works, don't mess with it!
I think we discovered the problem of the mysterious "foo", though. You added quotes to it. It should be (and is, in the version here)
print(foo)
not
print("foo")
they're two very different things. :)
Banana Lord
09-04-2009, 04:18 AM
No clue, but if it works, don't mess with it!
I think we discovered the problem of the mysterious "foo", though. You added quotes to it. It should be (and is, in the version here)
print(foo)not
print("foo")they're two very different things. :)
Well, I certainly won't mess with it. I know they're different, I thought the point of that section was for control over verbosity? I quoted them, in line with the instructions, to reduce the amount of text the script threw up. Mainly because I was debugging some of my scripts.
But anyway, thanks for all your help. Even though you didn't technically fix it, you wrote the script that fixed itself, which is good enough for me!
I think there was some confusion between uncomment and quote. Commenting it out gives you terseness. Uncommenting (the default) gives you verbosity. Quoting gives you "foo" repeatedly, which is Less Useful. Glad it's working for you now, though, and with the "foo!" problem solved, the next round of debugging will be much easier. :)
Banana Lord
09-04-2009, 09:31 AM
I think there was some confusion between uncomment and quote. Commenting it out gives you terseness. Uncommenting (the default) gives you verbosity. Quoting gives you "foo" repeatedly, which is Less Useful. Glad it's working for you now, though, and with the "foo!" problem solved, the next round of debugging will be much easier. :)
Yeah, I did wonder about the "foo" thing. I thought it was odd since the rest of your script is so polished... OK, so how would the lines in question look "commented out"?
verbose / no comments:
print (foo);
terse / commented out:
// print (foo);
Banana Lord
09-05-2009, 01:35 AM
Aha! Much better. Thanks!
Heffed
09-05-2009, 05:17 AM
OK, I finally got my brain around giving this script a try again. (Real life intrudes...)
It's totally my fault for not watching the script more closely, but I think this statement is a bit misleading.
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).
Unless there is a purpose I'm unaware of for eating all your food and drinking yourself into a stupor so you can't actually use your newly gained adventures? (Perhaps that is the mentioned havoc?) ;)
I was a little bit concerned that it didn't mention to set overdrink to false as well as simulation, but I figured I did tell it I only wanted a drunkeness of 19, so I'll go with what the script author said to do. Unfortunately I was distracted when I told the script to run and didn't notice I had also drank my nightcap until I was consuming my spleen items.
Which brings me to another point. Why does the script make each purchase and consumption singly? Wouldn't it be easier on the server to make bulk purchases and consumption where applicable?
Nice script by the way! :D
Which part was misleading? The warning to use the script with caution? The explanation of what all the settings were? The variable called "overdrink" that made you overdrink? That it was set to "false" by default? The "sim" mode that let you see what it would do before you do it? The "sim" mode set to true by default to prevent exactly this sort of thing from happening?
I'm not sure I could have done much more to help you. :)
There are complex restrictions of kolmafia pricing and purchasing that make it optimal to calculate, buy, and consume one at a time. There's more of an explanation earlier in the thread.
Heffed
09-05-2009, 11:12 AM
Which part was misleading? The warning to use the script with caution? The explanation of what all the settings were? The variable called "overdrink" that made you overdrink? That it was set to "false" by default? The "sim" mode that let you see what it would do before you do it? The "sim" mode set to true by default to prevent exactly this sort of thing from happening?
I'm not sure I could have done much more to help you. :)
You know, I'm really not an idiot. :rolleyes:
The misleading part was exactly what I quoted. You say nothing about setting overdrink to false. The default state for overdrink is not false.
Even if I set eatdrink_suppressOverdrink to false in my vars file, the boolean selection dropdown defaults to true. (see attached screenshot)
As I said, the mistake was mine. I take full responsibility for my actions. I was unsure on some of the scripts operation so I decided when in doubt, follow the instructions to the letter, which turned out to have unexpected results.
I assumed the simulation was showing the nightcap as part of the total package budget, (meat cost, adventures, etc...) not that it would actually drink it as I had only set my drunkeness at 19.
Since your instructions didn't say anything about the overdrink setting in step four, I assumed it was irrelevant. We didn't tell the script to overdrink, so why should we care if the alert is suppressed?
I guess I'm unsure why the nightcap is even calculated when setting my drunkeness at 19? That should render the whole overdrink issue moot to begin with. Now if I had entered 25 drunkeness, that would be another story and I would expect the overdrink selection to come into play.
So yes, again it is my fault. Yes, you did make your disclaimers. Yes I should have paid more attention to what the script was doing, but quite frankly I was only following the instructions. Perhaps you could change step four to include setting overdrink to false as well as sim_only?
Hopefully this doesn't come across as angry, because I'm not.
dawdawdo
09-10-2009, 11:22 PM
Am I missing an include here?
Undefined reference to function 'historical_age' (eatdrink.ash, line 898)
StormCrow42
09-11-2009, 12:31 AM
Am I missing an include here?
Undefined reference to function 'historical_age' (eatdrink.ash, line 898)
No, you're mafia is too old. Update it.
the_great_cow_guru
09-12-2009, 07:02 PM
Hmm I was having some issues with getting this to work. (And sorry if you already know about this. I didn't want to look through all 16 pages to see if it's been reported) I downloaded the ascend.ash script and ran the eatdrink.ash so it would make all the variables and i could tweak them. Except instead of using the data files in the script folder it created blank data files in the data folder, and then it told me that there was nothing good enough for me. I copied all the data files from the script to the data folder and it worked fine. Just thought I'd post in case anyone else had this problem. Again, sorry if you already knew about this
Wierd! Mafia's default folder locations have always been a mystery to me. Will be interesting to see if there are any other reports. Glad you got it working, though.
Veracity
09-12-2009, 09:40 PM
Mafia's default folder locations have always been a mystery to me.
As of revision 7526 (http://kolmafia.us/showthread.php?t=2346) on August 6, data files always come from the "data" directory. I know that zarqon and Bale had repeatedly lobbied for that fix; I could have sworn that you did too, but apparently not.
Here's what the revision log says about this:
Fix creation of data files from ASH scripts:
* use only the final component of the pathname, even on Windows (only forward slashes were previously considered, which was a security hole).
* create files in the data directory rather than the script directory.
flypapermonk
09-20-2009, 02:31 PM
I'm still trying to figure out what happened, but I have a script where I eat once in a day and then a second time at the end of the day using your script here. It eats up to 13/15 fullness for me at the beginning and then tries to fill up to 15 at the end of the day. Your script was run properly (message from script: Now at fullness of 13, eating to 15.) but it did not actually eat up to 15 fullness. Other than this little hiccup it works great, but I sure would love to know how to get it to work properly.
Neo - the behavior you describe is not unexpected if you don't have any qualifying food (of 1 or 2 fullness). That's common if you're in Ronin or hardcore, for example. But I'd have to get more detail to know exactly what's happening. I've certainly used it that way myself successfully many times.
flypapermonk
09-21-2009, 02:11 PM
I'd have to get more detail to know exactly what's happening.
What information do you need?
To start with, the summary text that gets printed out at the end of running eatdrink would help.
brennydoogles
09-22-2009, 12:46 AM
I am trying to run this on a fairly new multi (trying to get a fresh config for the config editor), and I get the following error when running EatDrink.ash (with all other scripts fully updated):
> call scripts\EatDrink.ash
Undefined reference to function 'historical_age' (EatDrink.ash, line 898)
> eatdrink.ash
Undefined reference to function 'historical_age' (eatdrink.ash, line 898)
I tried running it from the scripts menu as well as manually, and got this error both times. Any Ideas?
The question has been asked and answered several times already. :'(
Answer: Your KolMafia is too old. Update it (http://builds.kolmafia.us/).
Moral: Always update software before reporting a bug. Doubly so for a beta product like KolMafia which is frequently adding new functions like historical_age.
brennydoogles
09-22-2009, 03:50 PM
Answer: Your KolMafia is too old. Update it (http://builds.kolmafia.us/).
Oops... apologies. I keep KOLMafia updated on my Linux Box since it is my main machine, but I had forgotten to check for updates on my windows machine (which I only use for C# programming). I guess I thought it checked for updates automatically. I will reboot and update!
That FN Ninja
09-23-2009, 04:46 PM
I started messing around with this a lot recently and it is extremely useful!! :D So, thanks for this script!
I did notice one thing, which is really more of a user error and most likely wouldn't come up if eatdrink was being called from a script. I accidentally put a drinkMax that was higher then my inebriety limit and overdrink was set to true. So it overdrank just trying to get to my erroneous drinkMax value and then when it came time to over drink it went into a loop because I was already falling down drunk.
Like I said, this is more of a user error, but something like this would prevent this problem from ever occurring:
if(drinkMax > inebriety_limit())
drinkMax = inebriety_limit();
Anyways, thanks again for the script!
Awesome! I'm glad you like it!
I added that check, with an exception for if you're simulating. I also added a check for if your requested consumption is less than your max consumption but you still request overdrink.
Raven434
09-24-2009, 07:07 PM
Hi, I really like this script a lot.
I have a few mechanical questions that I haven't been able to figure out.
It appears that favorites are defined in the EatDrink script itself as opposed to vars_YOUR-TOON.txt. Will they be moving in later following the trend towards zlib goodness?
What is the relationship between prime vs non-prime as a ratio? Meaning, is defining prime stat of 10 and non-prime of 2 the *same* as prime 5 and non-prime 1? Does it matter in terms of how EatDrink decides on how to act?
Is there a recommended ratio for maximizing adventures as opposed to stat gain? I have a multi in aftercore working on Wumpus and lucres and other trophies for a week or so and want max adventures instead of max stats. Is there a way to optimize for that?
Thanks so much.
Re: moving favorites to zlib, laziness may preclude it. But knowing that you're using the feature is a good kick in the rear to do it sometime. :)
The ratio is important but the absolute value is more important. EatDrink normalizes all beneficial aspects of food (except effects) in to meat. The number is how much meat a subpoint is worth. If you don't care about stats, set them both to zero. If you care a lot about adventures, set that higher.
The formula goes:
meat-per-adventure * adventures +
meat-per-substat * substat-granted +
meat per-prime-substat * prime-substat-granted
MINUS
cost of the item
(then divided by fullness/drunkenness/spleenness)
whatever item has the best "value" according to this, wins. A rough rule of thumb is that value per adventure should be equal to whatever you make farming in a day.
Raven434
09-25-2009, 12:41 AM
If you don't care about stats, set them both to zero. If you care a lot about adventures, set that higher.
I set prime and non-prime to 50 and ate a bunch of canes and drank a bunch of thistle wine which were huge stat gains, not so huge adventure gains. Ala the typical SCNP pulls you might have on day 1.
Did I read the above wrong?
whatever item has the A rough rule of thumb is that value per adventure should be equal to whatever you make farming in a day.
Do you mean what I make farming per turn, not the total for the day, right? I am 99.9875% sure that is what you mean. :-)
Heffed
09-25-2009, 03:32 AM
Do you mean what I make farming per turn, not the total for the day, right? I am 99.9875% sure that is what you mean. :-)
Yes, so if you average 800 meat per turn, set your adventure value at 800.
Right, sorry. What I meant to say was:
If you don't care about stats, set prime and nonprime to zero. If you care a lot about adventures, set the stat numbers to zero and the adventure value number higher.
Idran
09-27-2009, 05:17 PM
I had a feature suggestion for this: right now for each step, it makes food, checks if you don't have Got Milk, makes magnesium if necessary, uses it, eats, and then continues. Would it be possible for it to make food all one after another before consuming anything, then use milk of magnesium, then consume? When you're in ronin or HC and you don't have a chef-in-the-box, it kinda sucks to have Got Milk run out in the middle of eating so you have to use two goat's milks that day. :(
Maybe even just have this as an option you can set, or even better (if possible), have it decide which to do based on if you have a chef-in-the-box or not? It's less important for booze since Ode just uses MP which isn't as big of a deal, but maybe have something similar for booze anyway too.
Great idea, although something of a pain in the neck. :) I'll put it in the todo list.
flypapermonk
09-29-2009, 11:50 AM
Okay, so my problem hasn't been very consistent (only happening when I was watching for it to happen) but it finally happened again. Here is the output:
Starting EatDrink.ash (version 2.4).
Consuming up to 15 food, 14 booze, and 20 spleen and then finishing off with the stiffest drink we can find.
Considering food from inventory Hagnk's the mall. Per-item budget cap is 25000.0.
Price will not be a factor if you own it already. Hagnk's pulls (if enabled) will cost 3000 meat each.
An adventure has the value of 750 meat. Moxie subpoint is 0. Nonprime stat subpoint is 0.
Loading food records.
Now at fullness of 14, eating to 15.
filtering food based on level & availability
calculating food values
Writing out new food file
Loading drink records.
Now at inebriety of 14, drinking to 14.
It knows that I need and want 1 more fullness and it didn't do anything about it. When I ran the script again immediately after that, it created food and ate it (though it didn't use milk for some reason).
It didn't use milk because it's not worth it on a meat-per-adventure basis to burn milk (which is worth 900 meat in the mall) for a one-fullness item.
I'm stumped as to why it didn't eat to 15, though. The "re-evaluate all items after you've eaten one" code is up for a rewrite, though, because there's a much faster and more elegant way to do it since JH implemented "sort".
JH implemented sort back in February. You're just slow. ;)
I know. I said there was a faster way since he implemented it. I didn't say that *I* got any faster. :P
Sputnik1
10-02-2009, 04:50 AM
i dont know whats happened but i think something has blown up with the mall price updating
Loading food records.
Now at fullness of 0, eating to 15.
Unexpected error, debug log printed.
Error loading eatdrink_food_data.txt, aborting
Before debugging, do this:
1) Update mafia to today's build
2) Delete ALL instances of EatDrink and ALL instances of the eatdrink data files (eatdrink_food_data.txt and the rest of them)
3) re-download all of the above
Let me know if the problem persists.
I've finally got the output tweaked for EatDrink to my liking. Now it outputs much less redundant information, but does print out the best monster (and it's value) for each location.
That helped today since the second location listed had a much higher value for its best monster. I figure with olfaction, the increased frequency of that monster will make the location more valuable.
Veracity
10-02-2009, 05:56 PM
I've finally got the output tweaked for EatDrink to my liking. Now it outputs much less redundant information, but does print out the best monster (and it's value) for each location.
EatDrink prints out information about monsters? I thought it was intended to help you optimize your diet. Or does it tell you which monster to eat and/or drink? :)
It was a little late. And he was drunk (still is, actually). Otherwise I'm guessing he would have posted this in the thread for farm.ash. ; )
I'm an old school nethack player, so I'm all about eating monsters. Lets get Jick on the thread and make this happen.
;)
th3y is quite right. :o
Pretend I posted this in the farm.ash thread, the search and replace EatDrink with farm. At least I got the script's creator correct, so I wasn't 100% hopeless.
Ha!
So are you going to post your mods? Maybe in the PullCrap thread? :)
Test update attached - please let me know how it works. Cleans up a bunch of stuff, first and foremost that data files are no longer necessary!
morgad
10-03-2009, 09:05 PM
> call scripts\EatDrink.ash
Script parsing error (EatDrink.ash, line 272)
> call scripts\farm.ash
Script parsing error (farm.ash, line 6)
> call scripts\Ascend.ash
Script parsing error (Ascend.ash, line 7)
switch back to old version of eat/drink - eatdrink now runs
> call scripts\EatDrink.ash
but the other scripts still don't work (they did before)
> call scripts\farm.ash
Script parsing error (farm.ash, line 6)
> call scripts\Ascend.ash
Script parsing error (Ascend.ash, line 7)
these scripts work fine ...
> call scripts\Ascend Status.ash
> call scripts\Safe.ash
> call scripts\LevelUp.ash
very puzzled ... any ideas how to get it working again?
I have replaced eatdrink + its data files with copies from the zip package, and still can't get things working
Dave
Spiny
10-03-2009, 11:30 PM
> call scripts\EatDrink.ash
Script parsing error (EatDrink.ash, line 272)
> call scripts\farm.ash
Script parsing error (farm.ash, line 6)
> call scripts\Ascend.ash
Script parsing error (Ascend.ash, line 7)
switch back to old version of eat/drink - eatdrink now runs
> call scripts\EatDrink.ash
but the other scripts still don't work (they did before)
> call scripts\farm.ash
Script parsing error (farm.ash, line 6)
> call scripts\Ascend.ash
Script parsing error (Ascend.ash, line 7)
these scripts work fine ...
> call scripts\Ascend Status.ash
> call scripts\Safe.ash
> call scripts\LevelUp.ash
very puzzled ... any ideas how to get it working again?
I have replaced eatdrink + its data files with copies from the zip package, and still can't get things working
Dave
Without looking myself, I can't say for certain... I know for me that farm.ash has a line:
import <eatdrink.ash>
This fails for me because I'm on Linux and the script is named EatDrink.ash, not eatdrink.ash. If this is the problem for you, that would be an easy fix.
Morgad, you are almost certainly a living example of why I want version checking. Update your kolmafia to the latest build.
So are you going to post your mods? Maybe in the PullCrap thread? :)
Nothing astonishing. Just commented out a lot of print lines and added a few print lines to output some more information for each location in the semi-final report. I'll spare PullCrap knowledge of this. ;)
morgad
10-04-2009, 10:22 AM
Morgad, you are almost certainly a living example of why I want version checking. Update your kolmafia to the latest build.
updated from 7687 to 7691, and still got same results
(I am running on XP pro, might try it on my Ubuntu box if all else fails)
I think I will go blow away all my mafia directories, install Git, an rebuild them from scratch, so I can keep track of what I have changed, rather than what I *think* I have changed ...
got it working again - looks like I had screwed up zlib :-(
what I did this morning to get things running -
installed git (portable version), commited all my mafia directories, so I can track the changes
went back to mafia 13.5, then upgraded this to 13.6
farm.ash now said zlib was out of date (ver 5), so updated this
farm.ash complaied about spaces_to_underscores, so put back in the version from zlib 5, not the version of the function I had copied from the forum yesterday (which is where I think I had screwed up - possible cut/paste error)
now everything working with 7691, using the original version of eatdrink.
Dave
NastyPeasant
10-07-2009, 05:08 AM
Is there a way to tell eatdrink.ash to never use a clover? I think I might have just fubar-d my planned black moon run, as I seem to be missing a clover and eatdrink was spotted trying to use one (it looped trying to make green beer when it wasn't sneaky pete day)
Spiny
10-07-2009, 05:29 AM
If it wasn't sneaky pete's day, green beer would not have been successfully made, even if it were tried.
NastyPeasant
10-07-2009, 03:15 PM
If it wasn't sneaky pete's day, green beer would not have been successfully made, even if it were tried.
It tried. Actually, it seemed to have gotten stuck in a loop trying.
Guess I'll find out when I ascend if I used a clover or not. :-(
EdFox
10-07-2009, 04:54 PM
Using the test update, build 7708 although this happened with previous daily builds as well:
Got script parsing error on line 272.
Original was: [item] consumable_entry[item][string]grub;
I changed it to: consumable_entry [item][string]grub;
and now it works. :)
Overhauled version! Half as big, faster, better, etc. Try it out and let me know how it works.
using build 7716 (current as of now):
overhauled version caused an error in ascend.ash wouldn't let it run due to a function call in line 62 (i can't find the error in the log, but it happened twice)
trying to run eatdrink.ash on it's own caused a loop trying to eat a tasty tart. i had 1, it ate it fine. then failed at eating more. (couldn't attempt to recreate the bug, i'm in hardcore and only had 1)
switched back to old version and it ran smoothly
(it's incredibly possible this is somehow my fault, i am kind of half asleep)
thanks for the awesome scripts btw
mredge73
10-09-2009, 02:19 PM
EatDrink rarely works well for me, don't know why.
Here is an infinite loop from your newest version two post above:
10: thistle wine lev:10 gain:1.0 adv:3.0 musc:0.0 myst:0.0 mox:45.0 meat:500 own:0 pull:false make:false value:1950
Choosing drink to consume.
fuzzbump lev:4 gain:4.0 adv:12.0 musc:35.0 myst:0.0 mox:0.0 meat:1193 own:23 pull:false make:false value:1219
Shopping for a thistle wine in 0 seconds
budgeting 625 for 1 additional thistle wine. You have 2668939 meat. You have 0 in inventory already.
Using cached search results for thistle wine...
Purchasing thistle wine (1 @ 599)...
You acquire an item: thistle wine
Purchases complete.
Purchased 1 thistle wine for 599 meat.
Drinking 1 thistle wine...
You gain 3 Adventures
You gain 48 Chutzpah
You lose 65 hit points
You gain 1 Drunkenness
Finished drinking 1 thistle wine.
11: thistle wine lev:10 gain:1.0 adv:3.0 musc:0.0 myst:0.0 mox:45.0 meat:500 own:0 pull:false make:false value:1950
Choosing drink to consume.
fuzzbump lev:4 gain:4.0 adv:12.0 musc:35.0 myst:0.0 mox:0.0 meat:1193 own:23 pull:false make:false value:1219
Shopping for a thistle wine in 0 seconds
budgeting 625 for 1 additional thistle wine. You have 2668340 meat. You have 0 in inventory already.
Searching for "thistle wine"...
Stopped purchasing thistle wine @ 666.
Purchased 0 thistle wine for 0 meat.
Tried to get 1 thistle wine but got 0. Pricing error.
Failed to get thistle wine for a max price of 1.25*500
FAIL: thistle wine lev:10 gain:1.0 adv:3.0 musc:0.0 myst:0.0 mox:45.0 meat:500 own:0 pull:false make:false value:1950
Choosing drink to consume.
fuzzbump lev:4 gain:4.0 adv:12.0 musc:35.0 myst:0.0 mox:0.0 meat:1193 own:23 pull:false make:false value:1219
Shopping for a thistle wine in 0 seconds
budgeting 625 for 1 additional thistle wine. You have 2668340 meat. You have 0 in inventory already.
Using cached search results for thistle wine...
Stopped purchasing thistle wine @ 666.
Purchased 0 thistle wine for 0 meat.
Tried to get 1 thistle wine but got 0. Pricing error.
Failed to get thistle wine for a max price of 1.25*500
FAIL: thistle wine lev:10 gain:1.0 adv:3.0 musc:0.0 myst:0.0 mox:45.0 meat:500 own:0 pull:false make:false value:1950
Choosing drink to consume.
fuzzbump lev:4 gain:4.0 adv:12.0 musc:35.0 myst:0.0 mox:0.0 meat:1193 own:23 pull:false make:false value:1219
Shopping for a thistle wine in 0 seconds
budgeting 625 for 1 additional thistle wine. You have 2668340 meat. You have 0 in inventory already.
Using cached search results for thistle wine...
Stopped purchasing thistle wine @ 666.
Purchased 0 thistle wine for 0 meat.
Tried to get 1 thistle wine but got 0. Pricing error.
Failed to get thistle wine for a max price of 1.25*500
FAIL: thistle wine lev:10 gain:1.0 adv:3.0 musc:0.0 myst:0.0 mox:45.0 meat:500 own:0 pull:false make:false value:1950
Choosing drink to consume.
fuzzbump lev:4 gain:4.0 adv:12.0 musc:35.0 myst:0.0 mox:0.0 meat:1193 own:23 pull:false make:false value:1219
Shopping for a thistle wine in 0 seconds
budgeting 625 for 1 additional thistle wine. You have 2668340 meat. You have 0 in inventory already.
Using cached search results for thistle wine...
Stopped purchasing thistle wine @ 666.
Purchased 0 thistle wine for 0 meat.
Tried to get 1 thistle wine but got 0. Pricing error.
Failed to get thistle wine for a max price of 1.25*500
FAIL: thistle wine lev:10 gain:1.0 adv:3.0 musc:0.0 myst:0.0 mox:45.0 meat:500 own:0 pull:false make:false value:1950
Choosing drink to consume.
fuzzbump lev:4 gain:4.0 adv:12.0 musc:35.0 myst:0.0 mox:0.0 meat:1193 own:23 pull:false make:false value:1219
Shopping for a thistle wine in 0 seconds
budgeting 625 for 1 additional thistle wine. You have 2668340 meat. You have 0 in inventory already.
Using cached search results for thistle wine...
Stopped purchasing thistle wine @ 666.
Purchased 0 thistle wine for 0 meat.
Tried to get 1 thistle wine but got 0. Pricing error.
Failed to get thistle wine for a max price of 1.25*500
FAIL: thistle wine lev:10 gain:1.0 adv:3.0 musc:0.0 myst:0.0 mox:45.0 meat:500 own:0 pull:false make:false value:1950
it is choosing to drink a fuzzbump but is is searching and actually drinking thistle wine?
I ran it again afterward and it is still drinking the wrong thing:
Refreshing stash contents...
Stash list retrieved.
Internal checkpoint created.
Loading favorite consumables from user settings...
Starting EatDrink.ash (version 2.4).
Consuming up to 15 food, 19 booze, and 15 spleen
Considering food from inventory Hagnk's the mall. Per-item budget cap is 37500.0.
Price will be a factor if you own it already. Hagnk's pulls (if enabled) will cost 3000 meat each.
An adventure has the value of 500 meat. Moxie subpoint is 10. Nonprime stat subpoint is 2.
Already updated from http://zachbardon.com/mafiatools/updateprices.php?action=getmap in this session.
Already updated from http://nixietube.info/mallprices.txt in this session.
Pass 1: food.
Skipping food.
Pass 2: drink.
drink: At 11, consuming to 19.
Loading drink map from Mafia's datafiles
Filtering by type
Filtering by level
Finding prices
Setting values
Choosing drink to consume.
fuzzbump lev:4 gain:4.0 adv:12.0 musc:35.0 myst:0.0 mox:0.0 meat:1193 own:23 pull:false make:false value:1719
Creating a shot of peach schnapps in 0 seconds
Verifying ingredients for shot of peach schnapps (1)...
Purchasing fermenting powder (1 @ 70)...
You acquire an item: fermenting powder
Purchases complete.
Purchasing peach (1 @ 300)...
You acquire an item: peach
Purchases complete.
Creating shot of peach schnapps (1)...
You acquire an item: shot of peach schnapps
Successfully created shot of peach schnapps (1)
Drinking 1 shot of peach schnapps...
You gain 8 Adventures
You gain 18 Chutzpah
You gain 2 Drunkenness
Finished drinking 1 shot of peach schnapps.
1: shot of peach schnapps lev:8 gain:2.0 adv:6.0 musc:0.0 myst:0.0 mox:17.0 meat:455 own:7209 pull:false make:true value:1858
Choosing drink to consume.
fuzzbump lev:4 gain:4.0 adv:12.0 musc:35.0 myst:0.0 mox:0.0 meat:1193 own:23 pull:false make:false value:1719
Creating a shot of peach schnapps in 0 seconds
Verifying ingredients for shot of peach schnapps (1)...
Purchasing fermenting powder (1 @ 70)...
You acquire an item: fermenting powder
Purchases complete.
Purchasing peach (1 @ 300)...
You acquire an item: peach
Purchases complete.
Creating shot of peach schnapps (1)...
You acquire an item: shot of peach schnapps
Successfully created shot of peach schnapps (1)
Drinking 1 shot of peach schnapps...
You gain 5 Adventures
You gain 18 Smarm
You gain 2 Drunkenness
Finished drinking 1 shot of peach schnapps.
2: shot of peach schnapps lev:8 gain:2.0 adv:6.0 musc:0.0 myst:0.0 mox:17.0 meat:455 own:7209 pull:false make:true value:1858
The script is choosing fuzzbump but creating/drinking peach schnapps this time?
Spiny
10-09-2009, 08:44 PM
EatDrink rarely works well for me, don't know why.
Here is an infinite loop from your newest version two post above:
10: thistle wine lev:10 gain:1.0 adv:3.0 musc:0.0 myst:0.0 mox:45.0 meat:500 own:0 pull:false make:false value:1950
Choosing drink to consume.
fuzzbump lev:4 gain:4.0 adv:12.0 musc:35.0 myst:0.0 mox:0.0 meat:1193 own:23 pull:false make:false value:1219
Shopping for a thistle wine in 0 seconds
budgeting 625 for 1 additional thistle wine. You have 2668939 meat. You have 0 in inventory already.
Using cached search results for thistle wine...
Purchasing thistle wine (1 @ 599)...
You acquire an item: thistle wine
Purchases complete.
Purchased 1 thistle wine for 599 meat.
Drinking 1 thistle wine...
You gain 3 Adventures
You gain 48 Chutzpah
You lose 65 hit points
You gain 1 Drunkenness
Finished drinking 1 thistle wine.
11: thistle wine lev:10 gain:1.0 adv:3.0 musc:0.0 myst:0.0 mox:45.0 meat:500 own:0 pull:false make:false value:1950
Choosing drink to consume.
fuzzbump lev:4 gain:4.0 adv:12.0 musc:35.0 myst:0.0 mox:0.0 meat:1193 own:23 pull:false make:false value:1219
Shopping for a thistle wine in 0 seconds
budgeting 625 for 1 additional thistle wine. You have 2668340 meat. You have 0 in inventory already.
Searching for "thistle wine"...
Stopped purchasing thistle wine @ 666.
Purchased 0 thistle wine for 0 meat.
Tried to get 1 thistle wine but got 0. Pricing error.
Failed to get thistle wine for a max price of 1.25*500
FAIL: thistle wine lev:10 gain:1.0 adv:3.0 musc:0.0 myst:0.0 mox:45.0 meat:500 own:0 pull:false make:false value:1950
Choosing drink to consume.
fuzzbump lev:4 gain:4.0 adv:12.0 musc:35.0 myst:0.0 mox:0.0 meat:1193 own:23 pull:false make:false value:1219
Shopping for a thistle wine in 0 seconds
budgeting 625 for 1 additional thistle wine. You have 2668340 meat. You have 0 in inventory already.
Using cached search results for thistle wine...
Stopped purchasing thistle wine @ 666.
Purchased 0 thistle wine for 0 meat.
Tried to get 1 thistle wine but got 0. Pricing error.
Failed to get thistle wine for a max price of 1.25*500
FAIL: thistle wine lev:10 gain:1.0 adv:3.0 musc:0.0 myst:0.0 mox:45.0 meat:500 own:0 pull:false make:false value:1950
Choosing drink to consume.
fuzzbump lev:4 gain:4.0 adv:12.0 musc:35.0 myst:0.0 mox:0.0 meat:1193 own:23 pull:false make:false value:1219
Shopping for a thistle wine in 0 seconds
budgeting 625 for 1 additional thistle wine. You have 2668340 meat. You have 0 in inventory already.
Using cached search results for thistle wine...
Stopped purchasing thistle wine @ 666.
Purchased 0 thistle wine for 0 meat.
Tried to get 1 thistle wine but got 0. Pricing error.
Failed to get thistle wine for a max price of 1.25*500
FAIL: thistle wine lev:10 gain:1.0 adv:3.0 musc:0.0 myst:0.0 mox:45.0 meat:500 own:0 pull:false make:false value:1950
Choosing drink to consume.
fuzzbump lev:4 gain:4.0 adv:12.0 musc:35.0 myst:0.0 mox:0.0 meat:1193 own:23 pull:false make:false value:1219
Shopping for a thistle wine in 0 seconds
budgeting 625 for 1 additional thistle wine. You have 2668340 meat. You have 0 in inventory already.
Using cached search results for thistle wine...
Stopped purchasing thistle wine @ 666.
Purchased 0 thistle wine for 0 meat.
Tried to get 1 thistle wine but got 0. Pricing error.
Failed to get thistle wine for a max price of 1.25*500
FAIL: thistle wine lev:10 gain:1.0 adv:3.0 musc:0.0 myst:0.0 mox:45.0 meat:500 own:0 pull:false make:false value:1950
Choosing drink to consume.
fuzzbump lev:4 gain:4.0 adv:12.0 musc:35.0 myst:0.0 mox:0.0 meat:1193 own:23 pull:false make:false value:1219
Shopping for a thistle wine in 0 seconds
budgeting 625 for 1 additional thistle wine. You have 2668340 meat. You have 0 in inventory already.
Using cached search results for thistle wine...
Stopped purchasing thistle wine @ 666.
Purchased 0 thistle wine for 0 meat.
Tried to get 1 thistle wine but got 0. Pricing error.
Failed to get thistle wine for a max price of 1.25*500
FAIL: thistle wine lev:10 gain:1.0 adv:3.0 musc:0.0 myst:0.0 mox:45.0 meat:500 own:0 pull:false make:false value:1950
it is choosing to drink a fuzzbump but is is searching and actually drinking thistle wine?
I ran it again afterward and it is still drinking the wrong thing:
Refreshing stash contents...
Stash list retrieved.
Internal checkpoint created.
Loading favorite consumables from user settings...
Starting EatDrink.ash (version 2.4).
Consuming up to 15 food, 19 booze, and 15 spleen
Considering food from inventory Hagnk's the mall. Per-item budget cap is 37500.0.
Price will be a factor if you own it already. Hagnk's pulls (if enabled) will cost 3000 meat each.
An adventure has the value of 500 meat. Moxie subpoint is 10. Nonprime stat subpoint is 2.
Already updated from http://zachbardon.com/mafiatools/updateprices.php?action=getmap in this session.
Already updated from http://nixietube.info/mallprices.txt in this session.
Pass 1: food.
Skipping food.
Pass 2: drink.
drink: At 11, consuming to 19.
Loading drink map from Mafia's datafiles
Filtering by type
Filtering by level
Finding prices
Setting values
Choosing drink to consume.
fuzzbump lev:4 gain:4.0 adv:12.0 musc:35.0 myst:0.0 mox:0.0 meat:1193 own:23 pull:false make:false value:1719
Creating a shot of peach schnapps in 0 seconds
Verifying ingredients for shot of peach schnapps (1)...
Purchasing fermenting powder (1 @ 70)...
You acquire an item: fermenting powder
Purchases complete.
Purchasing peach (1 @ 300)...
You acquire an item: peach
Purchases complete.
Creating shot of peach schnapps (1)...
You acquire an item: shot of peach schnapps
Successfully created shot of peach schnapps (1)
Drinking 1 shot of peach schnapps...
You gain 8 Adventures
You gain 18 Chutzpah
You gain 2 Drunkenness
Finished drinking 1 shot of peach schnapps.
1: shot of peach schnapps lev:8 gain:2.0 adv:6.0 musc:0.0 myst:0.0 mox:17.0 meat:455 own:7209 pull:false make:true value:1858
Choosing drink to consume.
fuzzbump lev:4 gain:4.0 adv:12.0 musc:35.0 myst:0.0 mox:0.0 meat:1193 own:23 pull:false make:false value:1719
Creating a shot of peach schnapps in 0 seconds
Verifying ingredients for shot of peach schnapps (1)...
Purchasing fermenting powder (1 @ 70)...
You acquire an item: fermenting powder
Purchases complete.
Purchasing peach (1 @ 300)...
You acquire an item: peach
Purchases complete.
Creating shot of peach schnapps (1)...
You acquire an item: shot of peach schnapps
Successfully created shot of peach schnapps (1)
Drinking 1 shot of peach schnapps...
You gain 5 Adventures
You gain 18 Smarm
You gain 2 Drunkenness
Finished drinking 1 shot of peach schnapps.
2: shot of peach schnapps lev:8 gain:2.0 adv:6.0 musc:0.0 myst:0.0 mox:17.0 meat:455 own:7209 pull:false make:true value:1858
The script is choosing fuzzbump but creating/drinking peach schnapps this time?
I haven't tried the latest version yet, but to me it looks like it's choosing peach schnapps (as that is the drink name next to the 1: and 2:. Fuzzbump is possibly something your favorites list of drinks to check for? The earlier loop looks like you were budgeting less than the cost of the item and perhaps the script isn't handling that well right now. Generally, when I used to run it, it would choose 19 thistle wines as a moxie class unless I changed the stat weight values and adventure values. I never ran EatDrink.ash except to simulate. I don't know how the outcome would be if it was run to purchase rather than simulate.
The fuzzbump is a default favorite. I strongly recommend setting the flag that skips favorites if you're not using them, as it speeds things up and cleans up the printout quite a bit. And due to a very small bug, the text "This is your favorite: " wasn't printed out.
So basically, it was acting as expected.
But I can't reproduce the infinite loop with unpurchasable items, so I added some more diagnostic print()s around it. Have at it (again).
Also fixed a mojo filter bug.
NastyPeasant
10-10-2009, 08:53 AM
Overhauled version! Half as big, faster, better, etc. Try it out and let me know how it works.
Still getting infinite loop on green beer.
Attempting to consume...
green beer lev:1 gain:1.0 adv:2.0 musc:0.0 myst:0.0 mox:0.0 meat:0 own:4 pull:false make:true value:200
Countdown: 3 seconds...
Countdown: 2 seconds...
Countdown: 1 second...
Waiting completed.
Creating a green beer in 3 seconds
Countdown: 3 seconds...
Countdown: 2 seconds...
Countdown: 1 second...
Waiting completed.
Verifying ingredients for green beer (1)...
Creating green beer (1)...
Creation failed, no results detected.
FAIL: green beer lev:1 gain:1.0 adv:2.0 musc:0.0 myst:0.0 mox:0.0 meat:0 own:4 pull:false make:true value:200
Choosing drink to consume.
Attempting to consume...
green beer lev:1 gain:1.0 adv:2.0 musc:0.0 myst:0.0 mox:0.0 meat:0 own:4 pull:false make:true value:200
Countdown: 3 seconds...
Countdown: 2 seconds...
Countdown: 1 second...
Waiting completed.
Creating a green beer in 3 seconds
Countdown: 3 seconds...
Countdown: 2 seconds...
Countdown: 1 second...
Waiting completed.
Verifying ingredients for green beer (1)...
Creating green beer (1)...
Creation failed, no results detected.
FAIL: green beer lev:1 gain:1.0 adv:2.0 musc:0.0 myst:0.0 mox:0.0 meat:0 own:4 pull:false make:true value:200
Choosing drink to consume.
Attempting to consume...
green beer lev:1 gain:1.0 adv:2.0 musc:0.0 myst:0.0 mox:0.0 meat:0 own:4 pull:false make:true value:200
Countdown: 3 seconds...
Countdown: 2 seconds...
Countdown: 1 second...
Waiting completed.
Creating a green beer in 3 seconds
Countdown: 3 seconds...
Countdown: 2 seconds...
Countdown: 1 second...
Waiting completed.
Verifying ingredients for green beer (1)...
Creating green beer (1)...
Creation failed, no results detected.
FAIL: green beer lev:1 gain:1.0 adv:2.0 musc:0.0 myst:0.0 mox:0.0 meat:0 own:4 pull:false make:true value:200
Choosing drink to consume.
Attempting to consume...
green beer lev:1 gain:1.0 adv:2.0 musc:0.0 myst:0.0 mox:0.0 meat:0 own:4 pull:false make:true value:200
Countdown: 3 seconds...
...
Much faster loop though.
Spiny
10-10-2009, 09:01 AM
Still getting infinite loop on green beer.
Why is it looking for green beer? It's 1 drunk, 1-3 advs, no stats... it's just plain crappy booze. What weights did you put on your stats/adv value? Or are you in HC with no mall access? I'm just baffled. Is this script even semi-functional without mall access?
Much faster loop though.
Sorry, this made me LOL.
It should be completely functional in ronin, HC, etc. I did a whole oxycore run using it (obviously for spleenables :) ), and I've done regular HC runs with it too. I use it for everything.
I attached a version that should stop trying to make/pull something if you fail once, which ought to fix the loop.
As to why it's choosing green beer, I can't speak to that without seeing the "setup" text at the start (which discloses all the important settings, if you're in ronin, etc).
New version with two new major improvements. First, it uses floats instead of ints internally, since there's now a profile command (thanks JH) so I can fine tune performance. This will make a small but real improvement in your recommendations.
Second, it now supports The Chocolate Family: fancy chocolates, fancy but probably evil chocolates, and vitochoconutriment capsules. They tend to only be cost effective if you're fairly rich, so to see them, try simulating with the value-of-adventure set to 10,000.
ed: updated post with the right file.
fuzzyevil
10-11-2009, 05:01 AM
Does this script support the cellar wines? I've never had it recommend them, and it's what I was drinking before I installed this script.
Does now.
Also, upload to the very latest build, and eatdrink is one hebillion times faster.
(ed: minor fix that only affects when you are simulating a session of overdrink-only)
codster62
10-11-2009, 11:18 PM
I tried both my .exe and .jar builds with your new update of eatdrink.ash, and we have a problem. Here it is.
Undefined reference to function 'EatDrink' (Ascend.ash, line 62)
I used it on the latest build, and the latest .exe version, so it must be a script error. Maybe something you did?
Grotfang
10-11-2009, 11:29 PM
It looks like you have capitalized the function on that line. Don't.
Ascend.ash imports EatDrink.ash, which has within it a function called eatdrink(). In older versions of Ascend.ash (and still present in farm.ash) the import was made lower case, which screwed up linux systems. The fix is to rename the import eatdrink.ash to import EatDrink.ash.
However, the function "eatdrink()" in EatDrink.ash is still lowercase. For some reason you seem to have capitalized every occurrence of the work "eatdrink". Don't.
codster62
10-11-2009, 11:51 PM
It's not me that's the problem. I just downloaded the older version of the script and it works fine on both the .jar version, and the .exe. The newest one on the last page of this thread, however, does not work. It has to be something you did with the update of the script, dj_d. Nobody else has reported this yet, but it has to be something wrong with the update if the old version still works for me.
Grotfang
10-12-2009, 12:14 AM
Solved it. The version posted on this page is missing a condition in it's longest form of the eatdrink function:
boolean autospadeconsumables_p,
The code for that function should look like this:
void eatdrink (int foodMax, int drinkMax, int spleenMax, boolean overdrink,
boolean use_inv_p, boolean use_closet_p, boolean use_storage_p,
boolean sim_consume_p, boolean supress_overdrink_p,
boolean shop_p, int budget_p, float price_flexibility_p,
boolean consider_cost_when_owned_p, int cost_of_pull_p,
boolean autospadeconsumables_p, int value_of_adventure_p,
int value_of_prime_stat_p, int value_of_nonprime_stat_p,
boolean pie_priority_p, int price_of_nontradeables_p,
int price_of_unknowns_p, boolean sim_ronin_p, int sim_level_p)
Actually, that's deliberate. Support for autospadeconsumables (which has always been broken) was removed. It does mean you'll need to change the invoking functions in farm.ash and ascend.ash, or make the change suggested above, until I release a new version of ascend.zip with new versions of everything. (which will happen just as soon as I get some feedback on this version of eatdrink)
codster62
10-12-2009, 01:34 AM
So, what do I need to do? I don't quite understand. Do I need to replace the spader code with what Grotfang's 7 or 8 lines of code, or place that after the spader thing, or just remove the spader line completely? Once, I get it working, I will give some feedback!
It'll work fine if you run it directly. It's only an issue if you call it from farm.ash or another script.
Spiny
10-12-2009, 10:11 AM
omg lol... turns out the version I ran sim'd was the one in post 211, not 213 (which I pulled earlier today). The version in 213 was uploaded in super verbose mode and when I ran it and saw my screen full of stuff I thought OMG mafia's gonna explose lmao! I'd never tried it in super verbose mode before lol
codster62
10-12-2009, 09:19 PM
Yep, exactly. And farm.ash and ascend.ash won't run with the update, so I will just run it directly and give some results of how it works.
EDIT: Ok, I am currently running the script. Good so far, and no error's. I'd say it's running calculations 75% faster. When the script was started 5 popup windows came up asking me:
1: FoodMax - I chose 15
2: DrinkMax - I chose 19
3: SpleenMax - I chose 15
4: Overdrink - False
5: Simulate or something like that - False
Apparently, it found I had no keys in my inventory, so it ate the pies accordingly. I started with 95 adventures, and after it was finished, I had 242 and around 30k spent(Most meat spent on pies). Excellent speeds on my pentium 4 computer. Keep up the good work...
Thanks,
Cody
Whoops! Forgot to kill the verbose2 line. :) Glad it's working for you.
tgetgel
10-14-2009, 06:41 PM
A great script! (Sorry for the long post.)
I think I might be missing something. EatDrink (v2.4 using Mafia v13.6) tried to pull from stash to create a drink, but the pull failed. The ingredient was in the stash but I did not have enough karma to make the pull. (Yeah, I know - donate to the clan stash and this is not an issue. What if I were not in a clan?)
The session log snippet is as follows:
remove from stash: 1 fermenting powder
FAIL: shot of blackberry schnapps lev:3 gain:1.0 adv:3.0 musc:6.0 myst:6.0 moxie:6.0 price:265 own:24 pull:false make:true value:2177
Calculating drink values.
Choosing drink to consume.
Attempting to consume...
Creating a shot of blackberry schnapps in 1 seconds
repeat - over and over and over
With the following settings, I assumed that the logic would do the following:
verify that I had access to all of the ingredients (if not, try next item),
would pull what was needed,
would verify that all of the ingredients were in inventory (pull successful),
then create the item and consume it.
Contrariwise, if the pull was unsuccessful (did not really have all of the ingredients):
would calculate the value of buying the missing ingredients against buying something else to eat/drink,
and do the appropriate thing.
// If true, you will buy food to consume that is not in inventory.
setvar("eatdrink_shop", true);
boolean SHOP = to_boolean(vars["eatdrink_shop"]);
// If true, you will make food if you have all the ingredients available.
setvar("eatdrink_make", true);
boolean MAKE = to_boolean(vars["eatdrink_make"]);
I can see five approaches:
set make to false
(easiest but not most cost effective)
donate to a clan
(lower middle - manually decide what to donate to get right karma level)
add a check for successful pull
(complicated - one chance or try next item - maybe like checking for all ingredients)
donate to a clan
(more complicated - automagically decide what to donate to get right karma level)
Decide whether to buy ingredients or move on
(most complicated - is it better to buy ingredient and make or buy something else)
CLI scripting I get. ASH I am still trying to understand. I guess that comes from programming in assembler instead of higher level languages -
Like BASIC.:rolleyes:
I have no idea what code in there would possibly pull from clan stash. I wonder if it's an untended consequence of an ASH acquire (or derivative) function? It was not designed to consider the clan stash at all.
asturia
10-15-2009, 09:13 AM
Okay, bug report here.
I have over 1004 twinkly wads in my inventory, but the script wants to consume hot wads instead (which have to be bought).
I've added my session log.
Simulating only; no purchases or food/drink/spleen consumption.
food: At 0, consuming to 15.
0: milk of magnesium price: 845 value: 23905
1: Knob sausage chow mein lev:7 gain:5.0 adv:25.0 musc:74.0 myst:0.0 mox:0.0 meat:4200 own:0 value:4308
2: Knob sausage chow mein lev:7 gain:5.0 adv:25.0 musc:74.0 myst:0.0 mox:0.0 meat:4200 own:0 value:5108
3: Knob sausage chow mein lev:7 gain:5.0 adv:25.0 musc:74.0 myst:0.0 mox:0.0 meat:4200 own:0 value:5108
drink: At 0, consuming to 19.
1: grogtini lev:6 gain:6.0 adv:24.0 musc:18.0 myst:0.0 mox:0.0 meat:2118 own:0 value:4343
2: grogtini lev:6 gain:6.0 adv:24.0 musc:18.0 myst:0.0 mox:0.0 meat:2118 own:0 value:4343
3: grogtini lev:6 gain:6.0 adv:24.0 musc:18.0 myst:0.0 mox:0.0 meat:2118 own:0 value:4343
4: cup of primitive beer lev:12 gain:1.0 adv:3.5 musc:57.5 myst:0.0 mox:0.0 meat:990 own:0 value:4085
spleen: At 0, consuming to 15.
1: hot wad lev:6 gain:1.0 adv:1.0 musc:27.0 myst:9.0 mox:18.0 meat:405 own:0 value:919
2: hot wad lev:6 gain:1.0 adv:1.0 musc:27.0 myst:9.0 mox:18.0 meat:405 own:0 value:919
3: hot wad lev:6 gain:1.0 adv:1.0 musc:27.0 myst:9.0 mox:18.0 meat:405 own:0 value:919
4: hot wad lev:6 gain:1.0 adv:1.0 musc:27.0 myst:9.0 mox:18.0 meat:405 own:0 value:919
5: hot wad lev:6 gain:1.0 adv:1.0 musc:27.0 myst:9.0 mox:18.0 meat:405 own:0 value:919
6: hot wad lev:6 gain:1.0 adv:1.0 musc:27.0 myst:9.0 mox:18.0 meat:405 own:0 value:919
7: hot wad lev:6 gain:1.0 adv:1.0 musc:27.0 myst:9.0 mox:18.0 meat:405 own:0 value:919
8: hot wad lev:6 gain:1.0 adv:1.0 musc:27.0 myst:9.0 mox:18.0 meat:405 own:0 value:919
9: hot wad lev:6 gain:1.0 adv:1.0 musc:27.0 myst:9.0 mox:18.0 meat:405 own:0 value:919
10: hot wad lev:6 gain:1.0 adv:1.0 musc:27.0 myst:9.0 mox:18.0 meat:405 own:0 value:919
11: hot wad lev:6 gain:1.0 adv:1.0 musc:27.0 myst:9.0 mox:18.0 meat:405 own:0 value:919
12: hot wad lev:6 gain:1.0 adv:1.0 musc:27.0 myst:9.0 mox:18.0 meat:405 own:0 value:919
13: hot wad lev:6 gain:1.0 adv:1.0 musc:27.0 myst:9.0 mox:18.0 meat:405 own:0 value:919
14: hot wad lev:6 gain:1.0 adv:1.0 musc:27.0 myst:9.0 mox:18.0 meat:405 own:0 value:919
15: hot wad lev:6 gain:1.0 adv:1.0 musc:27.0 myst:9.0 mox:18.0 meat:405 own:0 value:919
Spiny
10-15-2009, 09:46 AM
Hot wads have better muscle gains than twinkly wads do. Your configuration is based on muscle being valued at a weight of 10 and substats weighted at only 2. Hot wads fall under your per item budget. I believe the script did what it was programmed to do. If you were expecting twinkly wads, perhaps you need to tweak your adventure value and/or stat weights? I've only simmed the script myself and hesitate to run it live because there is no total budget and I'd like to say spend up to x amount per item, but don't spend more than y total. The only way I can accomplish that seems to be messing with the adventure cost.
tgetgel
10-15-2009, 02:23 PM
I have no idea what code in there would possibly pull from clan stash. I wonder if it's an untended consequence of an ASH acquire (or derivative) function? It was not designed to consider the clan stash at all.
I found it - I think. Someone knowing the inner workings of Mafia will need to chime in.
Under the General Preferences, there are options to
"Buy items from NPC stores whenever needed", (not checked)
"Buy items from the mall whenever needed", (not checked)
and "Take items from the clan stash whenever needed". (checked):eek:
So the question is, how do the Mafia Preferences effect the logic and performance of the ASH script?
That FN Ninja
10-16-2009, 01:25 AM
While calling eatdrink from a script I saw something that I can't figure out. I called eatdrink with the following code:
cli_execute("zlib eatdrink_budget = 5000");
eatdrink(fullness_limit(),inebriety_limit(),spleen _limit(),true,50,25,5,1000,false);
Here's the cli output:
Previous value of eatdrink_budget: 20000
Changed to 5000.
Checking for updates (running EatDrink ver. 2.4)...
_version_eatdrink => 2.4
Refreshing stash contents...
Stash list retrieved.
Internal checkpoint created.
Starting EatDrink.ash (version 2.4).
Consuming up to -3 food, 0 booze, and 20 spleen
Considering food from inventory Hagnk's . Per-item budget cap is 25000.0.
It didn't take into account the change in the budget from 20k to 5k? I checked the vars.txt and the variable was properly set to 5000.
Asturia - it sounds like you don't want the script to consider the cost of items you have in inventory. If so, there's a flag setting just for that. Otherwise, eatdrink gave you exactly what you asked for - the optimal spleenable given the values you attached to adventures and stats, and the current mall cost.
Banana Lord
10-17-2009, 04:30 AM
What's the point of the pause between consuming items?
It's optional. If you see the script about to do something you don't like you can interrupt it. Just change the setting to 0 to avoid.
deathprog23
10-17-2009, 08:13 AM
First - thanks for this great script!
I was a little confused by some of its choices, until I realised that it has different values of average adventures to the wiki - in this example the wiki says pr0n chow mein has 19.5 average and olive lo mein 12.5.
Which is correct?
----------------------------
Attempting to consume...
Knob sausage chow mein lev:7 gain:5.0 adv:25.0 musc:74.0 myst:0.0 moxie:0.0 price:4250 own:0 pull:false make:false value:4150
simulating consumption of one Knob sausage chow mein.
0: milk of magnesium price: 855 value: 23895
1: Knob sausage chow mein lev:7 gain:5.0 adv:25.0 musc:74.0 myst:0.0 moxie:0.0 price:4250 own:0 pull:false make:false value:4150
Choosing food to consume.
If there are any favorites still in consideration, they'll be listed here:
Hell ramen lev:6 gain:6.0 adv:25.0 musc:25.0 myst:25.0 moxie:25.0 price:3195 own:0 pull:false make:false value:3634
olive lo mein lev:6 gain:3.0 adv:12.0 musc:12.0 myst:0.0 moxie:12.0 price:1400 own:1 pull:false make:false value:3534
pr0n chow mein lev:7 gain:4.0 adv:19.0 musc:23.0 myst:0.0 moxie:23.0 price:3365 own:3 pull:false make:false value:3909
That FN Ninja
10-17-2009, 07:53 PM
As of late eatdrink has been breaking/looping during spleen consumption about every other use. I normally just abort and then run it again and all is well, but every time I run it right now it just loops during spleening. The cli repeats this:
Starting EatDrink.ash (version 2.4).
Consuming up to 12 food, 19 booze, and 15 spleen
Considering food from the mall. Per-item budget cap is 6250.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 50 meat. Moxie subpoint is 25.0. Nonprime stat subpoint is 5.0.
spleen: At 2, consuming to 15.
(usable quantity of blue polka-dot oyster egg is limited to 0 by needed restoration or spleen)
FAIL: blue polka-dot oyster egg lev:1 gain:1.0 adv:0.0 musc:0.0 myst:0.0 mox:13.0 meat:100 own:0 value:30
(usable quantity of blue polka-dot oyster egg is limited to 0 by needed restoration or spleen)
FAIL: blue polka-dot oyster egg lev:1 gain:1.0 adv:0.0 musc:0.0 myst:0.0 mox:13.0 meat:100 own:0 value:30
(usable quantity of blue polka-dot oyster egg is limited to 0 by needed restoration or spleen)
FAIL: blue polka-dot oyster egg lev:1 gain:1.0 adv:0.0 musc:0.0 myst:0.0 mox:13.0 meat:100 own:0 value:30
I opened eatdrink up in an editor to check things out, but I couldn't figure out why the spleening section keeps breaking? This is on a level 11 character. If I remember correctly when it goes into an infinite loop it's usually trying to get one of the various oyster eggs. I don't know if that's relevant, but I'll start keeping better documentation when it loops to shed more light on the situation. As for now though, I can't even use it because of it going into the aforementioned loop every time I run it.
http://kol.coldfront.net/thekolwiki/index.php/Chow_mein
pr0n chow mein: 16-24
Where do you get 12.5?
Heffed
10-17-2009, 08:55 PM
That would be the olive lo mein.
Spiny
10-17-2009, 09:00 PM
http://kol.coldfront.net/thekolwiki/index.php/Chow_mein
pr0n chow mein: 16-24
Where do you get 12.5?
I think the issue was the wiki states pr0n chow mein at 19.5 adv/full. Your script states 19.
The wiki has Olive lo mein at 12.5, your script states 12.
This was concerning deathprog23 I guess.
Veracity
10-17-2009, 09:31 PM
If you look at the page for pr0n chow mein, it says 16-23 - which is the range KoLmafia uses, too, since it is right from the Well-Tempered Epicure. That is an average of 19.5 adventures per 4-fullness dish.
Error in the wiki - if you look at the page I linked to, it's 16-24. It's not editable, though, so I can't fix it on the wiki. I'll take a look at the code.
deathprog23
10-18-2009, 04:19 PM
16-24 would have an average yield of 20 adventures. Seems to be fixed now anyway.
I was using http://kol.coldfront.net/thekolwiki/index.php/Best_Foods_%28adventures%29
and the with 'got milk' page.
There's your problem. The script output clearly says that the numbers given assume no milk.
driedsponge
10-19-2009, 02:22 PM
I'm not really sure if I have something wrong (probably) or am missing some key piece of information (also probably), but I have been trying to figure out the optimum diet thing for a while now, and started comparing the different sources for optimum diet plans. I've discovered what appears to be a discrepancy that I'm struggling to qualify.
I've been using this site for a while now to figure out the optimal diet:
http://www.houeland.com/kol/diets
The lists seem pretty good except it assumes you buy everything from the mall, so it never takes into account inventory and crafting abilities. I can usually eat/drink to full at a fraction of the cost that it recommends.
I started using this script to see if the results were pretty close, but it seems like the results from this script are WAY off from the table on the website. Normally, I would say this is expected, but the problem is that it's off in the wrong direction.
For instance:
From the website
I check Ode + Tuxedo Suite, Liver of Steel, No Semi-Rares, Maximize for Adventures
If I assume a profit of 500 mpa, I go down the list, and it says that I will earn 188.1 turns, and spend 13k meat doing it. The food/drink/spleen list comes back with:
1x milk of magnesium [889 meat]
3x spooky lo mein [1483.7 meat]
1x pear tart [445 meat]
9x dusty bottle of {fantastic wine} [200 meat]
1x shot of blackberry schnapps [265 meat]
1x rockin' wagon [1595 meat]
15x twinkly wad [238 meat]
Now, with the script, I would assume that I would get the same or more turns, for the same or less spent trying to create all this stuff.
15 int foodMax
19 int drinkMax
15 intSpleenMax
The food list changes, but the booze/spleen list seems to be similar:
1x milk of magnesium
3x Boris' Key Lime Pie
1x Pear Tart
9x Dusty Bottle of Zinfandel
1x Cruelty-free Wine
15x Twinkly Wad
1x Horizontal Tango
Spent 31046 meat. Gained Fullness: 15. Inebriety: 23. Spleen: 15. Adventures: 182. Muscle: 333. Moxie: 243. Mysticality: 325.
Now, this script is supposed to take inventory into account, yet it claims I'll need to spend 31k to get 6 less adventures.
The strange part, to me, is that I know that i can craft (or even buy every item from the mall) on that list, and it won't add up to 31k meat. In fact, if I buy every ingredient on that list and craft everything, it only works out to 9,730 meat for the entire list. What's more, is that I have most of the ingredients in inventory already, so I wouldn't even have to purchase most of it, bringing the cost down even more.
I figure it's using the mall price for key lime pies, which is alright, but the spooky lo mein is also in the mall, and is about 1/4 the cost, for more adventures per fullness, which means it should be giving me that instead of the key-lime pies, anyway.
I apologize if I am totally missing the point of this script, or what it's supposed to do, but I just want to try and understand the differences, and weather or not it's truly giving out the best meal-plan.
deathprog23
10-20-2009, 06:18 AM
Found the bug: Line 298 uses integer division. It should be:
{ return ((statrange.max + statrange.min) /2.0); }
I think!
Also, elven moonshine is incorrectly listed in eatdrink_drink_data.txt as having max adventures 15 and min 6 (should be 10-7). Is there some way of automatically checking those numbers for the whole list? My eatdrink_drink_data.txt doesn't seem to have the fantastic bottle of dusty wine data either.
Thanks again for your work!
Edit: a couple of other finds
lines 213-217 should consider if you're already wearing the shirt:
boolean tuxworthy(item it)
{
return (tuxable contains it) && (have_item($item[tuxedo shirt]) > 0) &&
can_equip($item[tuxedo shirt]);
}
Also, lines 989-990 should be
if (tuxworthy(it))
advscore = advscore + (2 * VALUE_OF_ADVENTURE / full);
although I don't yet know how to avoid that integer division (which is more important e.g. on line 997: costscore = con.price / full; ). Using to_float(full) doesn't seem to work... also, the tux adventures are missed off the final summary (in simulation mode).
edit 2: ah, that's because advscore and costscore are ints. Perhaps the arithmetic should be done with floats before converting for an integer final value, if that's what's desired?
edit 3: Ok, so I realised there's a new beta version which uses floating arithmetic already. It seems great - awesome and thanks! Sorry for being a pain. The tuxedo alterations from the above still need to be incorporated though.
Good call on the tuxworthy fixes! Next version I post will have that. And yes, I converted everything to floats already (once I had JH's profiler to show that it wouldn't nuke performance).
natnit
10-21-2009, 09:03 AM
Amazing script, dj_d. The few times I've run this directly from the CLI, it has worked with flying colors. Thanks again!
I have a problem though. :( I'm trying to write a script that automates some amount of eating and leaving room for fortune cookies. First, I call a sim version of your script, to see how many adventures I will get from food. Then, based on that, I eat to the appropriate amount of fullness.
int do_food() {
int turns_til_sr, cookies_to_eat, food_adv;
if (get_counters("Fortune Cookie", 0, 200) == "") {
eat(1, $item[fortune cookie]);
}
turns_til_sr = nextSR() - my_turncount();
food_adv = eatdrink(fullness_limit() - my_fullness() - 2,0,0,false,adv_val,0,0,0,true);
cookies_to_eat = max(0,ceil((to_float(my_adventures()) + to_float(food_adv) - to_float(turns_til_sr))/180.0));
eatdrink(fullness_limit() - my_fullness() - cookies_to_eat,0,0,false,adv_val,0,0,0,false);
}
Oh, I also modified EatDrink to return an int of how many adventures it predicts I will get.
The output of the first (simulated) EatDrink is fine, but the second one returns no data, whether it is in sim mode or not. Here is sample output from the second one:
Internal checkpoint created.
Already updated from http://zachbardon.com/mafiatools/updateprices.php?action=getmap in this session.
Already updated from http://nixietube.info/mallprices.txt in this session.
Refreshing stash contents...
Stash list retrieved.
Starting EatDrink.ash (version 2.4).
Consuming up to 12 food, 0 booze, and 0 spleen as if you were level 30.
Considering food from inventory Hagnk's the mall. Per-item budget cap is 62500.0.
Price will be a factor if you own it already. Hagnk's pulls (if enabled) will cost 0 meat each.
An adventure has the value of 1100 meat. Moxie subpoint is 0. Nonprime stat subpoint is 0.
Loading food records.
Now at fullness of 1, eating to 12.
filtering food based on level & availability
calculating food values
Writing out new food file
Finished.
Spent 0 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...
******************************************
Starting EatDrink.ash (version 2.4).
Consuming up to 12 food, 0 booze, and 0 spleen as if you were level 30.
Considering food from inventory Hagnk's the mall. Per-item budget cap is 62500.0.
Price will be a factor if you own it already. Hagnk's pulls (if enabled) will cost 0 meat each.
An adventure has the value of 1100 meat. Moxie subpoint is 0. Nonprime stat subpoint is 0.
Now at fullness of 1, eating to 12.
Finished.
Spent 0 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).
Again, thanks for the amazing script, and any help you can provide. :)
Edit: Looks like it was my own fault. :) I'm guessing it has to do with the fact that I set the booze and spleen limit to 0, rather than inebriety_limit() and spleen_limit(). In my head, it was "how much more booze and spleen" do you want. I think this is causing the hang up, but I can't try until rollover.
Edit edit: Still not working, no matter what I try. Anyone have an idea what's wrong? Thanks.
tgetgel
10-21-2009, 10:06 PM
Great script!:D
I was looking at the session log and have a question/observation.
(Mafia v 7754.jar, EatDrink.ash v2.4, both verbosity print lines commented out)
The log contains the following:
> Now at fullness of 0, eating to 15.
> <b>Boris's key lime pie</b> lev:6 gain:4.0 adv:16.0 musc:30.0 myst:0.0 moxie:0.0 price:8600 own:2 pull:false make:false value:-113
> <b>Brimstone Chicken Sandwich</b> lev:1 gain:3.0 adv:5.0 musc:7.0 myst:0.0 moxie:17.0 price:200 own:0 pull:false make:false value:784
...followed by a few more lines (280) of other edible items.
The "Now at fullness of" is at line 1393
verbose("Loading food records.");
summarize("Now at fullness of "+get_fullness()+", eating to "+foodMax+".");
I do not know which line of code causes the food items to be listed in the log. They are not shown in the CLI.
Upon the first consumption, the following lines are logged:
eat 1 spooky lo mein
You gain 23 Adventures
You gain 34 Sarcasm
> 1: <b>spooky lo mein</b> lev:6 gain:4.0 adv:18.0 musc:0.0 myst:0.0 moxie:33.0 price:1665 own:0 pull:false make:false value:1842
> FAIL: <b>spooky lo mein</b> lev:6 gain:4.0 adv:18.0 musc:0.0 myst:0.0 moxie:33.0 price:1665 own:0 pull:false make:false value:1842
> <b>Boris's key lime pie</b> lev:6 gain:4.0 adv:16.0 musc:30.0 myst:0.0 moxie:0.0 price:8600 own:2 pull:false make:false value:-113
> <b>Brimstone Chicken Sandwich</b> lev:1 gain:3.0 adv:5.0 musc:7.0 myst:0.0 moxie:17.0 price:200 own:0 pull:false make:false value:784
...followed again by a few more lines (280) of other edible items that do not show in the CLI.
The "FAIL" is from line 1487/8
print_html("FAIL: "+consume_entry);
logprint("FAIL: "+consume_entry);
Drink lines at 1505/6. Spleen lines at 1545/6.
So, a few questions.
1. Why does it say FAIL when it actually consumed the item? What does this FAIL mean?
2. Is there a reason that the log lists the food file again upon each consumption? (does the same for drink and spleen)
3. Can the listing of the consumable items in the session log be covered by one of the verbose options?
I am going to run this again after rollover with both verbose print lines active to see the program flow.
lostcalpolydude
10-22-2009, 03:23 AM
I decided to try out this script to see how it worked. The instructions still say to put the data files in your scripts folder when they actually need to be in the data folder. I also had to track down zlib after this script told me it was needed; not hard, but the directions only mention it in passing.
houeland
10-22-2009, 10:48 AM
http://www.houeland.com/kol/diets is optimal and cannot be beaten as long as the assumptions hold (in aftercore, high enough level/hp to use things, liquid market, same linear utility function, correct market and spading data). It doesn't take any shortcuts or liberties. If you can e.g. make hell ramen cheaply, you should sell it or the components in the mall and use the meat to buy something better to eat, not eat the hell ramen.
The version of this script listed in the first post can be used just fine (~85% of optimal) as an eating/drinking script, but as someone else already pointed out it's really bad as an optimizer. Hopefully the beta version and such is better, but the greedy approach used can't guarantee optimal results even if the bugs are weeded out. It'll probably be much much closer and much better for everyone using it though, so good luck with the fixes =)
http://www.houeland.com/kol/diets is optimal and cannot be beaten as long as the assumptions hold...
...the greedy approach used [by eatdrink.ash] can't guarantee optimal results even if the bugs are weeded out.
So my thought is, what are the chances of someone creating a script that parses the public houeland data and automatically executes it? In some sense, it seems like eatdrink.ash is performing a lot of computation that has already been pre-computed by houeland.
[Note: you can't in all cases just go straight down the houeland list and perform each eat/drink in order; some of the more expensive diets rely on (for example) eating something, then drinking something that reduces fullness, then eating more, etc. The houeland list doesn't give that sequential order so the user has to figure it out from the total consumables given.]
Note 2: houeland can't help you in HC (or, I guess, SC ronin) so there is definitely still a place for the compute-on-the-fly approach.
-That's what TH3Y wonder
deathprog23
10-22-2009, 04:07 PM
Ok, I had a go at changing a few more things, so that milk of magnesium is better accounted for.
As for houeland being more optimal, I have to agree since this uses a few heuristics and so on. But this is far more flexible, hence trying to bugfix and get it closer to optimal. Moreover, since we know that adventure gains aren't (typically) evenly distributed over the wiki ranges, no tool is perfect.
Things I have changed are:
line 240 simadventures is now a float, not int.
Therefore line 330 returns to_int(simadventures) now.
line 391 features a better milk_adjust calculation.
That requires the calls on lines 983 and 1363 to have a different argument.
line 1317 now returns false if milk is consumed at that stage, so that grub values can be recalculated with milk in effect.
So, line 1592 now does that recalculation, if consumeone returns false.
My current version is attached. I'm going to work on doing the same for ode and tux next...
Powered by vBulletin® Version 4.1.12 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.