Any way to consider non-items in scripts?

Theraze

Active member
As I'm thinking about missing items in EatDrink, it occurred to me that the infinitesimal IPA and some of those types of shop-consumables (whether we're talking about the daily stores or others like the Crimbo cafe) will, especially early in a run, be better than what you can get otherwise. When meat is tight at level 3 or 4, for 12 inebriety I can either get 21 adventures for 400 meat or 24 adventures for 1200 meat, and while normally 800 meat is definitely worth 3 adventures, before unlocking the treasury in a HC run it will generally take more than 3 adventures to regain that meat if it was planned on being allocated somewhere useful.

What I'm wondering is if there's any way to programically consider these non-items. It's obvious that mafia knows about them, because they display in the consumable panel. It's also obvious that they aren't considered to be "real" items, since "lookup infinitesimal ipa" gives a message to the effect that it wasn't able to find that and best of luck with the wiki, in addition to the obvious check of "ash $item[infinitesimal ipa]" not showing me anything helpful.

Is this something where I just need to manually inject fake items into the EatDrink database if I'm going to have it consider them, or have I just repeatedly missed the incredibly obvious solution? Will my best solution be importing the datafiles directly if one of these stores is available to the user?

Any thoughts would be appreciated. I'd like to make this be as seamless for end users as possible... If there needs to be a 'holiday' edition of EatDrink, so be it. But that seems... meh.
 

Catch-22

Active member
These items are part of a KoLConstants collection, internal to KoLmafia.

I think there have been requests in the past to be able to access these constants but I don't know if anything ever came of it.
 

Theraze

Active member
Yeah... if possible, I'd like to not have to do server hits for the info, but if need be, I can make fake items and attempt to scrape the Crimbo cafe every execution, since its availability bleeds slightly into January... but that's a ton of generally useless server hits.
 

heeheehee

Developer
Staff member
One question: what do you do with sushi? Any consumption script would need special handling for this regardless.
 

Theraze

Active member
Me? Nothing. Note that I never actually mention sushi here. :) Whether or not sushi becomes available is less interesting to me, but may be more interesting to those who write auto-sushi scripts.

What I'm interested in are the various restaurants... if we can compare the current (if there is any) Crimbo food to the normal food, that would be nice. If need be, I'll make EatDrink hit the Crimbo cafe page every execution to find if we need to add anything else to the available item listing. I can speculate on which store is open (and if they have access) by comparing daily_special() to the inebriety.txt or fullness.txt files to see where it's found, then either scrape the page for which additional items it needs to add or just override based on what we hope will continue to be the standard.
 

Bale

Minion
I can speculate on which store is open (and if they have access) by comparing daily_special() to the inebriety.txt or fullness.txt files to see where it's found.

Or you could just check canadia_available() and gnomads_available(). Just saying. Maybe you might want to do a little visit_url() to ensure the beach is available after seeing that gnomads_available() is true, but your solution still seems a bit overly complicated.
 

Theraze

Active member
Well, Crimbo Cafe... that's the one that takes scraping. The other scrapes are only if, even if just for April 1st or something suchlike, the menu in the 3 standard (Hell, Canadia, Gnomads) cafes changes to something else that mafia recognizes. Since mafia runs its own menu scrape when it decides so it can show them on the consumption panels, even if they changed to something odd, as long as mafia itself recognizes their stock, we should too. If that means sad scripts that hit the server once or twice depending on moon sign (always once to check if Crimbo happens to be open, again if in bad moon, canadia, or gnomads), that's the other option.

But the second hit only has to happen once TPTB at KoL decide to mix things up once. The first hit is the one that's an always thing, due to not being any way (that I'm aware of) for checking if Crimbo currently has shops available without a server hit. If we get to access mafia's information about it, then it's once per mafia execution, regardless of how many times the script is run or how many characters are used. If we don't, it's once per script execution, unless we write multiple variables regarding what's available and when we checked, and even then it's only saving the future hits for that character.
 

Winterbay

Active member
One question: what do you do with sushi? Any consumption script would need special handling for this regardless.

If sushi were in some way accessible as items and their stats available as proxy-data I could cut out about 300 lines of code from my sushi script that handles creating item-like records of all sushis :)
 

Theraze

Active member
For that matter, if we wanted to check non-items, as long as we have some way to import them into a script like EatDrink, we could flag the record as "onlyCLI" or something similar. If the record.onlyCLI is true, we use
CLI_EXECUTE("eat "+record.name)
to eat it instead of
eatsilent(1, record.it)
or something similar. Even if the 'normal' item checks don't work against it, if we can get it into the system somehow easily, we can manipulate it from there...

Static records are easy. It's making the system intelligent that's more complicated. :)
 
Top