Page 2 of 23 FirstFirst 1 2 3 4 12 ... LastLast
Results 11 to 20 of 229

Thread: PriceAdvisor: Maximize your profits

  1. #11
    Developer
    Join Date
    Nov 2008
    Location
    Paris, France
    Posts
    4,510

    Default

    Code:
    mushroom fermenting solution:
    acquire 1 stinky mushroom; mix 1 mushroom fermenting solution, 1 stinky mushroom;
    mallsell stinky mushroom wine: 17494.723 meat
    mallsell mushroom fermenting solution: 12450.0 meat
    autosell mushroom fermenting solution: 30.0 meat
    Now I (finally) get it ... creating and mallselling an oily mushroom wine will yield a profit of 5,335 meat, but only 290 meat of that comes from using a gloomy black mushroom, since the mushroom fermenting solution could yield 17,494 meat instead of its mall price of 12,450.

    A newbie economist is me!

    Other question: is there a particular reason why only the best advice for each mixing method is kept ?

  2. #12
    Senior Member
    Join Date
    Feb 2009
    Posts
    182

    Default

    You can tell whether a clockwork or normal servant is currently installed via get_campground(); no server hit required.
    Originally Posted by jasonharper View Post
    This is both excellent and superb. I've added it to the wiki.

    Do I understand correctly that the results of get_campground() do not change during a session? It's the difference between just calling it once and calling it every time I check innaboxen. (On the other hand, it's not a server hit, so maybe I should call it every time in anticipation of some future revision that will cause its results to change.)

    This should always be accurate, except in the case that the servant has just blown up (or has never been installed this ascension), and the user's settings will cause it to be auto-repaired - I'm not sure how you'd predict which kind of servant it would be replaced with.
    Originally Posted by jasonharper View Post
    I think I can live with this unless and until people start complaining about this behavior.

    I'm impressed by the amount of checking the script does; I did a check on Spooky Stick and it checked 554 items before deciding what my best course of action was.
    Originally Posted by caphector View Post
    And then it probably just told you to autosell it anyway, right? Poor PriceAdvisor, ever hopeful it can find something better for you to do.

    Other question: is there a particular reason why only the best advice for each mixing method is kept ?
    Originally Posted by slyz View Post
    The reason is that I didn't want to suggest a jillion different things, so it only suggests the best option for each type of crafting, etc. I think that like my decision to only display positive profit, this may have been a case of attempting to fix a problem that was not necessarily a problem. I'll experiment with displaying more advice and see how overwhelming it is.

    Edit: I'm glad I experimented. It revealed a very nasty (and very stupid) bug in my max() function, which I have now fixed. (Clockwork servants, untinkering, negative costs, and showing all options for a create type are also included in the new version.) It's also revealed that a check I put in to stop weirdness when calculating some opportunity costs causes PA to not consider some results. Since PA is broken with this check and without it, and I haven't been able to come up with a quick fix, the bug stays for now. I'll try to hammer it out when I next have some free hours.
    Last edited by aqualectrix; 12-19-2009 at 08:38 PM.

  3. #13
    Developer jasonharper's Avatar
    Join Date
    Sep 2008
    Location
    Oklahoma
    Posts
    1,122

    Default

    get_campground() should automatically be updated after using any item that's installed in your campground. In other words, it should not be possible to have a box servant actually installed, without it being correctly indicated in the return value.
    In game: Seventh (#363053), originally a Seal clubber. I am the Ap'ostle of Ak'gyxoth! (Or is that Ap'ostrophe?)

  4. #14

    Thumbs up

    Hey just wanted to say i love this script, useful and well written.

    I've been using it in conjunction with a re-written and hacked together version of bales inventory control script.

    Doing some string matching on the advice output you've returned, i'm auto-cleaning junk from my inventory in the most profitable way!

    Haven't covered every case yet though, trying to work out from the string what to do is a bit annoying, some day i might overload yours to output in a different way (like action, required mat 1, required mat 2 or something). But thats probably something for when you're not adding your own big improvements.

    Hmm... didn't mean to go off on a tangent... Nice script, interesting possibilities, i love you.

  5. #15
    Senior Member
    Join Date
    Feb 2009
    Posts
    182

    Default

    get_campground() should automatically be updated after using any item that's installed in your campground. In other words, it should not be possible to have a box servant actually installed, without it being correctly indicated in the return value.
    Originally Posted by jasonharper View Post
    That's excellent. (For the sake of the wiki, is this now true for dwellings too, as it was not in the long-ago initial commit?)

    Haven't covered every case yet though, trying to work out from the string what to do is a bit annoying, some day i might overload yours to output in a different way (like action, required mat 1, required mat 2 or something). But thats probably something for when you're not adding your own big improvements.
    Originally Posted by twistedmage1 View Post
    If you take a look at how concocted_advice() is constructing the string (it does most of the constructing) you can probably get some hints on how to de-construct it. All the "acquire" bits, for example, are what are required. (In fact, Mafia can probably understand the acquire statements directly. Unfortunately, it's not going to understand my weird "create jewelry from" or "have the Mystic craft" syntax, which was designed to be more human-parsable than Mafia-parsable.)

  6. #16
    Senior Member
    Join Date
    Mar 2009
    Posts
    650

    Default

    I'm a little confused. In lines where it says mallsell x: # meat, is that how much you're supposed to mallsell the item for or how much profit you should get from mallselling and if it's profit, how is this derived? Does it assume selling at the current mall min (even if there's a limit?) or at 5th price (per mafia) or what? A little clarification would go a long way.

    Also when the script is calculating for crafted items... does it consider components in inventory as 0 cost or does it base the components at mall price even if you have it already, so in essence profit would be higher since you're not actually buying anything?

    *wonders if I'm making any sense*

  7. #17
    Senior Member
    Join Date
    Feb 2009
    Posts
    182

    Default

    You're making plenty of sense.

    The meat amount it gives you is your profit, not the mall price at which you should sell it. Profit is derived by assuming you have what you asked about and valuing any other ingredients required for the final product at the best price you can get for that ingredient (as calculated by PriceAdvisor). This is so that not just the mallsell price but the opportunity cost (of not using that ingredient for something else) is taken into account. Profit, then, is equal to mall price of the final product minus the opportunity cost of the other components.

    It assumes selling at the current (cached) fifth price, as per Mafia.

    Aside: this results in occasional slightly-incorrect opportunity costs for ingredients where mallsell == mall min, because PA will value these only at autosell price. If you have to buy them from the mall, they will cost you more than PA thinks they will.

    Components in inventory are not treated specially. After all, opportunity cost is still opportunity cost. The one place where they perhaps should be treated differently is in the aside above. I think I will change things thus:

    - calculate the opportunity cost
    - if it turns out to be the autosell value (there's nothing else worth doing with this component), check inventory.
    - if you have the autosell-valued item, opportunity cost = autosell cost, since that's what you'll lose by using it as a component.
    - if you don't have it, opportunity cost = mallsell cost, since that's what you'll have to spend to use it as a component.

    I'm glad you've asked these questions. I'm very wordy when explaining what's going on, so I didn't want to make the first post a billion pages long, but these details are important.
    Last edited by aqualectrix; 12-20-2009 at 03:25 AM.

  8. #18
    Senior Member
    Join Date
    Mar 2009
    Posts
    650

    Default

    This gave me a good chuckle (sorry Zarqon, I know you love your bat parts):

    Code:
    batgut:
    autosell batgut: 12.0 meat
    acquire 1 spices; cook 1 batgut, 1 spices; autosell bat haggis: -994.0 meat

  9. #19
    Senior Member
    Join Date
    Feb 2009
    Posts
    182

    Default

    Code:
    batgut:
    send 1 batgut to Zarqon: 0 meat + good karma
    I'm not going to add this special case (PriceAdvisor is an unforgiving profit maximizer! It has no heart!) but it would be pretty funny.

  10. #20
    Senior Member
    Join Date
    Feb 2009
    Posts
    182

    Default

    Double-post, for update-ness!

    Version 1.4 handles chests and lockers -- items you can use to get more than one item (or some meat) which require another item (a key).

    This involves a slight addition to the use_for_items.txt file syntax (don't worry, it will autoupdate): entries of the type
    Code:
    item1  item2  -1
    indicate that item2 is required in order to use item1.

    Chests/lockers added are orcish meat locker (rusty metal key), stuffed treasure chest (stuffed key), and the three cursed chests/lockers. If you know of any other items that work this way, let me know and I'll add them too.

    For that matter, if you know of any items that should be usable for items or meat that PA doesn't know about, please report those too!

    Unexcitingly, buying the key to use the chest isn't worth it for anything right now. Oh well, the script is more complete even if it isn't actually more useful!

Similar Threads

  1. Replies: 0
    Last Post: 10-30-2013, 05:23 AM
  2. Replies: 1
    Last Post: 01-10-2013, 06:06 AM
  3. Bug - Cannot Reproduce Breakfast freezes at collecting hippy profits
    By Fred Nefler in forum Bug Reports
    Replies: 2
    Last Post: 11-14-2011, 08:19 PM
  4. Maximize.ash, maximize equipment in one command.
    By Paragon in forum Item Handling Scripts
    Replies: 118
    Last Post: 05-05-2009, 02:34 PM
  5. Hippy Produce Stand Profits?
    By Raven434 in forum Community Support
    Replies: 1
    Last Post: 02-16-2008, 10:38 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •