My personal Meat farming script

Veracity

Developer
I too would be interested in VCON as an EatDrink replacement although my recollection is that I was able to do that with the earlier algorithm and so I expect I could do it now, as well.

Tangentially, that said, I would find fighting the tentacle, the NEP, if available, and using VMF to max the still all of interest in run. I have experimented with importing and had some success but last time I tried there were things with outfits that I chose not to resolve. As I recall, the script would use an outfit but the saved outfit of the name could not be equipped in run for any one of several reasons. Since the "best" outfit tends to vary between freeing the king and level 15, or so, and I tend to stash a lot of useful gear in my display case, my personal solution is going to be a script that pulls potentially useful items from the DC, runs the maximizer and then saves the outfit with the appropriate names. But I have not written that yet :)
As we know, all of VMF is not intended to work in-run. You can certainly import it and use individual functions. For example, I have a CLI alias called "zatara":

Code:
ashq import <VeracityMeatFarm.ash>; consult_with_madame_zatara()
You can import it and call multiple functions from it. I do this all the time when I am creating/debugging a function that will be in it and expects to run in its environment - static initialization, etc.
Your script which does that could also dynamically change the outfit name; when you run a script that imports it, VMF's static initialization happens at the beginning, along with your script's and you can then change a configured variable:

Code:
import <VeracityMeatFarm.ash>;

print( "static initialization done" );
print( "Current farm_outfit (from VMF.DefaultOutfit) = '" + farm_outfit + "'" );
farm_outfit = "L13 Meat Drop";
print( "VMF functions will now use '" + farm_outfit + "'"  );
That doesn't change the setting, so if you run VMF from the CLI by itself, it will use the configured setting. But the script which imported VMF could then call any functions it desired. Or even its main function. Hmm. How do you do that? In Calling main from imported scripts, Winterbay says:

Yes you can. You can call the main function from WHAM by doing, for example:

Code:
import wham.ash;

void main() {
main@wham();
}
ETA: The part after the @ is either the name of the file or the name of the script as defined by the script-predicate. Any odd characters needs to be replaced with underscores.
Maybe I should choose a name for the script using the "script" directive. Something like "VMF". :)
 

Veracity

Developer
Yes.

Code:
import <VeracityMeatFarm>;

void main()
{
    // *** Programatically change VMF configuration here.
    main@VMF();
}
 
