Superhuman Cocktailcrafting maximizer

rlbond86

Member
Cocktail Maximizer 1.0.6 (requires zlib)

Have Superhuman Cocktailcrafting and a bunch of ingredients? Don't know how to make the most drinks out of all your stuff? Not sure what to use your still charges for?

Enter the Cocktailcrafting Maximizer. The script will run a linear program to determine how to maximize your still uses and what drinks to create. It will try to first maximize the total number of drinks you can make, breaking ties by total profit. It will consider the following variables:

  • Number of "upgraded" booze bottles you own
  • Number of "upgraded" mixers you own
  • Number of garnishes you own
  • Number of charges in Nash Crosby's Still you have today
  • Number of base booze bottles / base mixers you own (plus, the price of ones you can buy) to upgrade in the Still
  • Price of resulting drinks

For example, here are results when I ran the script with my current inventory:

Code:
Prep work:

upgrade 5 olives to cocktail onions
buy 5 soda waters; upgrade 5 soda waters to tonic waters

Crafting:

craft 6x Neuromancer from 6x Calcutta Emerald + 6x cocktail onion + 6x coconut shell
craft 1x Mon Tiki from 1x Lieutenant Freeman + 1x kiwi + 1x coconut shell
craft 6x yellow brick road  from 1x Definit + 1x tonic water + 1x little paper umbrella
craft 1x tangarita from 1x Jorge Sinsonte + 1x tangerine + 1x magical ice cubes
craft 1x Mae West from 1x Domesticated Turkey + 1x raspberry + 1x magical ice cubes

Total drinks: 15

Estimated profit: 87074

The script won't actually do anything when you run it. You'll have to create the drinks yourself.


As a note, sometimes it will tell you to make 0.5 of something, for example:

Code:
Prep work:

buy 4.5 soda waters; upgrade 4.5 soda waters to tonic waters
upgrade 1 strawberries to raspberries
upgrade 4.5 vodka to Definit

Crafting:

craft 4.5x yellow brick road from 4.5x Definit + 4.5x tonic water + 4.5x little paper umbrella
craft 1x prussian cathouse from 1x Champagne + 1x raspberry + 1x magical ice cubes

Total drinks: 5.5

Estimated profit: 32312

This is caused when you will have one upgrade in the still left, so the algorithm tries to make 1/2 of a drink. In that case you would just upgrade one of the two ingredients and not build half a cocktail. I'm not going to correct for that, because integer programming is much, much more difficult than linear programming.

To download, run this in your CLI:
Code:
svn checkout http://svn.code.sf.net/p/rlbond86-mafia-scripts/code/cocktailmax/trunk

Changelog:
1.0.1 Initial release
1.0.3 Fixed bug where raspberries were called strawberries
1.0.4 Made output prettier so you can figure out when it tells you to make 0.5 of something. Also the code is actually readable, maybe
1.0.5 Teqiwila slammer displays correctly
1.0.6 Migrated to SVN
 
Last edited:
The link to zlib seems to be the actual link as the text with the link to the text which I guess is the opposite of what you had in mind :)
(Nice idea though, I'll definitely look into it)
 
I think you had an hours-old version open when you made your change, so you were editing a version without my change.
 
So, I got a tiny bit bored today and modified my copy of cocktailMax to put the bottom into a main, like so:
Code:
void main () {
print ("Maximizing, please wait...");
Matrix S = simplex(S1);
printSimplex(S);
}
This allows me to run the following aliases:
getdrink => ashq import <cocktailMax.ash> item[int] upgrades; upgrades[2] = $item[neuromancer]; upgrades[3] = $item[vodka stratocaster]; upgrades[4] = $item[mon tiki]; upgrades[5] = $item[teqiwila slammer]; upgrades[6] = $item[divine]; upgrades[7] = $item[gordon bennett]; upgrades[8] = $item[gimlet]; upgrades[9] = $item[yellow brick road]; upgrades[10] = $item[mandarina colada]; upgrades[11] = $item[tangarita]; upgrades[12] = $item[mae west]; upgrades[13] = $item[prussian cathouse]; Matrix S = simplex(S1); for x from 2 to 13 { if (S.values[1][x] == 0) { int basicrow = 0; for r from 2 to S.rows { if (S.values[r][x] != 0 && basicrow == 0) { basicrow = r; } } if (basicrow > 0 && S.values[basicrow][S.columns] > 0) { create(to_int(S.values[basicrow][S.columns]),upgrades[x]); } } }

getmix => ashq import <cocktailMax.ash> item[int] upgrades; upgrades[14] = $item[cocktail onion]; upgrades[15] = $item[kiwi]; upgrades[16] = $item[kumquat]; upgrades[17] = $item[tonic water]; upgrades[18] = $item[tangerine]; upgrades[19] = $item[raspberry]; upgrades[20] = $item[bottle of calcutta emerald]; upgrades[21] = $item[bottle of definit]; upgrades[22] = $item[bottle of lieutenant freeman]; upgrades[23] = $item[bottle of jorge sinsonte]; upgrades[24] = $item[bottle of domesticated turkey]; upgrades[25] = $item[boxed champagne]; Matrix S = simplex(S1); for x from 14 to 37 { if (S.values[1][x] == 0) { int basicrow = 0; for r from 2 to S.rows { if (S.values[r][x] != 0 && basicrow == 0) { basicrow = r; } } if (basicrow > 0 && S.values[basicrow][S.columns] > 0) { create(to_int(S.values[basicrow][S.columns]),upgrades[(x > 25 ? x - 12 : x)]); } } }
Basically, getmix makes the recommended mixers while getdrink will make the recommended drinks. Yay for scripted laziness!
 
Back
Top