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

Some parts of it are using mall_price(item) directly, others use effective_price(grub). I'll maybe add an effective_price(item) that just does a mini-version of the effective_price processing, using historical_price if possible. We still want to use mall_price for any actual purchase, as this means our buy-price gets updated as cheapest changes. I'll tweak this up and upload a new less-chatty version after I get to test it.

The part that takes longer is parsing for creatable_amount. We need to know how much is still creatable considering how much we're already using. That should speed up some as well once we get a new effective_price function, but yes... it'll still be a bit slower. We may be able to speed it up some if creatable_amount properly uses mafia preferences to decide if mall ingredients are allowed... but the actual considering if it's still possible after will be later.
 
I'll try #899 after rollover since I burned today's turns.

I don't really care why but the beta versions with speculation do take more time than the official version. Admittedly we are talking about seconds but it is noticeable. This is an observation and not a suggestion that something be done.

The reason I complained about the time is because the last beta I tried spent about five minutes looping that bit about being too fattening before I hit escape and reverted to the official version. I'll try the newest beta and see if it performs correctly for me.
 
899 broke when attempting to eat. It decided that 3 grue egg omelets was the perfect dietary choice. If grue eggs were available in the mall or I had three grue eggs in inventory I would agree.

Code:
Favorite pr0n chow mein is too fattening (4.0)- removing from consideration.
Favorite pr0n chow mein is too fattening (4.0)- removing from consideration.
Since 89 is more than 87 we are using the speculative stack.
Favorite pr0n chow mein is too fattening (4.0)- removing from consideration.
Favorite pr0n chow mein is too fattening (4.0)- removing from consideration.
Favorite pr0n chow mein is too fattening (4.0)- removing from consideration.
Favorite pr0n chow mein is too fattening (4.0)- removing from consideration.
Getting 3 grue egg omelette in 0 seconds
autoBuyPriceLimit => 0.0
Verifying ingredients for grue egg omelette (3)...
You need 3 more grue egg to continue.
autoBuyPriceLimit => 20000
EatDrink encountered an error: You don't have 3 grue egg omelette and it has a null price, so you can't buy it.
Something went wrong with getting grue egg omelette for 0. Recalculating.
Pass 1: food.
food: At 0, consuming to 15.

At this point it simply stopped working.

Edit: No apparently it only looked like it had stopped working. I wish it had because when it started back up it decided to spend about 40K making spectral pickles. I understand wanting the program to give more adventures but it's supposed to take my VoA of 850 and make the most of it, which 40K on spectral pickles does not do.

Edit 2: Started with about 127,000 meat. Ended with 3,830 with 335 adventures. With the official version I always get a similar (perhaps slightly lower) number of adventures at a cost of 30-50K.
 
Last edited:
Gah... well, the new version I'm working on should be less bad.

Part of your problem is that your autoBuyPriceLimit is 20k, and since we're bringing this closer to Mafia's actual preferences, that's the highest cost for acquisition allowed for a single item without your permission. I've set mine to 5k at the moment, but for a 'normal' time, you could even set it lower... 3k or so. That's up to you though, how much you're willing to pay.

When done, I'll be trying to be comparing eatdrink_budget better than it currently does. Might end up doing something like forcing get_meat() to have budget as its max, and work down from there... but we'll see.

Your immediate fix is dropping the autoBuy value to what you'd actually like as individual price/ingredient limit.
 
Edit 2: Started with about 127,000 meat. Ended with 3,830 with 335 adventures. With the official version I always get a similar (perhaps slightly lower) number of adventures at a cost of 30-50K.

Thank you. Your willingness to help test and debug is appreciated.
 
