This looks odd; there's no mall price listed, and we have this mystery line about 994, which is the item# for tiny plastic Susie.
Well, what you quote definitely looks wrong. None of my output should produce 994 as advice! (I hope.) I get the right results, though, so this is going to be hard for me to test:
Code:
[B]tiny plastic Susie:[/B]
mallsell tiny plastic Susie: 1234567.0 meat
smash tiny plastic Susie; autosell twinkly powder: 60.0 meat
Looks like someone was being funny with their price...
What versions of PriceAdvisor and Mafia gave you the wonky result?
You might want to look at concoctions.txt and do some parsing, not unlike that little snippet that I posted a link to earlier.
Here's the thing: get_ingredients() does all the work for me, and in fact does the filtering I was originally going to do. PA works exactly as originally intended. Parsing concoctions.txt to get a similar result to get_ingredients() would be non-trivial: it's easy to parse for concoction and concoction type (and even then overlapping recipes are a problem: see my workaround for including creation of wads via both malus and transmutation), but to parse variable numbers of ingredients, where sometimes you need more than one of some ingredients? No thanks, I'm not duplicating the work the devs have so kindly already done for me. If you provide or convince Mafia to provide a get_ingredients() two-argument function like the one I suggested, or something like it, I'm more than happy to include the "pretend I have all skills" option in PA. It would make testing easier, for one thing. But there's just no way I'm doing the work myself. I hate complicated file parsing.
If I were to do this, I'd do something similar to the universal consume() for cook/smith/fold/whatever. Or set aliases? I don't know -- you should be able to do that with ASH, right?
Oh, the advice is easy enough to change: you can do it yourself, in fact: the little strings that Concoctions section of the main price_advice() function passes to concocted_advice() are what you'd want to change. I believe Mafia would be pretty happy with a universal "make".
This doesn't solve the "then do x times" issue, which is itself a bit of a hack. Ideally you'd replace every number in the string after a "then do x times" with that number * x, but again. I hate parsing things, and I'm not great friends with regular expressions. They would probably make this much easier.
If you or someone else wanted to provide a function
do_x_times(string action, int x) that would do that replacement, I would love to get rid of the hack-y syntax I'm currently using. Extra bonus points if it can replace singular items with plural as necessary, soothing my OCD soul.
Regarding the dailies: you might want to add in support for demon summoning (if it's ever worth it... heh).
Ah. As an option for thin black candles, etc.? That's a good special case to keep in mind if MPA becomes a source of advice.
I also hacked together a .txt with all (most?) relevant effects and durations (but it'll need updating regularly, I suppose).
That's really neat! I must admit one portion I was dreading was making such a map -- I couldn't see any way around it. Updating can be handled with the least fuss using Zarqon's wonderful Map Manager, although it would be best to be sure this is the final format before committing to it.
Hobo skills are probably not strictly within the purview of PA; "use hobo skill book; perm hobo skill; sell in /trade for.... I dunno how much per day" is not terribly reasonable advice, especially since Mafia only checks mall prices, not trade prices.
I might give that a shot if you give me a list of functions you might want.
price_advice mpa_advice(item), assuming Castle farming with nothing special happening, would be the minimum necessary. It would return a price_advice with the string being something like "use item; adventure in the Castle for <duration> turns" and price being "Castle benefit * duration" meat, less any opportunity cost.
If you're feeling ambitious,
price_advice mpa_advice(item, location) (and any other arguments you think interesting, like a boolean for olfaction or an int for combat rate modifier) would both be useful for PA (which either prompt or call it with default assumptions) and require you to write a bunch of code which other scripters of meat/profit things would probably find very handy.
The only issue is that your script would probably want to use PA for various things (value of item drop depends on best_price of item dropped, etc.). Ugh, circular inclusion. Maybe they're not as separable as I thought.
Well, we better start spreading the word, then, eh?
I'm getting three or so notifications per day, which is very gratifying. Hardly enough to change market behavior just yet, though!