Slime vial recipes

jasonharper

Developer
I've been thinking about the most efficient way to get the 91 discoveries and resulting trophy from the Sauceror Nenesis quest, and wrote a little script to simulate various strategies. The best I've found requires 91 each of the basic red/blue/yellow vials, and 238 cooks in 91 separate requests. A better solution has been claimed, but I really don't see where this could be improved - and the symmetry of the problem argues against a non-symmetrical solution.
Code:
int[item] inv;
inv[$item[red slime]] = 91;
inv[$item[yellow slime]] = 91;
inv[$item[blue slime]] = 91;
int cooks = 0;
void mix(int qty, item res, item a, item b)
{
	inv[a] = inv[a] - qty;
	if (inv[a] < 0) abort(inv[a] + " " + a);
	inv[b] = inv[b] - qty;
	if (inv[b] < 0) abort(inv[b] + " " + b);
	inv[res] = inv[res] + qty;
	cooks = cooks + qty;
}

mix(1, $item[red slime], $item[red slime], $item[red slime]);
mix(1, $item[yellow slime], $item[yellow slime], $item[yellow slime]);
mix(1, $item[blue slime], $item[blue slime], $item[blue slime]);

mix(30, $item[orange slime], $item[red slime], $item[yellow slime]);
mix(30, $item[v green slime], $item[yellow slime], $item[blue slime]);
mix(30, $item[violet slime], $item[red slime], $item[blue slime]);

mix(1, $item[orange slime], $item[orange slime], $item[orange slime]);
mix(1, $item[v green slime], $item[v green slime], $item[v green slime]);
mix(1, $item[violet slime], $item[violet slime], $item[violet slime]);

mix(11, $item[vermilion slime], $item[red slime], $item[orange slime]);
mix(11, $item[amber slime], $item[yellow slime], $item[orange slime]);
mix(11, $item[chartreuse slime], $item[yellow slime], $item[v green slime]);
mix(11, $item[teal slime], $item[blue slime], $item[v green slime]);
mix(11, $item[purple slime], $item[red slime], $item[violet slime]);
mix(11, $item[indigo slime], $item[blue slime], $item[violet slime]);

mix(1, $item[vermilion slime], $item[vermilion slime], $item[vermilion slime]);
mix(1, $item[amber slime], $item[amber slime], $item[amber slime]);
mix(1, $item[chartreuse slime], $item[chartreuse slime], $item[chartreuse slime]);
mix(1, $item[teal slime], $item[teal slime], $item[teal slime]);
mix(1, $item[purple slime], $item[purple slime], $item[purple slime]);
mix(1, $item[indigo slime], $item[indigo slime], $item[indigo slime]);

mix(1, $item[orange slime], $item[red slime], $item[amber slime]);
mix(1, $item[orange slime], $item[yellow slime], $item[vermilion slime]);
mix(1, $item[orange slime], $item[vermilion slime], $item[amber slime]);

mix(1, $item[v green slime], $item[blue slime], $item[chartreuse slime]);
mix(1, $item[v green slime], $item[yellow slime], $item[teal slime]);
mix(1, $item[v green slime], $item[chartreuse slime], $item[teal slime]);

mix(1, $item[violet slime], $item[blue slime], $item[purple slime]);
mix(1, $item[violet slime], $item[red slime], $item[indigo slime]);
mix(1, $item[violet slime], $item[indigo slime], $item[purple slime]);

mix(1, $item[vermilion slime], $item[orange slime], $item[vermilion slime]);
mix(1, $item[vermilion slime], $item[red slime], $item[vermilion slime]);

mix(1, $item[amber slime], $item[orange slime], $item[amber slime]);
mix(1, $item[amber slime], $item[yellow slime], $item[amber slime]);

mix(1, $item[chartreuse slime], $item[v green slime], $item[chartreuse slime]);
mix(1, $item[chartreuse slime], $item[yellow slime], $item[chartreuse slime]);

mix(1, $item[teal slime], $item[blue slime], $item[teal slime]);
mix(1, $item[teal slime], $item[v green slime], $item[teal slime]);

mix(1, $item[purple slime], $item[red slime], $item[purple slime]);
mix(1, $item[purple slime], $item[violet slime], $item[purple slime]);

mix(1, $item[indigo slime], $item[blue slime], $item[indigo slime]);
mix(1, $item[indigo slime], $item[violet slime], $item[indigo slime]);

mix(1, $item[brown slime], $item[amber slime], $item[chartreuse slime]);
mix(1, $item[brown slime], $item[amber slime], $item[brown slime]);
mix(1, $item[brown slime], $item[amber slime], $item[indigo slime]);
mix(1, $item[brown slime], $item[amber slime], $item[purple slime]);
mix(1, $item[brown slime], $item[amber slime], $item[teal slime]);
mix(1, $item[brown slime], $item[blue slime], $item[amber slime]);
mix(1, $item[brown slime], $item[blue slime], $item[brown slime]);
mix(1, $item[brown slime], $item[blue slime], $item[orange slime]);
mix(1, $item[brown slime], $item[blue slime], $item[vermilion slime]);
mix(1, $item[brown slime], $item[chartreuse slime], $item[brown slime]);
mix(1, $item[brown slime], $item[chartreuse slime], $item[indigo slime]);
mix(1, $item[brown slime], $item[chartreuse slime], $item[purple slime]);
mix(1, $item[brown slime], $item[v green slime], $item[amber slime]);
mix(1, $item[brown slime], $item[v green slime], $item[brown slime]);
mix(1, $item[brown slime], $item[v green slime], $item[indigo slime]);
mix(1, $item[brown slime], $item[v green slime], $item[purple slime]);
mix(1, $item[brown slime], $item[v green slime], $item[vermilion slime]);
mix(1, $item[brown slime], $item[v green slime], $item[violet slime]);
mix(1, $item[brown slime], $item[indigo slime], $item[brown slime]);
mix(1, $item[brown slime], $item[orange slime], $item[brown slime]);
mix(1, $item[brown slime], $item[orange slime], $item[chartreuse slime]);
mix(1, $item[brown slime], $item[orange slime], $item[v green slime]);
mix(1, $item[brown slime], $item[orange slime], $item[indigo slime]);
mix(1, $item[brown slime], $item[orange slime], $item[purple slime]);
mix(1, $item[brown slime], $item[orange slime], $item[teal slime]);
mix(1, $item[brown slime], $item[orange slime], $item[violet slime]);
mix(1, $item[brown slime], $item[purple slime], $item[brown slime]);
mix(1, $item[brown slime], $item[red slime], $item[brown slime]);
mix(1, $item[brown slime], $item[red slime], $item[chartreuse slime]);
mix(1, $item[brown slime], $item[red slime], $item[v green slime]);
mix(1, $item[brown slime], $item[red slime], $item[teal slime]);
mix(1, $item[brown slime], $item[teal slime], $item[brown slime]);
mix(1, $item[brown slime], $item[teal slime], $item[indigo slime]);
mix(1, $item[brown slime], $item[teal slime], $item[purple slime]);
mix(1, $item[brown slime], $item[vermilion slime], $item[brown slime]);
mix(1, $item[brown slime], $item[vermilion slime], $item[chartreuse slime]);
mix(1, $item[brown slime], $item[vermilion slime], $item[indigo slime]);
mix(1, $item[brown slime], $item[vermilion slime], $item[purple slime]);
mix(1, $item[brown slime], $item[vermilion slime], $item[teal slime]);
mix(1, $item[brown slime], $item[violet slime], $item[amber slime]);
mix(1, $item[brown slime], $item[violet slime], $item[brown slime]);
mix(1, $item[brown slime], $item[violet slime], $item[chartreuse slime]);
mix(1, $item[brown slime], $item[violet slime], $item[teal slime]);
mix(1, $item[brown slime], $item[violet slime], $item[vermilion slime]);
mix(1, $item[brown slime], $item[yellow slime], $item[brown slime]);
mix(1, $item[brown slime], $item[yellow slime], $item[indigo slime]);
mix(1, $item[brown slime], $item[yellow slime], $item[purple slime]);
mix(1, $item[brown slime], $item[yellow slime], $item[violet slime]);
mix(1, $item[brown slime], $item[brown slime], $item[brown slime]);

foreach it, qty in inv {
	print(qty + " " + it);
}
print(cooks + " cooks");
You can try different solutions by rearranging the mix() calls, and possibly changing their quantities, or the initial inventory amounts set at the top of the script. When run, the script will either abort if a quantity ever goes negative, or print a summary of the vials left at the end. 35 brown vials are the minimum you can hope for; anything else left over indicates that you cooked or started with too many of some kind.

This could easily be turned into an actual solver for the trophy, by replacing the mix() function with one that actually does the mixing (via visit_url()), rather than just simulating it. I'm going to let someone else do that, since I'm currently a TT and couldn't actually test it.

EDIT: latest version of the script, which will actually cook the vials, is in message #23.
 
Last edited:

Veracity

Developer
Staff member
I'm currently an SA in aftercore. I freed the king and opened the volcano yesterday. I then collected 10+ each of the primary vials.

I'll spend today's turns getting (most of) the rest of my vials and will try this out tomorrow. With equipment only, I'm at +272% item drop and am getting more than 2 vials per 3 adventure. If I don't get all my vials today, I'll get them - and craft them - tomorrow.

I'm a cheapskate. It's not worth spending meat to get the trophy one day earlier. ;)

Thanks!
 

Veracity

Developer
Staff member
It turns out that the "better solution" was due to a bug in the program used to generate it. Jef sent me his shell script. When I ran it, I got the "better solution", but when I fixed the typo, it did 238 cooks and used 91 of each slime, just like yours.

I attach two ASH scripts. One is yours, modified, and one is Jef's shell script translated into ASH by me.

I'm about to go farm vials, and when I have 91 of each, I'll mod your script (which is more efficient, since it minimizes server hits by cooking many slimes at once for later use) to actually do the cooking.

Thanks!

