PriceAdvisor: Maximize your profits

heeheehee

Developer
Staff member
First: her code.
Right. I usually just assume "male" unless evidence seems to point otherwise. I'll keep in mind that you are, indeed, a female. Sorry 'bout that.

adventuring ... not even sure it fits within the scope of PA.
I guess so, especially when you have a) drops from badger/llama/sandworm/pixie, b) mayflower bouquet drops, c) cocoabo-type meat-producing, d) HP/MP restored during combat, e) HP/MP restored after combat, and f) increased item/meat drop rate -- all from familiars.
 
Right. I usually just assume "male" unless evidence seems to point otherwise. I'll keep in mind that you are, indeed, a female. Sorry 'bout that.

I make the same assumption, I'm afraid, so I'm not offended. But now I know you're not a Latin scholar -- "trix" is a feminine ending!
 

heeheehee

Developer
Staff member
I make the same assumption, I'm afraid, so I'm not offended. But now I know you're not a Latin scholar -- "trix" is a feminine ending!

Damn, I totally missed that. -sigh- (Sadly, I actually am a Latin scholar. Now is a good time to hang my head in shame?) Should I now use "aqualectricis" instead of aqualectrix's?
 
I'm with Bale: that was hilarious!

Aqualectrix is, er, Water-reader? It's been my online name for a long time, I'm not quite sure anymore. I like to read. I guess I like water, too?
 

heeheehee

Developer
Staff member
As I've already stated a few times, A Moron is Me™!

Anyway, I think we're getting just a bit sidetracked. I think I'm done with the profit_fx.ash, so now I just have to work on integrating the whole ugly mess into your much more aesthetically-pleasing script.

Files are attached. If you want to use it, I'd grab the latest version of relfx.txt, as the old versions have the wrong duration for inhalers. Have a happy New Year, everyone!

Edit: Well damn, I totally forgot that reducing the pressure penalty in the sea to 0 will cause this script to ignore a lack of Fishy. Will fix the pertaining lines. If I can think of a clever workaround.
(adventures.txt doesn't seem like it'd be importable to a map, as it doesn't have a unique key. I'll check it out anyway. As stated, I -am- a moron, so I could be wrong.)

Double edit: Also, wow. I totally didn't realize that the filesize more than doubled from the derivative (which in itself was almost 1.5x that of the original). Heh. This new version uses a container.txt, which you can create for yourself by swapping the first and fourth columns of adventures.txt. Or download, as it is now available here.

