Nash Crosby's Still automator

ohkwarig

New member
I wanted a way to automatically create items from Nash Crosby's Still when I logout, and couldn't find a complete script on this site. So, in my first public attempt at mafia scripting, I came up with the attached. The script simply attempts to make as many distilled items and liquors as possible. There's no intelligence as to what it makes, but I separated out the functions in such a way that if someone else wants to make it smarter, it shouldn't be too difficult. You can call this from your logout script and it'll use whatever distillations you haven't used during the day.

As this is my first real attempt at KoL scripting, and I haven't done any professional programming in ten years, it's likely not the most efficient means to do the job. I endeavored to make it easy to read and hopefully easy to adapt for your own uses.

The script requires zlib. Place it into your scripts directly and call it for its default behavior, which is, as I mentioned, not intelligent in the way it chooses what to create.

Now, someone will probably tell me the script is already built into mafia, and I just didn't know the function call...

 

Attachments

  • still_automator.ash
    4.2 KB · Views: 172
Last edited:

slyz

Developer
Here is the stilling part of my login script. I used PriceAdvisor to determine the best thing to still. It may stop working with newer versions of PA though, if the way recommended actions are written change.

It's based on Bale's Improve Spirits (the functions are still in there).

You may have to start playing around with PriceAdvisor to understand the parsing, but since it's such a great script, I really recommend doing that.
 

Attachments

  • login.ash
    3 KB · Views: 161

Bale

Minion
It's very cool to see an answer I made to a question saved and shared when that question comes up again.

Unfortunately it comes off for the worst when it's paired with a separate and not entirely compatible way of doing things. Putting aside the fact that you don't seem to use anything of my original script, just leaving it in like a snake's shed skin... Could you answer a question about it for me?

I don't use price advisor so I might be missing something obvious. What advantage was there to using price advisor to determine the best price? Is that better than comparing the prices of the raw materials and the product?
 
PA also calculates in the opportunity cost of the raw material. The pre-stillables are usually so low-priced (or npc items, which PA currently doesn't calculate anything interesting for) that the results are not going to be very different. Pre-stillables are items for which market efficiency pretty much works, so PA is only going to be valuable if there's a sudden shakeup in the worth of the other things you can make from them that isn't reflected in the price of the pre-stillables -- unlikely, but, I suppose, possible.

On the other hand I am extremely pleased and flattered to see slyz all over the forum offering up examples of what PA can be used for!

(For the record, Bale, I'm using a version of your code that is much much closer to the original, except that it is willing to still less than 10 items. I was very happy to find your code! My version doesn't use PA.)
 

slyz

Developer
@ aqua: yes, I really liked PA =)

@ Bale: I used PA because it allows me to put up in the mall a finished product where the profit can come more from cocktailcrafting the stilled item than from actually stilling it. It can change the decision of which item to still. I ran your version alongsides the PA version a few days and at least once the stilled item was different. By parsing PA's advice, I put up some berry-infused sake or mimosettes in my store (those don't sell really fast), instead of simply selling the stilled item.

I'm not so good at playing the mall, so I did that more in order to learn to use price_advices than to make moar meatz. Looking back, it must be safer to sell stilled items than un-garnished SHCs right now.

As for posting a script with unused bits of your code, you can imagine that I really didn't mean to offend or even make it look bad. I just thought ohkwarig would like to see what kind of logics could be used to decide which item to still (best price difference, or using PriceAdvisor to see if a cocktailcrafted drink would yield more theoretical profit).

I realized by rereading the file I attached that I had modified your improve_spirits() to only print what it would do. The original version was here.

Next time I'll simply post a straightforward script AND a link to the script I used as a basis (more often then not, one of yours).
 
Last edited:

Bale

Minion
No, please. I didn't mean for you to properly quote your sources and my feeling were not hurt, although I couldn't figure out why I was getting any credit. I really just wanted to understand what you did with it, and why. I got that now, thanks.
 

icon315

Member
I keep getting the error

Code:
Function 'load_current_map( string, float [item] )' defined multiple times (priceAdvisor.ash, line 75)
 

icon315

Member
How can you make it so that the script makes sure you actually have enough meat on-hand to make the 10 Items?
 

Bale

Minion
Well, you could check the price of the ingredients with historical_price(), compare it to my_meat() and take_closet( meat_amount ) to get the meat out of your closet first if necessary.
 
Top