I keep getting this when it does the Bastillion
ncounter: Bastille Battalion
Encounter: Bastille Battalion
Encounter: Bastille Battalion
Encounter: Bastille Battalion
Encounter: Bastille Battalion
Encounter: Bastille Battalion
Encounter: Bastille Battalion
Encounter: Bastille Battalion
Encounter: Bastille Battalion
Encounter: Bastille Battalion (turn #1)
Encounter: Cheese Seeking Behavior
Getting Enhancement from Source Terminal
Encounter: Cheese Seeking Behavior
Source Terminal: enhance meat.enh
Encounter: Cheese Seeking Behavior
Manual control requested for choice #1319
choice 1: Stand in the waterfall
choice 2: Rob the suburb
choice 3: Submit embarrassing catapult photos
Click here to continue in the relay browser.
 

Veracity

Developer
How odd. It starts running Ezandora's script and it apparently returned - while the script was still running - and continued in VMF to go to the Source Terminal.

It doesn't do that for me.

Code:
use 1 Bastille Battalion control rig
Encounter: Bastille Battalion
Took choice 1313/1: (secret choice)
choice.php?whichchoice=1313&option=1&pwd
Encounter: Bastille Battalion
Took choice 1313/1: (secret choice)
choice.php?whichchoice=1313&option=1&pwd
Encounter: Bastille Battalion
Took choice 1313/1: (secret choice)
choice.php?whichchoice=1313&option=1&pwd
Encounter: Bastille Battalion
Took choice 1313/2: (secret choice)
choice.php?whichchoice=1313&option=2&pwd
Encounter: Bastille Battalion
Took choice 1313/2: (secret choice)
choice.php?whichchoice=1313&option=2&pwd
Encounter: Bastille Battalion
Took choice 1313/2: (secret choice)
choice.php?whichchoice=1313&option=2&pwd
Encounter: Bastille Battalion
Took choice 1313/3: (secret choice)
choice.php?whichchoice=1313&option=3&pwd
Encounter: Bastille Battalion
Took choice 1313/3: (secret choice)
choice.php?whichchoice=1313&option=3&pwd
Encounter: Bastille Battalion
Took choice 1313/3: (secret choice)
choice.php?whichchoice=1313&option=3&pwd
Encounter: Bastille Battalion
Took choice 1313/4: (secret choice)
choice.php?whichchoice=1313&option=4&pwd
Encounter: Bastille Battalion
Took choice 1313/4: (secret choice)
choice.php?whichchoice=1313&option=4&pwd
Encounter: Bastille Battalion
Took choice 1313/4: (secret choice)
choice.php?whichchoice=1313&option=4&pwd
Encounter: Bastille Battalion
Took choice 1313/5: (secret choice)
choice.php?whichchoice=1313&option=5&pwd
Encounter: Bastille Battalion (turn #1)
Took choice 1314/3: Look for cheese
choice.php?whichchoice=1314&option=3&pwd
Encounter: Cheese Seeking Behavior
Took choice 1319/1: Try the wall thing
choice.php?whichchoice=1319&option=1&pwd
Encounter: Bastille Battalion (turn #2)
You gain 120 cheese!
Took choice 1314/3: Look for cheese
choice.php?whichchoice=1314&option=3&pwd
Encounter: Cheese Seeking Behavior
Took choice 1319/2: Enter the Weakest Army competition
choice.php?whichchoice=1319&option=2&pwd
Encounter: Castle vs. Castle
You gain 103 cheese!
Took choice 1315/3: Ready your defenses and wait for them
choice.php?whichchoice=1315&option=3&pwd
Encounter: Bastille Battalion (turn #4)
You gain 40 cheese!
Took choice 1314/3: Look for cheese
choice.php?whichchoice=1314&option=3&pwd
Encounter: Cheese Seeking Behavior
Took choice 1319/3: Raid the cart
choice.php?whichchoice=1319&option=3&pwd
Encounter: Bastille Battalion (turn #5)
You gain 22 cheese!
Took choice 1314/3: Look for cheese
choice.php?whichchoice=1314&option=3&pwd
Encounter: Cheese Seeking Behavior
Took choice 1319/3: Put on the bad art show
choice.php?whichchoice=1319&option=3&pwd
Encounter: Castle vs. Castle
You gain 49 cheese!
Took choice 1315/3: Ready your defenses and wait for them
choice.php?whichchoice=1315&option=3&pwd
Encounter: GAME OVER
Took choice 1316/3: I'm done for now
choice.php?whichchoice=1316&option=3&pwd
You gain 462 Sarcasm
You gain a Moxie point!
You acquire an item: Draftsman's driving gloves
You acquire an effect: Bastille Braggadocio (100)
You acquire an item: interrogative elixir
> Getting Enhancement from Source Terminal
Source Terminal: enhance meat.enh
You acquire an effect: meat.enh (100)
Source Terminal: enhance meat.enh
You acquire an effect: meat.enh (100)
Source Terminal: enhance meat.enh
You acquire an effect: meat.enh (100)
 
Heres from the log itself:

use 1 Bastille Battalion control rig
Encounter: Bastille Battalion
Took choice 1313/1: (secret choice)
choice.php?whichchoice=1313&option=1&pwd
Encounter: Bastille Battalion
Took choice 1313/1: (secret choice)
choice.php?whichchoice=1313&option=1&pwd
Encounter: Bastille Battalion
Took choice 1313/1: (secret choice)
choice.php?whichchoice=1313&option=1&pwd
Encounter: Bastille Battalion
Took choice 1313/2: (secret choice)
choice.php?whichchoice=1313&option=2&pwd
Encounter: Bastille Battalion
Took choice 1313/3: (secret choice)
choice.php?whichchoice=1313&option=3&pwd
Encounter: Bastille Battalion
Took choice 1313/4: (secret choice)
choice.php?whichchoice=1313&option=4&pwd
Encounter: Bastille Battalion
Took choice 1313/4: (secret choice)
choice.php?whichchoice=1313&option=4&pwd
Encounter: Bastille Battalion
Took choice 1313/4: (secret choice)
choice.php?whichchoice=1313&option=4&pwd
Encounter: Bastille Battalion
Took choice 1313/5: (secret choice)
choice.php?whichchoice=1313&option=5&pwd
Encounter: Bastille Battalion (turn #1)
Took choice 1314/3: Look for cheese
choice.php?whichchoice=1314&option=3&pwd
Encounter: Cheese Seeking Behavior
Took choice 1319/3: Submit embarrassing catapult photos
choice.php?whichchoice=1319&option=3&pwd
> Getting Enhancement from Source Terminal
Encounter: Cheese Seeking Behavior
Source Terminal: enhance meat.enh
Encounter: Cheese Seeking Behavior
 

fronobulax

Developer
Guard code guarded and VMF works as expected. I paid attention and EatDrink was targeting 19 drunk, and planned 6 3 drunk drinks and a 1 drunk drink. When it consumed that drink it used the shot glass and finished with 18.

Thank you.
 

Veracity

Developer
Revision 260 uses an embedded counterScript to collect semirares and drink Lucky Lindys during external scripts - Gingerbread City, Veracity Spacegate, and Garden Harvester (which can use a turn if it harvests a skulldozer.)
 

Veracity

Developer
A generous friend gave me a Golden Mr. Accessory a few years ago. I haven't used it much. That changes today.

Revision 261 supports bestowing The Smile of Mr. A. upon your chosen (configurable) set of victims. Or friends.
It's similar to how you configure time pranks, but you can choose to bestow more than one on a particular player.

Create a file named <PLAYER_NAME>.goldens.txt in your "data" directory.
Each line is "NAME<TAB>COUNT".

If COUNT is 0, this player will not be blessed today.
If COUNT is 1, this player (might) be blessed once today
If COUNT is >1, this player (might) be blessed that many times today.

For the total number of blessings you can bestow each day:
We will randomly select a player from the set, and if the count is > 0, will bless them once.
If the count > 1, we'll decrement the count and consider them again.
Otherwise, we will remove them from the set and not consider them again today.
 

Veracity

Developer
Here's a sample script for running selected functions from VMF in-run.

Code:
import <VeracityMeatFarm>;

// All static initialization for VMF has been done.

// Here you can include your own static initialization - including your
// own vprops configuration, if you wish

// If you are going to run turns and want an internal counterScript,
// you can do it here.
boolean localCounterExpired( string label, string turns_remaining )
{
    print( "Counter '" + label + "' expires in " + turns_remaining + " turns" );
    if ( !handling_counters ) {
	print( "We are not currently handling counters in a counterScript" );
    } else {
	// *** Stuff here.
    }
    print( "Done with counter script" );

    // This means we handled it. Which is always true: we either did
    // something special or intentionally ignored it.
    return true;
}

// Or you can use VMF's which will collect semirares and drink Lucky Lindys
string VMFCounterScript = "counterExpired";
string myCounterScript = "localCounterExpired";

// This says don't use a counterScript
string use_counter_script = "";

// If you want to use a counter script, here's how
static string COUNTER_SCRIPT = "counterScript";
string new_counter_script = use_counter_script + "@" + __FILE__;
string old_counter_script = get_property( COUNTER_SCRIPT );

void main()
{
    // Here you can override VMF settings by simply setting the
    // associated internal variable to the value of your choice.
    default_familiar = my_familiar();
    mumming_costume = "none";

    // Check VMF configuration and either correct or abort
    // This will do additional dynamic configuration.
    validate_configuration();

    try {
	if ( use_counter_script != "" ) {
	    set_property( COUNTER_SCRIPT, new_counter_script );
	}

	// Run functions from VMF
	consult_with_madame_zatara();
	send_smiles();
	use_still();
    } finally {
	if ( use_counter_script != "" ) {
	    set_property( COUNTER_SCRIPT, old_counter_script );
	}
    }

    print( "Done running functions from VMF." );
}
yields this (note that I have already run VMF today, so the once-per-day things are done):

Code:
[color=green]> call VMF.InRun.ash[/color]

Validating configuration.
All is well!
Done running functions from VMF.
 

Veracity

Developer
I learned from that exercise that if you want to call VMF's main - i.e. the whole thing - from within a wrapper script, I'll need to let you configure the counter script relative to your wrapper script. Otherwise KoLmafia will try to get an interpreter for VMF itself. I'll fix that.
 

Veracity

Developer
OK, revision 262 lets a wrapper script adjust VMF's counterScript initialization.
Here's a new wrapper script.

Code:
import <VeracityMeatFarm>;

// All static initialization for VMF has been done.

// Here you can include your own static initialization - including your
// own vprops configuration, if you wish

// If you are going to run turns and want an internal counterScript,
// you can do it here.
boolean localCounterExpired( string label, string turns_remaining )
{
    print( "Counter '" + label + "' expires in " + turns_remaining + " turns" );
    if ( !handling_counters ) {
	print( "We are not currently handling counters in a counterScript" );
    } else {
	// *** Stuff here.
    }
    print( "Done with counter script" );

    // This means we handled it. Which is always true: we either did
    // something special or intentionally ignored it.
    return true;
}

// This says don't use a local counterScript: either you are calling
// main@VMF() or don't want a counterScript
boolean use_local_counter_script = false;

string VMFCounterScript = "counterExpired";
string myCounterScript = "localCounterExpired";

string counter_script_name = use_local_counter_script ? myCounterScript : VMFCounterScript;

// If you are calling main@VMF() directly, you need to fix the
// counterScript that VMF will use to be relative to this script.
// That counterScript will collect semirares and use Luck Lindys

new_counter_script = configure_counter_script( counter_script_name, __FILE__ );

void main()
{
    // Here you can override VMF settings by simply setting the
    // associated internal variable to the value of your choice.
    default_familiar = my_familiar();
    mumming_costume = "none";

    // Check VMF configuration and either correct or abort
    // This will do additional dynamic configuration.
    validate_configuration();

    try {
	if ( use_local_counter_script ) {
	    set_property( COUNTER_SCRIPT, new_counter_script );
	}

	// Run functions from VMF
	consult_with_madame_zatara();
	send_smiles();
	use_still();
    } finally {
	if ( use_local_counter_script ) {
	    set_property( COUNTER_SCRIPT, old_counter_script );
	}
    }

    print( "Done running functions from VMF." );
}
I set "use_local_counter_script" to true and ran it:

Code:
[color=green]> VMF.InRun.ash[/color]

Validating configuration.
All is well!
counterScript => localCounterExpired@VMF.InRun.ash
counterScript =>
Done running functions from VMF.
 

Veracity

Developer
Revision 267 will celebrate Arrrbor Day if you have installed my Arrrbor Day script.

This consumes turns, so it is optional. Set "VMF.CelebrateArrrborDay" to false if you don't wish to run it.

If true (the default), it will spend either 3 or 102 turns in the Arrrboretum, depending on whether it is setting up to get a potion or to complete the Arrrbor Day Apparrrrrel outfit. You can configure the script to control that.

It will run the Arrrbor Day script after eating and drinking (to generate turns) but before poisoning your spleen, since the Arrrboretum is all non-combats and it would be a waste to burn Sweet Synthesis turns.
 
I am seeing this know with the most recent daily build and version of the script. Do I have a setting wrong?

Encounter: Lending a Hand (and a Foot)
Submitting option 1 for choice 1065
Encounter: Lending a Hand (and a Foot)
Internal checkpoint created.

[24031] Madness Bakery
Encounter: Lending a Hand (and a Foot)
Manual control requested for choice #1065
choice 3: Okay, I'll be right back.
choice 6: Goodbye.
Click here to continue in the relay browser.
 

Veracity

Developer
I assume that you have a protonic accelerator and got an announcement of paranormal activity in the Madness Bakery.
When we went to the Armory and Leggery to talk to the owner and open up the location, apparently you'd already agreed to get him the pie.

What is the value of this property? questM25Armorer

I'm guessing it is "unstarted".

Set it to "started" and you won't have an issue.

I will ponder how that could be and how I can make this script resiliant in this case.
 

Magus_Prime

Active member
This may be outside the scope of what you want to handle but I just came right out of a run, pulled everything from storage, and ran your meat farm script. Initialization failed because it tried to equip my "Meat Farm" outfit and that required a Gold Detective's Badge. It wasn't in inventory because I hadn't visited the precinct.

I'm going to guess that the same thing would happen if an outfit required the L&T cowboy boots.

Would you be willing to have the script visit those locations, if available, to make sure that the badge and boots are in inventory, during initialization?

Edit: The script just stopped again with the following in the gCLI:

Code:
Cannot store string in vgc_banish of type boolean     [monster] (Gingerbread City.ash, line 644)
counterScript =>     scripts\CounterChecker.ash

I've been using Bales CounterChecker script for years. I did see that you've incorporated a counter script so I'll try removing Bale's and see what happens. Nope. Removing Bale's script from the mix didn't fix the problem.
 
Last edited:

fronobulax

Developer
This may be outside the scope of what you want to handle but I just came right out of a run, pulled everything from storage, and ran your meat farm script. Initialization failed because it tried to equip my "Meat Farm" outfit and that required a Gold Detective's Badge. It wasn't in inventory because I hadn't visited the precinct.

I'm going to guess that the same thing would happen if an outfit required the L&T cowboy boots.

Would you be willing to have the script visit those locations, if available, to make sure that the badge and boots are in inventory, during initialization?

Edit: The script just stopped again with the following in the gCLI:

Code:
Cannot store string in vgc_banish of type boolean     [monster] (Gingerbread City.ash, line 644)
counterScript =>     scripts\CounterChecker.ash

I've been using Bales CounterChecker script for years. I did see that you've incorporated a counter script so I'll try removing Bale's and see what happens. Nope. Removing Bale's script from the mix didn't fix the problem.

The fact that the outfits are named and predefined has been a feature I have had to work with. In my case, I finish a run, run the script and the outfit cannot be equipped because one or more character stats are not high enough.

In my case I have script get_outfit that looks at an outfit and makes sure that everything listed is in inventory or already equipped. It will pull from Hagnks or the display case which are the two places equipment I want end up. You could do something similar with special cases where an item is generated from a visit and not just a take/get/pull. This also seems like a job for a post Ascension script or something in an aftercore login.
 

Veracity

Developer
Code:
Cannot store string in vgc_banish of type boolean [monster] (Gingerbread City.ash, line 644)
is a compile error in Gingerbread City, due to a bug in KoLmafia, which I fixed in revision 20091.
I guess I should put a "since" directive into that script now.

Regarding outfits:

We call the "outfit" command, which will "retrieve" all the outfit pieces - pull from storage, etc. It will not pull from the display case; frono is unique in my experience in keeping things there that he wants to actually use, rather than display. :)

However, visiting the Detective School and LT&T are not known ways to "retrieve" an item.
I'll consider looking over the outfit pieces and fetching those specific items if they are needed.
However, as frono suggests, you could put it in a kingLiberatedScript. I do that myself:

Code:
    // Visit LT&T office to collect cowboy boots
    visit_url( "place.php?whichplace=town_right&action=townright_ltt" );

    // Visit 5th Precinct to collect golden detective badge
    visit_url( "place.php?whichplace=town_wrong&action=townwrong_precinct" );

For outfits you cannot equip, you might consider writing a wrapper script (as I detailed above) which will set outfit parameters differently depending on your stats.
 

Magus_Prime

Active member
I normally visit both locations when starting an aftercore run. I just forgot this time. :)
I have thought about, and will probably write, a VMF wrapper script using yours as a model.

Thank you!
 
Top