Yeah... I'm still confused both as to why it cost 124k meat if spectral pickles are 13k mallprice currently and it could only eat 3 of them. That's 39k... but there's still 85k of spending that's not resolved. :(
 
Yeah... I'm still confused both as to why it cost 124k meat if spectral pickles are 13k mallprice currently and it could only eat 3 of them. That's 39k... but there's still 85k of spending that's not resolved. :(

Once it bought the brine for the spectral pickles I had some cucumbers left over I let it continue running the booze and spleen, because what's the worst it could do right? The worst it could do was 6 oily mushroom wine, a Russian ice and a full price prismatic wad on top of the three I made with rainbow gravitation. At least it filled out the rest with cold wads instead of buying mojo filters and another prismatic.

Edit: Huh. I could have sword the CLI said it was buying briny vinegar, but it looks to have paid full price for premade spectral pickles despite my having a bunch of ghostly cucumbers left from the last appearance of the factory. I'll have to check my logs later.
 
The reason I switched to retrieve_item is that it's supposed to actually work based on price and ingredients you own and all of that. If not, then http://wiki.kolmafia.us/index.php?title=Retrieval_order really needs to be updated. It claims it should do the following:
items already in inventory
items currently equipped
items equipped on a non-current familiar
retrieval of worthless items by using 31337 scrolls or sewering
untinkering a dictionary to get the bridge
items in closet, if enabled
free pulls from Hagnk's
items in storage, if no longer under ronin/HC restrictions (note that all of the item is pulled, not just the amount requested)
items in the clan stash, if enabled
item creation, up to the quantity creatable from ingredients on hand (this can be overriden by a buyScript)
trading worthless items to the Hermit
trading yeti furs to the Tr4pz0r
NPC purchase (if enabled), or Mall purchase (if enabled, and no ingredients on hand)
budgeted pulls from storage
item creation, unless buying the item is enabled and appears to be cheaper than the cost of acquiring all the ingredients
one final attempt at Mall purchase, if enabled and everything else has failed
Since your creation had ingredients on hand, as long as getting the ingredients is possible, it should have bailed out at the second to last step, unless it considered the cost of your currently owned ingredients as still being counted against your meat... Bizarre.

But yeah, I'm boggled as to why it decided to go so freaking rich on you. :( I'll remove the 899 one (as we've validated that it's bad, somehow) and upload my current one tonight which doesn't have another ingredient-collection phase and so forth, but after I've used it on at least a character or two without problems. That being said, I'd still suggest turning down your auto-buy from 20k to something lower.

Guess that's a question for fronobulax... do we want to try to enforce our own autoBuyPriceLimit or do we want to let people control that themselves? We could do something like force it to 5k if it's still at 20k, but the problem is that someone may have actually set that themselves on purpose. While most people are probably still using the default of 20k, which is way higher than they will really want, some players may want it there to facilitate automation over meat. I believe the creatable_amount is based on your autoBuyPriceLimit which is probably why it decided that redwulf could get them even though he really didn't want them at that price...

Edit: redwulf, what we'd really want, logwise, is the part where it behaved badly. It failing to make 3 of an untradable item is logical, though not the part where it decided you could get 3 of them. It spending way more money than it should... is not. And there should have been something like:
Getting 3 grue egg omelette in 0 seconds
autoBuyPriceLimit => 0.0
Verifying ingredients for grue egg omelette (3)...
You need 3 more grue egg to continue.
autoBuyPriceLimit => 20000
regarding your spectral pickles.
 
Last edited:
It appears to have decided that since I had cucumbers and vinegar that buying Brine and Dill was a good move.

Code:
> Pass 1: food.
> food: At 0, consuming to 15.
> Favorite pr0n chow mein is too fattening (4.0)- removing from consideration.
> Favorite pr0n chow mein is too fattening (4.0)- removing from consideration.
> Since 89 is more than 87 we are using the speculative stack.
> Favorite pr0n chow mein is too fattening (4.0)- removing from consideration.
> Favorite pr0n chow mein is too fattening (4.0)- removing from consideration.
> Favorite pr0n chow mein is too fattening (4.0)- removing from consideration.
> Favorite pr0n chow mein is too fattening (4.0)- removing from consideration.
> Getting 3 grue egg omelette in 0 seconds
> EatDrink encountered an error: You don't have 3 grue egg omelette and it has a null price, so you can't buy it.
> Something went wrong with getting grue egg omelette for 0. Recalculating.
> Pass 1: food.
> food: At 0, consuming to 15.
> Favorite pr0n chow mein is too fattening (4.0)- removing from consideration.
> Favorite pr0n chow mein is too fattening (4.0)- removing from consideration.
> Favorite pr0n chow mein is too fattening (4.0)- removing from consideration.
> Favorite pr0n chow mein is too fattening (4.0)- removing from consideration.
> Favorite pr0n chow mein is too fattening (4.0)- removing from consideration.
> Favorite pr0n chow mein is too fattening (4.0)- removing from consideration.
> Getting 3 spectral pickle in 0 seconds

buy 3 brine for 5700 each from 208970 on 20110601
You acquire brine (3)

[3104] Cook 3 brine + 3 vinegar
You acquire briny vinegar (3)
Crafting used 3 each of vinegar and brine

buy 3 dill for 5400 each from 193228 on 20110601
You acquire dill (3)

[3104] Cook 3 briny vinegar + 3 dill
You acquire ghostly pickling solution (3)
Crafting used 3 each of dill and briny vinegar

[3104] Cook 3 ghost cucumber + 3 ghostly pickling solution
You acquire spectral pickle (3)
Crafting used 3 each of ghost cucumber and ghostly pickling solution

Then it went on to eat a pumpkin pie (fortunately made from my pumpkin in inventory as I had intended, not purchased at mall price) and drink all that mushroom wine. I'd vote for the script to enforce it's own autobuy limit. I sometimes need the limit that high, the only reason I don't have it higher is the few times mafia has bugged out and decided me telling it to put on one of my IOTM's meant that it should put it on and then try to buy me a new one from the mall. Fortunately I keep it low enough I still need to make the really big purchases manually.

Edit: Even if I hadn't had the wait set to 0 I wouldn't have been able to do anything. After failing to consume the omelets mafia went to that red screen you get when you hit escape and I assumed it was done trying to eat so came here to type up the bit about the omelets. Went back to mafia and the pickles were already down the hatch.
 
Last edited:
Okay... tweaked the item creation detection code to work off of your total creatable amount instead of using just each individual item. This should make it think that things are less appealing when they want to be expensive...

I do still suggest though that people turn down the autoBuy if you don't have a reason why expensive stuff needs to be bought with scripts... autoBasement might be a possibility, but otherwise, anything expensive you're buying is probably by manually typing "buy <item>" which already ignores your autoBuy...
 
Is it supposed to do nothing for a very long time and make Mafia eat almost all of the processing power of my computer? (decided to try out these new versions).

I stopped it after 2 minutes when it had managed to search for 2 foods and then state that a favorite food was too fattening (VoA set to 890). I'll try it again tomorrow with some vbebosity on.
 
#910

One character generated a class java.lang.StackOverflowError. Have not figured out why yet. Looked like it might have been an infinite loop. One character didn't seem to have any problems. One character had a problem with a number format error or a numeric overflow. That was not captured but I seem to recall a string with 123456789 in it. 1.234567E9 perhaps? Curiously I also saw a gCLI line that said autoBuyPrice (or something similar) was equal to the same number. I also saw autoBuyPrice set to -1.25 and later to 20000. The later is the value of autoBuyPriceLimit in the preferences file.

I can do some more debugging eventually but it sounds like something is confusing the autoBuyPriceLimit and the price fudge factor eatdrink_priceFlexibility. Or not.
 
Is it supposed to do nothing for a very long time and make Mafia eat almost all of the processing power of my computer? (decided to try out these new versions).

I stopped it after 2 minutes when it had managed to search for 2 foods and then state that a favorite food was too fattening (VoA set to 890). I'll try it again tomorrow with some vbebosity on.

I find it very CPU intensive but it has been fast enough on my hardware that I have not been worrying. A production version probably needs some kind of occasional output to reassure the user that the script is still running as expected.
 
Hate it when I write up my explanations and browser crashes when I hit the upload button. Summary of prior, well-written note:
Problem: Price exception probably due to default flexibility being a float, so when you multiply mall_price (not divisible by 4) by 1.25, you get a float. This generates errors with retrieve_item expecting an int in its preference for autoBuy. Also, some items have a price of -1.
Solution: max(0, floor(mallprice*flexibility)) for autoBuy preference. This forces it to a minimum of 0 as the amount you're willing to pay (don't have to make a profit to get the item), and forces it to save integers instead of floats.

Problem: EatDrink doesn't give you enough feedback.
Solution: Turn on verbose2. Eventually, I'll add verbose3 to show you each creation consideration, but verbose2 should be spam enough for most.

Problem: EatDrink runs slowly on slow computers.
Solution: New [untested] EatDrink preference for inaccurate creation consideration, eatdrink_accurateMake defaults to true. If set to false, it will use creatable_amount instead of have_ingredients. May set this to work on the stack as well as the consideration/available list eventually.
Pros: Faster.
Cons: Won't realize when it runs out of ingredients, will have to restart consideration more often, and possibly end up filling doneness with smaller things because it expects them to be possible.

Attached: EatDrink with the aforementioned max/floor fix as well as accurateMake.

Sidenote: The eatdrink_budget preference is the maximum value you're willing to pay for a single item. Anything over this is considered 'too rich' by the code. It's not a full budget, just a "don't pay more than this" amount.
 
914 is not working at all. Error message "Unknown variable 'USE_MAKE' (eatdrink.ash, line 2258)". My ability with ash is too minimal to figure out what that variable should be.
 
I wouldn't say that a desktop computer with a dual core 3,4GHz processor and 3GB of RAM is a slow computer. It may not be the newest computer in the world, but slow, I wouldn't say so :)
 
