auto_mushroom: the perfect mushroom-growing script

rlbond86

New member
auto_mushroom 2.2. (requires zlib)

I haven't seen much on these boards about mushroom management, so I am uploading my personal mushroom script.

Every 16 days, this script will produce the following:
  • 8 fourth-generation mushrooms (gloomy black)
  • 18 third-generation mushrooms (6 each of flaming, frozen, stinky)
  • 12 second-generation mushrooms (4 each of warm, cold, pointy)
  • (optional) 40 first-generation mushrooms (13 spooky, 13 knob, 14 knoll)

The total cost per 16-day cycle is 1060 meat, plus another 1610 for the optional first-generation mushrooms.

You can begin the script any day. Since the 16-day cycle is sensitive to the moon phase, a "delay cycle" will run the first time the script is invoked until the main cycle can begin. This can take any number of days, so the script will grow the best mushrooms possible while it waits until a good time to jump to the steady-state cycle. Due to the mushroom-growing mechanics of KoL, you must begin growing on or before day 8 of the 16-day cycle (first Muscle day) to get 8 gloomy black mushrooms that cycle. If you start in the next 2 days, you will still get 6 gloomy black mushrooms that cycle (and 8 each cycle after that).

This script was a labor of love for me. I devised a few tricks which I have not seen mentioned online yet to maximize 2nd- and 3rd-gen mushroom yield while producing gloomy mushrooms. The script is very efficient and does not waste any growing space, so I would be very surprised to see a higher possible yield.


How to install: run the following CLI code to download:
Code:
svn checkout http://svn.code.sf.net/p/rlbond86-mafia-scripts/code/auto_mushroom/trunk

To actually start using auto_mushroom, type
Code:
planting/auto_mushroom.ash
in the CLI. You will need to do this again after you ascend.

Alternatively, you can use the mushroom plot tool. Select the script generator tab and click "Load Layout", select the script, and click "Run Layout". Or, you can type "auto_mushroom" (without quotes) in the automation preferences. Either way, if you have mushroom planting enabled in your breakfast settings, it will automatically run after that until you ascend.



Version History
  • 2.2: Fixed a bug when starting planting on day 1.
  • 2.1: Migrated to SVN.
  • 2.0: "Delay cycle" front-loads higher-level mushrooms so you get them before you ascend.
  • 1.0: Complete rewrite. Code is more modular and should be more easily modified if someone else wants to use it. Script will grow 6 gloomy black mushrooms on initial run if there's not enough time to grow 8. "Next event" message in CLI window tells you when to expect mushroom harvests.
  • 0.1: Initial release.
 
Last edited:

BlanketThief