Edit: after today's turns, I now have 93 blue, 76 red, and 77 yellow. Aargh.
(That is after zapping a blue to a red. Obviously, further testing is in order, but I'd guess the primary vials, at least, are a zap group.)
 

Attachments

  • vials.ash
    3.7 KB · Views: 199
  • jef-vials.ash
    5.1 KB · Views: 154
Last edited:

Veracity

Developer
Staff member
OK, I attach a script to actually do the crafting. It uses the new "craft" function I added to ASH last night, so, revision 8184 or better.

- It checks that you have at least 91 each of red, yellow, and blue vials and aborts if not.
- It then crafts the 91 recipes in 91 calls to craft.php.
- You will end up with 91 fewer of each of the primary potions and 35 more of brown. Yum!
- It will consume 238 "cooking turns" - either real turns, or usages of a chef-in-the-box. If you have multiple chef-in-the-boxes in inventory and have the "auto repair" checkbox enabled, it will install a new chef every time one blows up and continue making the interrupted recipe (if it was making more than one of a vial). (That's built-in to the craft() function, actually; I tested it before running this script by blowing up a chef-in-the-box cooking something useful in quantity...)

I ran it with three chefs in inventory. Two blew up, the script ran to completion, and the Trophy Maker sold me the trophy.

Thanks to Jason for his original script, of which this is a minor modification.

Edit: I attach a couple of of other utility scripts

- make-quest-vials.ash requires you have 6 of each primary color and transforms them into 1 each of the 6 tertiary colors, one of which gives you the effect you need to proceed in the quest.
- make-useful-vials.ash requires that you have 9 of each primary color and transforms them into 1 each of all 12 useful colors. No brown. Ick.
 

Attachments

  • vials-trophy.ash
    4.2 KB · Views: 456
  • make-quest-vials.ash
    1.7 KB · Views: 310
  • make-useful-vials.ash
    1.7 KB · Views: 204
Last edited:

Veracity

Developer
Staff member
Considering that the scripts do not consume any vials, how could they?
However, KoLmafia itself tracks the effects when you consume a slime vial.
 

Lord_Kobel

Member
Is there an easy way to work out the minimum number of basic vials I need, given that I've already found 15 recipes while doing the quest? I'm farming for vials after doing the quest at 10 vials a day so any reduction in the number needed would be greatly appreciated....
 

jasonharper

Developer
It might actually be faster to ascend as a Sauceror again, and this time farm vials instead of finishing the quest...

Start with a copy of my original script at the top of this thread, and delete all of the mix() lines that correspond to your existing discoveries, but NOT any that have a quantity over 1. Run the script, and you'll find that the simulated final inventory has various non-brown potions left over. Reduce the quantities of those potions by that amount, either in the initial inventory (for the primaries) or the mix(30,...) or mix(11,...) lines (for secondary and tertiary vials). Keep running the script and doing this process again until you get an error-free run with nothing but brown vials left over - whatever the initial quantities end up being is what you'll need. You can then replace the mix() function with Veracity's version that actually does the cooking.
 

snooty

Member
Oops!

No one could possibly thank you enough for sharing all your hard work, Veracity, but I've stumbled onto this little error while trying to run the vials-trophy.ash script. I've got 91 of each vial, am I missing something?

Function 'craft( string, int, item, item )' undefined (vials-trophy.ash, line 46)
 

Bale

Minion
The perk of being a mafia developer is that you got to add a new function just for the sake of a script you're writing. I'd have had to use visit_url(), but it still would have worked. ;)

Sadly there aren't too many general purpose uses for craft(). Just this and spading for a new recipe.
 

Veracity

Developer
Staff member
The thing about the craft function is that it interfaces with a new internal class - CraftRequest - which interacts with "require box servants" and "auto repair box servants" the same way as general item creation. Yes, you could use visit_url to submit your cooking request, but to do it right, you've have to recognize when your chef blows up, figure out how many of the item it made before doing so, rebuild the chef, and submit a new request for the remaining potions.

It was easier to add the new internal request class than to duplicate the functionality in an ASH script, in my opinion.
 

Bale

Minion
Veracity, thanks for pointing that out. Yup, that does seem worthwhile.

heeheehee, thanks for pointing that out. I'd forgotten that I needed to make do with visit_url() to automatically transmute wads in my Rainbow Gravitation script. I'll have to update that to use craft() so that it will play nice with re-creation of box servants. It seems I'm already using craft() for a practical script other than mixing vials.
 

pineapple

New member
My chef-in-a box blew up halfway through mixing potions, and the script stopped.

Now when i try running it again it tells me I need 91 of each vial again. Anyway to get it to carry on where it left off? I don't really want to have to farm up another 60 yellow slimes when I've got plenty of the green ones.
 
Last edited:

snooty

Member
That's what I get for being in a hurry! Sorry to have wasted your time, and thanks for reminding me to actually read <.<
 

Braska

Member
I keep getting a Bad Item Value: vial of orange slime (vials-trophy.ash, line 4) when I try to run the script. Any help?
 

Braska

Member
I am using the latest .exe version, it is newer than 8184.

Edit: Latest .exe is 8200, which is what I am using.
 
Last edited:
Top