Um... yeah, okay, sorry about 914. I'd been trying to replicate what was there for the full parameter CLI version and picked the wrong stuff. Obviously.

This version has actually been checked to run, and should be fine. Believe the variable to pass if you want to skip the full calculation is EAT_ACCURATE, and set that to false... That should speed it back up to as fast as release EatDrink.

Edit: This was rather awesome... it automatically bought the cocktailcrafting kit, because I had enough of the ingredients for my horizontal tango to get the kit within the budget.
Pass 2: drink.
drink: At 0, consuming to 14.
Getting 1 horizontal tango in 0 seconds
Searching for "horizontal tango"...
Search complete.
autoBuyPriceLimit => 1112
Verifying ingredients for horizontal tango (1)...
Verifying ingredients for wine spritzer (1)...
Searching for "soda water"...
Search complete.
Purchasing soda water (1 @ 70)...
You acquire an item: soda water
You spent 70 Meat
Purchases complete.
Creating wine spritzer (1)...
You acquire an item: wine spritzer
Successfully created wine spritzer (1)
Searching for "queue du coq cocktailcrafting kit"...
Search complete.
Purchasing Queue Du Coq cocktailcrafting kit (1 @ 1,000)...
You acquire an item: Queue Du Coq cocktailcrafting kit
You spent 1,000 Meat
Purchases complete.
Using 1 Queue Du Coq cocktailcrafting kit...
Finished using 1 Queue Du Coq cocktailcrafting kit.
Creating horizontal tango (1)...
You acquire an item: horizontal tango
Successfully created horizontal tango (1)
autoBuyPriceLimit => 5000
Getting 2 pink pony in 0 seconds
Searching for "pink pony"...
Search complete.
autoBuyPriceLimit => 1306
Verifying ingredients for pink pony (2)...
Creating pink pony (2)...
You acquire pink pony (2)
Successfully created pink pony (2)
autoBuyPriceLimit => 5000
Since you are not in a Moxie sign, you may not visit the brewery.
 