(Feature request: Can this ::please:: be the new format of adventures.txt? It'll make it so much easier for script authors.)

Triple edit: Oh dear god, I had a != instead of ==. Updated version attached. Several other fixes, too.

Fourth & Final edit: Okay, this is most likely the final version, unless someone finds a coding error. =P The function you want to call is "meat_gain". See my test script if you're unsure how this works.

[[In completely unrelated news, you guys all use test scripts too, right? I just want to make sure that I'm not the only one. Heh.]]
 
Last edited:

xKiv

Active member
This new version uses a container.txt, which you can create for yourself by swapping the first and fourth columns of adventures.txt. Or download, as it is now available here.

(Feature request: Can this ::please:: be the new format of adventures.txt? It'll make it so much easier for script authors.)

You could always index it by the first four columns instead, right?

Code:
string [string,string,boolean,location] locations;
string [location] container;

foreach zone, url, something, loc, conditions in locations
{ container[loc] = zone; }

(untested)
 

heeheehee

Developer
Staff member
You could always index it by the first four columns instead, right?

Code:
string [string,string,boolean,location] locations;
string [location] container;

foreach zone, url, something, loc, conditions in locations
{ container[loc] = zone; }

(untested)

Right. I'll modify the script to use that.

[A few minutes later, and several other modifications later...]

Here we go. I changed relfx to use the name of the effect for demon-summoning, and the script now uses vprint instead of print, so it'll be quieter at low verbosity settings (feel free to modify these as needed, aqualectrix). You can do away with container.txt (Thanks, xKiv!), if you even bothered to download it. Re-attaching noncombats.txt for convenience's sake.

I guess the only fixes I'll be making will probably be bugfixes, as it should, in theory, be fully compatible with PA. Unless, of course, you want to use a cached best_price for items from a zone. (Hobo Fortress doesn't work right, and I'm too lazy to fix that for now.)

Edit: There was some funkiness with +item drop%, and noncombats... let's just say that I fixed it. I think.
Double edit: Several types of fail with noncombats. Let's just say I'll have another version out today.
 
Last edited:

slyz

Developer
heeheehee : maybe I'm just too lazy to reread the whole thread, but your project seems to be slightly different than what PriceAdvisor is meant to offer. Maybe it deserves a thread of its own, with a condensed explanation?
 

heeheehee

Developer
Staff member
My little project's goal is to provide a semi-accurate estimate of additional meat obtained through using an item and subsequently adventuring, which may or may not be incorporated into PriceAdvisor in the future. But yeah, I guess I could make it into a separate thread.
 
heeheehee: I will definitely take a close look at your project. (I think it's great it has its own thread now -- show off your hard work!)

However, I'm going to be very busy in the next week / two weeks with real-life stuff, so I'm going to ignore PA (unless for serious bug fixes) for that time. I'm not ignoring your contribution -- I'm just really busy elsewhere.
 

slyz

Developer
Just to help out with the end item = start item issue:

Code:
> pa maid head

maid head:
mallsell 1 maid head: 8900.0 meat
untinker maid head; acquire 1 maiden wig; make 1 maid head; mallsell 1 maid head; : 8890.0 meat
acquire 1 Meat maid body; make 1 Meat maid; untinker Meat maid; mallsell 1 Meat maid body; mallsell 1 maid head: 8890.0 meat
autosell 1 maid head: 70.0 meat

It seems to me that the second suggestion is a new weird behavior (where did the untinkered maiden wig go ?).
 

Bale

Minion
The untinkered maiden head becomes part of the new maid head. You then lose 10 meat for the meatpaste. Lol!
 
No, Slyz is right -- both in that there is clearly still an end item == start item issue, and that something strange is happening.

If it were just end item == start item, we'd expect something silly like this:
untinker maid head; acquire 1 maiden wig; make 1 maid head; mallsell 1 maid head; acquire 1 brainy skull; make 1 maid head; mallsell 1 maid head : blah meat

Instead, it ignores the maiden wig you get from untinkering altogether. Maybe my solution wiped out the second part (acquire 1 brainy skull; make 1 maid head; mallsell 1 maid head) but missed the first? Yep, trailing semicolon -- looks like there was more there. Bother, bother, bother.

The third piece of advice is also end item == start item, although at least it's not missing pieces...

Definitely a bug. I'll have to take a look at it.
 

dj_d

Member
Just a note - I'd still love a _conservative flag, settable any which way (as an argument, globally, whatever). As soon as that's around it'll go in to my queue to add to farm.ash. Until then - well, to make the most out of my box, it told me to buy wrapping paper and make a present. Expected value 1.2E8 meat. :)
 

dj_d

Member
May I suggest changing line 508 to:
Code:
         special.action = "ash //" + it + " can't or doesn't sell";
That way, if it's cli_execute'd, it won't throw an error.
 
dj_d:

The next version will have a setting where it doesn't advise buying anything with mallprice greater than your autoBuyPriceLimit setting.

This is not as conservative as your original idea for conservative (although it does get rid of the wrapping paper). I can include a conservative setting as well, where it won't advise buying anything unless it is an NPC item or is available for mallmin (max(100, 2 * autosell)), which I believe was your original conception.

Is observing Mafia's price limit good enough, or would you like conservative as you originally conceived it?

Edit: "ash // x can't or doesn't sell" doesn't make for very pretty output when running the alias. Have you any suggestions that are both human-readable and cli-ignorable? It needs to say "you can't make any meat with this" while, as you say, being cli-executable as "do nothing without halting".

Edit:
Additional question/plea for help from someone who knows regular expressions. I have a little regex:
Code:
matcher integer = create_matcher("([\\d,]+)", str);
I nicked it from some post of Veracity's, totally unrelated to PA. It sees integers.

This works well for me, except that, well, when I use it to find integers so I can replace them with multiples, I end up with this: "mallsell 2 8-d camera". Oops. That's quite the camera!

This is not the regex's fault, of course. It sees an integer, just like it should. It's my fault: I should have looked for an integer with a space on each side.

However, I nicked the original because I'm no good at regexes. Can someone tell me what matcher will only see integers with a space on each side?
 
Last edited:

dj_d

Member
Re: conservative,
The goal of farm.ash is to try to maximize the meat you get from farming, and I'm giving you the perspective of the author of that script.
There's a lot of uncertainty in these types of calculations. The economy changes. You don't have any sense of where it's "really" at, since you only see the 5th price for anything. You only see asking prices, not selling prices. You don't get a sense of liquidity. Etc. So at some point, if you chain up too many of these, the noise overwhelms the signal.

From my perspective, betting that you can buy something at mallprice, then combine it and sell the results at mallprice again, effectively doubles (maybe squares?) the error involved. I'm OK with doing that if I'm running it manually, where I can sanity check the results. But for farm.ash, I'd rather the output depend on only one mallprice lookup (in truth it already depends on two - the price of selling the thing bare vs. combining it with something cheap).

So that's a long way of saying, yes, I would really like a _conservative flag. :)

Re: cli comments, I've asked for that feature but AFAIK it doesn't exist, and what I showed you is the cleanest/closest you can get.
 
Thanks for the feedback, dj_d. conservative as you've conceived it isn't hard to implement, so I'm happy to put it in.

It's a bother about the cli output, but if that's the only way then that's the only way.

(A note about cli_executing PA's output: if possible you may want to wrap it in some kind of try block anyway, because of the "expected results" nature of the output. I.e. smashing a 2-ball says "sell 1 cold powder, sell 1 twinkly powder", but you'll only actually get one or the other of these from smashing. Likewise with things like the fantasy chest, which may not give you all the possibilities when using them. And, a bug on my end which I will take a look at, will only explicitly tell you to sell/use 1 of each result, even if you might get multiples.)
 
Top