New member
Error with the first time running
line 224,
cli_execute("zlib

Should possibly be
cli_execute("zlib.ash

Got an error about being unable to invoke zlib otherwise
 

slyz

Developer
PHP:
cli_execute("zlib autoMushroom_plantExtraFirstGenerationMushrooms = " + growExtra);
vars["autoMushroom_plantExtraFirstGenerationMushrooms"] = to_string(growExtra);
A simpler way is to do:
PHP:
vars["autoMushroom_plantExtraFirstGenerationMushrooms"] = to_string(growExtra);
updatevars();

Got an error about being unable to invoke zlib otherwise
And what is the error message you get in the gCLI exactly? Do you have zlib.ash in Mafia's /scripts folder?
 

rlbond86

New member
PHP:
cli_execute("zlib autoMushroom_plantExtraFirstGenerationMushrooms = " + growExtra);
vars["autoMushroom_plantExtraFirstGenerationMushrooms"] = to_string(growExtra);
A simpler way is to do:
PHP:
vars["autoMushroom_plantExtraFirstGenerationMushrooms"] = to_string(growExtra);
updatevars();
I didn't know about updatevars(), it's not in the zlib documentation. Thanks slyz.
 
Last edited:

rlbond86

New member
Error with the first time running
line 224,
cli_execute("zlib

Should possibly be
cli_execute("zlib.ash

Got an error about being unable to invoke zlib otherwise

Do you have zlib installed? That method should work, but I will look at what slyz mentioned.
 

BlanketThief

New member
Do you have zlib installed? That method should work, but I will look at what slyz mentioned.

Yeah, I have zlib installed. The issue is that I have it under 2 sub-folders I'm figuring, exact error is
"Unable to invoke zlib"
Changing it to zlib.ash allows mafia to find it again

Edit: I'm... going to see what's actually going on with it now, might be a directory length error and the such I suppose;

Edit2: The issue is with the name zlib for whatever reason. Changing directories did nothing, but changing the name from zlib.ash allowed mafia to find it as a script
 
Last edited:

slyz

Developer
I don't get any error when I run this simple script:
PHP:
import "zlib.ash"

cli_execute( "zlib vars" );

What OS do you use? I know the filename's capitalization has to be right on Unix systems, but the ".ash" shouldn't be needed when calling a script from a CLI command, unless a command with the same name already exists.

That makes me wonder if you have a "zlib" alias.
 

BlanketThief

New member
Windows 7 premium home edition, 64 bit OS on the computer in question
A quick check shows there isn't a zlib alias.

Edit: Found out the issue, there being a folder titled 'zlib' as well was what was throwing mafia off.
 

rlbond86

New member
Stealthy update: If you begin planting on day 9 or 10, you'll still get 6 gloomy black mushrooms that cycle instead of zero.
 

rlbond86

New member
In the cli, I get the following error:

Unknown variable 'field' (auto_mushroom.ash, line 1)

You'll need to print more of a diagnostic. Are you running the script from the mushroom planting interface? Is the script in your planting folder? What version of KoLmafia are you running?
 

Veracity

Developer
As you can tell from the "notify", I'm giving this a try. Even when I'm in aftercore for a while - and I figure I'll be in aftercore this time until the next Challenge Path comes out, at least - I long ago gave up on mushrooms because it required too much fiddling. Your script looks very comprehensive and appears to be "set and forget" to get the best possible results.

Obviously, it's too soon for me to see the magic at work, but I have high hopes. Thanks in advance. :)
 

rlbond86

New member
As you can tell from the "notify", I'm giving this a try. Even when I'm in aftercore for a while - and I figure I'll be in aftercore this time until the next Challenge Path comes out, at least - I long ago gave up on mushrooms because it required too much fiddling. Your script looks very comprehensive and appears to be "set and forget" to get the best possible results.

Obviously, it's too soon for me to see the magic at work, but I have high hopes. Thanks in advance. :)

:D Thanks Veracity!
 

dorath

New member
I'm getting the same error. 15.3, in the planting folder, from both the main pane and planting interface. Everything worked fine until the brushfire event started.

Unknown variable 'field' (auto_mushroom.ash, line 1)
 

rlbond86

New member
I'm getting the same error. 15.3, in the planting folder, from both the main pane and planting interface. Everything worked fine until the brushfire event started.

Unknown variable 'field' (auto_mushroom.ash, line 1)

Is is the straight 15.3 version? Or is it one of the hourlies?

Also if you could post a screenshot or copy of the CLI log that would be very helpful.
 

dorath

New member
Untitled.jpg
 

Winterbay

New member
I just reproduced this in the latest hourly build.
Steps:
1) Download and extract items to the Planting folder (which I had to create first)
2) Buy a mushroom plot
3) On the "One day planting" tab, press "Script Layout" and locate auto_mushroom.ash and pick that (may not be necessary I realize afterwards)
4) Go to the "Script Generator" tab and press "Load Layout"
5) Press "Run layout"
6) Get error message

Edit: The layout has entries for day 4 to 7 while day 1-3 and "final" are empty. May this be part of the problem? (I've never used a mushroom planting script before)

Edit, edit: Well, I think I've found the problem. For some reason Mafia, during one of the steps above, replaced the auto_mushroom.ash file with
Code:
field harvest
field pick 1
field pick 2
field pick 3
field pick 4
field pick 5
field pick 6
field pick 7
field pick 8
field pick 9
field pick 10
field pick 11
field pick 12
field pick 13
field pick 14
field pick 15
field pick 16

No idea when and what though :)
 
Last edited:

Theraze

Active member
Doesn't the layout tab only support part of the schedule? I think for a 'good' auto-script (basically anything that will do the full 16 day schedule) you just set it as your script using the automation preferences tab (or gCLI), and leave it...
 
Top