Attachments

Last edited:
Sidenote: The eatdrink_budget preference is the maximum value you're willing to pay for a single item. Anything over this is considered 'too rich' by the code. It's not a full budget, just a "don't pay more than this" amount.

Only one issue, and I'm not sure it can be coded around unless you CAN code it to have a full budget (i.e. "Don't spend more than this total") there are things I would willingly pay 5000 for, but I have to set it lower so that it doesn't buy brine for 5k and dill for 4K to make a bungload of pickles again.

Edit: More drastically I think something's buggy with that budget code. I have it currently set to 4k, when I started the script it reported the budget as being 5K and it just bought some booze for 8.5K.

Looks like it behaved exactly as I desired with spleen though. Here's the cli output from drinking and spleening (ate before dropping the budget, 3 more pickles and a pumpkin pie, but that's my fault for not fixing the budget first).

Code:
Consuming up to 0 food, 19 booze, and 15 spleen
Considering food from inventory NPCs the mall. Per-item budget cap is 5000.0.
Price will not be a factor if you own it already. Hagnk's pulls (if enabled) will cost 1000 meat each.
An adventure has the value of 850 meat. Muscle subpoint is 10.0. Nonprime stat subpoint is 2.0.
Already updated from http://nixietube.info/mallprices.txt in this session.
Pass 1: food.
Skipping food.
Pass 2: drink.
drink: At 0, consuming to 19.
Searching for "wine spritzer"...
Search complete.
Searching for "monkey wrench"...
Search complete.
Searching for "strawberry wine"...
Search complete.
Searching for "teqiwila slammer"...
Search complete.
Searching for "neuromancer"...
Search complete.
Searching for "vodka stratocaster"...
Search complete.
Favorite rockin' wagon is too fattening (4.0)- removing from consideration.
Favorite rockin' wagon is too fattening (4.0)- removing from consideration.
Favorite rockin' wagon is too fattening (4.0)- removing from consideration.
Favorite rockin' wagon is too fattening (4.0)- removing from consideration.
Favorite rockin' wagon is too fattening (4.0)- removing from consideration.
Favorite rockin' wagon is too fattening (4.0)- removing from consideration.
Getting 1 Mon Tiki in 0 seconds
Searching for "mon tiki"...
Search complete.
autoBuyPriceLimit => 7182
Searching for "caipifruta"...
Search complete.
Using cached search results for Mon Tiki...
Purchasing Mon Tiki (1 @ 5,746)...
You acquire an item: Mon Tiki
Purchases complete.
autoBuyPriceLimit => 20000
Getting 1 teqiwila slammer in 0 seconds
autoBuyPriceLimit => 7187
Searching for "teqiwila"...
Search complete.
Searching for "teqiwila slammer"...
Search complete.
Purchasing teqiwila slammer (1 @ 5,700)...
You acquire an item: teqiwila slammer
Purchases complete.
autoBuyPriceLimit => 20000
Getting 1 Neuromancer in 0 seconds
autoBuyPriceLimit => 6862
Searching for "gibson"...
Search complete.
Searching for "neuromancer"...
Search complete.
Purchasing Neuromancer (1 @ 5,250)...
You acquire an item: Neuromancer
Purchases complete.
autoBuyPriceLimit => 20000
Getting 1 vodka stratocaster in 0 seconds
autoBuyPriceLimit => 6622
Searching for "vodka gibson"...
Search complete.
Searching for "vodka stratocaster"...
Search complete.
Purchasing vodka stratocaster (1 @ 5,298)...
You acquire an item: vodka stratocaster
Purchases complete.
autoBuyPriceLimit => 20000
Getting 1 flaming mushroom wine in 0 seconds
Searching for "flaming mushroom wine"...
Search complete.
autoBuyPriceLimit => 10625
Using cached search results for flaming mushroom wine...
Purchasing flaming mushroom wine (1 @ 8,500)...
You acquire an item: flaming mushroom wine
Purchases complete.
autoBuyPriceLimit => 20000
Since you are not in a Moxie sign, you may not visit the brewery.
Drinking 1 Mon Tiki...
You gain 22 Adventures
You gain 45 Muscleboundness
You gain 4 Drunkenness
You lose some of an effect: Ode to Booze
Finished drinking 1 Mon Tiki.
1: Mon Tiki lev:6 gain:4.0 adv:16.0 musc:43.5 myst:0.0 mox:0.0 meat:5799 own:1 value:4358
Since you are not in a Moxie sign, you may not visit the brewery.
Drinking 1 teqiwila slammer...
You gain 18 Adventures
You gain 47 Strongness
You gain 4 Drunkenness
You lose some of an effect: Ode to Booze
Finished drinking 1 teqiwila slammer.
2: teqiwila slammer lev:6 gain:4.0 adv:16.0 musc:43.5 myst:0.0 mox:0.0 meat:5750 own:1 value:4358
Since you are not in a Moxie sign, you may not visit the brewery.
Drinking 1 Neuromancer...
You gain 19 Adventures
You gain 30 Muscleboundness
You gain 20 Smarm
You gain 4 Drunkenness
You lose some of an effect: Ode to Booze
Finished drinking 1 Neuromancer.
3: Neuromancer lev:6 gain:4.0 adv:16.0 musc:26.0 myst:0.0 mox:18.0 meat:5490 own:1 value:4324
Since you are not in a Moxie sign, you may not visit the brewery.
Drinking 1 vodka stratocaster...
You gain 21 Adventures
You gain 27 Muscleboundness
You gain 16 Chutzpah
You gain 4 Drunkenness
You lose some of an effect: Ode to Booze
Finished drinking 1 vodka stratocaster.
4: vodka stratocaster lev:6 gain:4.0 adv:16.0 musc:26.0 myst:0.0 mox:18.0 meat:5298 own:1 value:4324
Since you are not in a Moxie sign, you may not visit the brewery.
Drinking 1 flaming mushroom wine...
You gain 13 Adventures
You gain 16 Muscleboundness
You gain 3 Drunkenness
You lose some of an effect: Ode to Booze
Finished drinking 1 flaming mushroom wine.
5: flaming mushroom wine lev:6 gain:3.0 adv:12.0 musc:13.5 myst:0.0 mox:0.0 meat:0 own:1 value:4295
Pass 3: spleen.
spleen: At 0, consuming to 15.
Since 24 is more than 21 we are using the speculative stack.
Getting 6 cold wad in 0 seconds
autoBuyPriceLimit => 831
Searching for "cold wad"...
Search complete.
Purchasing cold wad (6 @ 665)...
You acquire cold wad (6)
Purchases complete.
autoBuyPriceLimit => 20000
Using 1 prismatic wad...
You gain 5 Adventures
You gain 62 Fortitude
You gain 58 Wizardliness
You gain a Mysticality point!
You gain 52 Roguishness
You acquire an effect: Rainbow Bright (duration: 10 Adventures)
Finished using 1 prismatic wad.
1: prismatic wad lev:7 gain:3.0 adv:6.0 musc:55.0 myst:55.0 mox:55.0 meat:0 own:0 value:1756
Using 1 prismatic wad...
You gain 6 Adventures
You gain 62 Muscleboundness
You gain 50 Mysteriousness
You gain 50 Cheek
You acquire an effect: Rainbow Bright (duration: 10 Adventures)
Finished using 1 prismatic wad.
2: prismatic wad lev:7 gain:3.0 adv:6.0 musc:55.0 myst:55.0 mox:55.0 meat:0 own:0 value:1956
Spleen value is 1956; mojo filter to get it costs 1690
Getting 1 mojo filter in 0 seconds
Searching for "mojo filter"...
Search complete.
autoBuyPriceLimit => 2112
Using cached search results for mojo filter...
Purchasing mojo filter (1 @ 1,690)...
You acquire an item: mojo filter
Purchases complete.
autoBuyPriceLimit => 20000
Using 1 mojo filter...
Finished using 1 mojo filter.
M1: mojo filter price: 1690
Getting 1 mojo filter in 0 seconds
autoBuyPriceLimit => 2112
Using cached search results for mojo filter...
Purchasing mojo filter (1 @ 1,690)...
You acquire an item: mojo filter
Purchases complete.
autoBuyPriceLimit => 20000
Using 1 mojo filter...
Finished using 1 mojo filter.
M2: mojo filter price: 1690
Using 1 prismatic wad...
You gain 7 Adventures
You gain 62 Fortitude
You gain 50 Wizardliness
You gain 56 Chutzpah
You acquire an effect: Rainbow Bright (duration: 10 Adventures)
Finished using 1 prismatic wad.
3: prismatic wad lev:7 gain:3.0 adv:6.0 musc:55.0 myst:55.0 mox:55.0 meat:0 own:0 value:1956
Using 1 cold wad...
You gain 1 Adventure
You gain 29 Beefiness
You gain 20 Wizardliness
You gain 9 Roguishness
You acquire an effect: Cold Blooded (duration: 10 Adventures)
Finished using 1 cold wad.
4: cold wad lev:6 gain:1.0 adv:1.0 musc:27.0 myst:18.0 mox:9.0 meat:0 own:1 value:1074
Using 1 cold wad...
You gain 1 Adventure
You gain 27 Fortitude
You gain 17 Enchantedness
You gain 10 Chutzpah
You gain a Moxie point!
You acquire an effect: Cold Blooded (duration: 10 Adventures)
Finished using 1 cold wad.
5: cold wad lev:6 gain:1.0 adv:1.0 musc:27.0 myst:18.0 mox:9.0 meat:0 own:1 value:1174
Using 1 cold wad...
You gain 1 Adventure
You gain 31 Beefiness
You gain 19 Enchantedness
You gain 9 Smarm
You acquire an effect: Cold Blooded (duration: 10 Adventures)
Finished using 1 cold wad.
6: cold wad lev:6 gain:1.0 adv:1.0 musc:27.0 myst:18.0 mox:9.0 meat:0 own:1 value:1174
Using 1 cold wad...
You gain 1 Adventure
You gain 31 Strengthliness
You gain a Muscle point!
You gain 19 Wizardliness
You gain 8 Sarcasm
You acquire an effect: Cold Blooded (duration: 10 Adventures)
Finished using 1 cold wad.
7: cold wad lev:6 gain:1.0 adv:1.0 musc:27.0 myst:18.0 mox:9.0 meat:0 own:1 value:1174
Using 1 cold wad...
You gain 1 Adventure
You gain 29 Fortitude
You gain 19 Mysteriousness
You gain 8 Roguishness
You acquire an effect: Cold Blooded (duration: 10 Adventures)
Finished using 1 cold wad.
8: cold wad lev:6 gain:1.0 adv:1.0 musc:27.0 myst:18.0 mox:9.0 meat:0 own:1 value:1174
Using 1 cold wad...
You gain 1 Adventure
You gain 31 Strengthliness
You gain 18 Wizardliness
You gain 9 Roguishness
You acquire an effect: Cold Blooded (duration: 10 Adventures)
Finished using 1 cold wad.
9: cold wad lev:6 gain:1.0 adv:1.0 musc:27.0 myst:18.0 mox:9.0 meat:0 own:1 value:1174
Pass 4: drink.
Skipping drink.
choc: Checking non-filling crimbo chocolates - all 3 kinds
Best find was chocolate saucepan with a value of -2000. That's no good, so not consuming and moving on.
Finished. You had Milk of Magnesium-Ode to Booze in effect. Adventures listed above does not reflect that, but this does:
Spent 37864 meat. Gained Fullness: 0. Inebriety: 19. Spleen: 13.
Adventures: 117. Muscle: 529. Moxie: 247. Mysticality: 270.
On step 3 your best value was recalculated as 750.
Eating, drinking, and spleening complete. Commence merrymaking (at your own discretion).
 
Last edited:
Your budget is still 20k, as it says repeatedly in the script... like so: autoBuyPriceLimit => 20000

Though the internal budget is used as an elimination point for items... also, I think the next version will be hardcoded to make sure that your single-item temporary aBPL will never be higher than your actual aBLP.

Edit: A note regarding that though. My plan is, using the aBLP preference, to use that as the elimination point for single items rather than EAT_BUDGET. At that point, EAT_BUDGET should become the total amount of meat that EatDrink should attempt to spend as its max. I can't guarantee that it will do exactly the same as closetting your meat first, but it should be pretty close... the potential failing would be restoring mana for casting ode, but everything else we should be able to work into the consideration. Probably. An alternative would be having the budget be the maximum allowed per stack, so your actual EAT_BUDGET would be 1/3rd of how much meat you might spend. That does make it much easier to actually consider and limit though, and at that point we'd probably just drop the default to 10k instead of 20k so that it ends closer to its current levels...

Edit2: Using EAT_BUDGET currently to limit it will cut out items above the 'effective_value' but... that's (once again) based on historic_value, while when it actually gets purchased, we use mall_price instead. That's probably what happened in your case... people have been using them from the mall, and their price went up above your budget.
 
Last edited:
#917 has generated a class java.lang.StackOverflowError pretty much every time I have tried it so far. It occurs during the mall search phase. It does not always occur at the same point so I wonder if it is related to the number of items and that, in turn, is related to the maxAge parameter. (Which incidentally I set to 7 to stop the darn searches but it doesn't seem to have made a difference so there is operator error somewhere). I'm pretty sure it dumped while simming so i should have more data later today, if real life gives me some quality KoL time. The upgrades to SmartStasis and Batbrain are not working well for me so i am fighting that at the moment, as well.

As for enforcing a total budget, what I finally did was closet meat before running EatDrink. My wrapper code (written for Ascend) is below if anyone wants it.

Code:
setvar("ascend_EatDrinkBudget", 1000);
int eatDrinkBudget = to_int(vars["ascend_EatDrinkBudget"]);

and
Code:
//This is a wrapper for eatdrink.  It checks the daily budget against the amount spent
//by EatDrink.  It closets meat so that Eatdrink cannot exceed the budget, calls EatDrink
//and then restores the meat.  Daily limit will get hosed if, for whatever reason, EatDrink
//does not return here after being called.  Ignores SIM parameter and any parameters
//that might logically prevent EatDrink from spending

void eatdrinkWrapper (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, 
	       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)
{
	int spentToday = to_int(get_property("_Ascend_EatDrinkSpentToday"));
	int allowedThisCall = max(0, eatDrinkBudget - spentToday);
	int beginMeat = my_meat();
	int toCloset = max(0, beginMeat - allowedThisCall);
	if (toCloset > 0) {
		put_closet(toCloset);
	}
	int startMeat = my_meat();
	debug("EDW Before "+spentToday+" "+eatDrinkBudget+" "+allowedThisCall+" "+beginMeat+" "+toCloset+" "+startMeat);
	eatdrink (foodMax, drinkMax, spleenMax, overdrink,
	       use_inv_p, use_closet_p, use_storage_p, 
	       sim_consume_p, supress_overdrink_p, 
	       shop_p, budget_p, price_flexibility_p, 
	       consider_cost_when_owned_p, cost_of_pull_p, 
	       value_of_adventure_p, 
	       value_of_prime_stat_p, value_of_nonprime_stat_p, 
	       pie_priority_p, price_of_nontradeables_p,
	       price_of_unknowns_p, sim_ronin_p, sim_level_p);
	int endMeat = my_meat();
	int deltaSpend = startMeat - endMeat;
	spentToday = spentToday + deltaSpend;
	set_property("_Ascend_EatDrinkSpentToday",to_string(spentToday));
	if (toCloset > 0) {
		take_closet(toCloset);
	}
	debug("EDW After "+endMeat+" "+deltaSpend+" "+spentToday);
}
 
Back
Top