JTN's All-In-One Farming Script

slyz

Developer
You could change those main()s' names to bananafarm() and meatfarm(), and have a main that simply calls the right function depending on the character name:
PHP:
void main()
{
   if ( my_name() == "jtn2002" )
   {
      bananafarm();
   }
   else if ( my_name() == "multi1" )
   {
      bananafarm();
   }
   else if ( my_name() == "multi2" )
   {
      meatarm();
   }
}
 

slyz

Developer
Code:
> ash numeric_modifier( $item[ depleted grimacite grappling hook ], "Adventures" );

Returned: 3.0
 

Bale

Minion
Also, is there a function to return how many adventures grimacite gear will get that day?

Is that what you really want to know? There is a function to determine what you should wear to maximize your rollover adventures which takes that (and more) into consideration. Is that what you really want to know? There is also a way to determine how many rollover adventures that gear will grant you. Is that what you wanted to know? Or did slyz already tell you exactly what you need and I should butt out?

Maximize rollover adventures:
maximize("adv", false);

Determine rollover adventures without changing gear:
maximize("adv", true);
int rollover_adv = numeric_modifier("_spec", "Adventures" );
 
Last edited:

jtn2002

New member
Thanks, Bale. I got it. I'm going to revise the first post next week with what I've developed. I also am implementing your OCD Inventory Control, so I must thank you for that script. Very handy for handling all that castlecrap. I put in the data for all equipment (keep 3 of each accessory, 1 of each other slot), and mallsell rest. Also mallselling all ingests as EatDrink will optimize those each day.
 

jtn2002

New member
New issue, I'm running r10578 and every time I get cunctatitis from the giants, I get an error saying You don't have a skill uniquely matching "Disco Power Nap", and when I check in the browser, it's telling me that between battle actions are failing.

I don't want to auto-remove this status as I can still finish each adventure normally; but how do I "bypass" this stop command?
 

Bale

Minion
I'd recommend going into preferences -> General -> unselect "Auto-remove malignant status effects"
 

holatuwol

Developer
That's weird, it should only consider Disco Power Nap as a way to remove cunctatitis if you actually have the skill, but I don't have a character with low enough muscle to test getting cunctatitis to see what really happens.

Do you have Disco Power Nap as an available skill but are unable to use it for some reason?
 
Last edited:

Winterbay

Active member
Doesn't Cunctatitis make you unable to use skills, such as Disco Power Nap? I thought that was one of the things that made it so annoying...
 

holatuwol

Developer
Isn't that only in combat? And I don't see any code in KoLmafia that would make it reject trying to cast a skill out of combat just because you have Cunctatitis (assuming I'm looking in the right places).
 

Winterbay

Active member
Isn't that only in combat? And I don't see any code in KoLmafia that would make it reject trying to cast a skill out of combat just because you have Cunctatitis (assuming I'm looking in the right places).

Apparently. I thought it was both in and out of like Temporary Amnesia, but I seem to remember incorrectly.
 

jtn2002

New member
Updated the script files, again. Now each account gets done separately and I want to redo some things to make this more universally usable by all.
I suppose this is version 0.3 now.

Code:
script "1.ash"
import <EatDrink.ash>
//import <snapshot.ash>

void main(boolean meatfarm) {
	//snapshot();
	 cli_execute("crimbotree get");
	 cli_execute("set ftf_olfact=Goth Giant");
	 cli_execute("use * ten-leaf clover");

	if (my_name() != "jtn2002") {cli_execute("set valueofadventure=1000");} else {cli_execute("set valueofadventure=1300");}
	if ( (my_class() == $class[disco bandit]) || (my_class() == $class[accordion thief]) )
	{
		cli_execute("create 10 boxed c"); cli_execute("create 10 parisian cat");
	}
	if ( my_name() == "jtn2002" )
	{ 
		cli_execute("ballpit");
		cli_execute("cast vent rage gland");
		cli_execute("chips wintergreen"); cli_execute("chips wintergreen"); cli_execute("chips wintergreen");
		cli_execute("fold electric knife");
		cli_execute("friars familiar");
		cli_execute("hottub");
		cli_execute("pool 1"); cli_execute("pool 1"); cli_execute("pool 1");
		cli_execute("shower ice");
		cli_execute("summon greed");

		cli_execute("use * begpwnia");
		cli_execute("use * half-orchid");

		cli_execute("familiar hobo");
	}
	else if ( my_name() == "ed gruberman" ) 
	{ 
		cli_execute("ballpit");
		cli_execute("chips wintergreen"); cli_execute("chips wintergreen"); cli_execute("chips wintergreen");
		cli_execute("friars familiar");
		cli_execute("hottub");
		cli_execute("pool 1"); cli_execute("pool 1"); cli_execute("pool 1");
		cli_execute("shower ice");
		cli_execute("summon greed");

		cli_execute("familiar leprechaun");
	} 
	else if ( my_name() == "GKOL Trainwreck" ) 
	{ 
		cli_execute("ballpit");
		cli_execute("chips wintergreen"); cli_execute("chips wintergreen"); cli_execute("chips wintergreen");
		cli_execute("friars familiar");
		cli_execute("hottub");
		cli_execute("summon drinks");

		cli_execute("familiar leprechaun");
	}
	else if ( my_name() == "tobymac" ) 
	{ 
		cli_execute("chips wintergreen"); cli_execute("chips wintergreen"); cli_execute("chips wintergreen");
		cli_execute("ballpit");
		cli_execute("hottub");
		cli_execute("pool 1"); cli_execute("pool 1"); cli_execute("pool 1");
		cli_execute("shower ice");
		cli_execute("summon greed");

		cli_execute("familiar leprechaun");
	}
	else if ( my_name() == "dj_tobymac" ) 
	{ 
		cli_execute("chips wintergreen"); cli_execute("chips wintergreen"); cli_execute("chips wintergreen");
		cli_execute("concert Optimist Primal");
		cli_execute("fold cheese eye");
		cli_execute("friars familiar");
		cli_execute("hottub");
		cli_execute("pool 1"); cli_execute("pool 1"); cli_execute("pool 1");
		cli_execute("ballpit");
		cli_execute("shower ice");
		cli_execute("summon preternatural greed");

		cli_execute("familiar leprechaun");
	}
	else if ( my_name() == "b2412" ) 
	{ 
		cli_execute("ballpit");
		cli_execute("chips wintergreen"); cli_execute("chips wintergreen"); cli_execute("chips wintergreen");
		cli_execute("pool 1"); cli_execute("pool 1"); cli_execute("pool 1");
		cli_execute("shower ice");
		cli_execute("friars familiar");
		cli_execute("summon drinks");

		cli_execute("familiar leprechaun");
	}
	else if ( my_name() == "John Nidoman" ) 
	{ 
		cli_execute("ballpit");
		cli_execute("chips wintergreen"); cli_execute("chips wintergreen"); cli_execute("chips wintergreen");

		cli_execute("familiar leprechaun");
	}
	else if ( my_name() == "clevinger" ) 
	{ 
		cli_execute("chips wintergreen"); cli_execute("chips wintergreen"); cli_execute("chips wintergreen");
		cli_execute("friars familiar");
		cli_execute("summon drinks");

		cli_execute("familiar leprechaun");
	}
	else if ( my_name() == "Guydude" ) 
	{ 
		cli_execute("cast vent rage gland");
		cli_execute("chips wintergreen"); cli_execute("chips wintergreen"); cli_execute("chips wintergreen");
		cli_execute("friars familiar");
		cli_execute("summon greed");

		cli_execute("familiar leprechaun");
	}
	else if ( my_name() == "sammysam122000" ) 
	{ 
		cli_execute("ballpit");
		cli_execute("chips wintergreen"); cli_execute("chips wintergreen"); cli_execute("chips wintergreen");

		cli_execute("familiar leprechaun");
	}

	if (meatfarm == true)
	{
		if (item_amount( $item[""DRINK ME" potion"]) < 1 )
		{
			cli_execute("buy 1 drink me");
		}
		cli_execute("hatter 22");
	}
	cli_execute("maximize meat");
	if ( my_name() == "jtn2002" || my_name() == "ed gruberman" || my_name() == "GKOL Trainwreck" || my_name() == "tobymac" || my_name() == "b2412" || my_name() == "John Nidoman")
	{
		cli_execute("fold cheese eye");
		cli_execute("equip acc3 stinky cheese eye");
	}

	SIM_CONSUME = false; // This is for EatDrink
	cli_execute("use 2 milk of mag");
	eatdrink(fullness_limit(), inebriety_limit(), spleen_limit(), false);

	// BURN TURNS!

	if (meatfarm == true)
	{
		cli_execute("adventure * giant's castle");
	}
	else
	{
		int turns = my_adventures();
		//Autoselects the "Escape" option to harvest bananas 
		set_property("choiceAdventure452", "3"); 
		//Autoselects the 2= "Hide behind a hair" option to gain some stats 
		//Change to 1 to fight a scabie or 3 to get hair of the calf 
		set_property("choiceAdventure453", "1"); 
		string checktubes; 
		string insertion; 
		while(my_adventures() > 0 && turns > 0)
		{ 
			print("Inserting banana...","blue"); 
			checktubes = visit_url("inv_use.php?whichitem=4560&place=tubes&pwd"); 
			if ( !contains_text(checktubes, "You can currently see a banana bouncing around inside the machine.") )
			{
				insertion = visit_url("inv_use.php?action=addfruit&pwd&whichitem=4560&whichfruit=2373"); 
				if ( !contains_text(insertion, "The banana disappears into the tube")  && !contains_text(insertion, "The banana is sucked into the tube") ) 
					abort("The banana didn't fit in the tube!"); 
				else
					print("Banana inserted, adventuring until fulfilled.","green"); 
			}
			else
				print("There's already a banana in there!","green"); 
			set_property("lastEncounter", ""); 
			while(my_adventures() > 0 && turns > 0 && get_property("lastEncounter") != "Leave a Message and I'll Call You Back")
			{
				adventure(1, $location[small-o-fier]); 
				turns = turns - 1; 
				print("Turns left: "+turns, "olive");
			}
		}
	}

	if ( my_name() == "jtn2002" || my_name() == "ed gruberman" || my_name() == "GKOL Trainwreck" || my_name() == "tobymac" || my_name() == "b2412" || my_name() == "John Nidoman")
	{
		cli_execute("fold cheese diaper");
	}

	if ( my_name() == "jtn2002" ) 
	{ 
		cli_execute("fold moondial");
		cli_execute("familiar hand");
	}
	cli_execute("maximize adv");
	cli_execute("hottub");
	if (( my_name() == "b2412" ) || ( my_name() == "GKOL Trainwreck" ))
	{
		cli_execute("cast ode");
		cli_execute("drink bucket");
		cli_execute("logout");
	}
}

and if I don't have ode, then request ode and run the following:

Code:
script "3.ash"

void main() {
   if (have_effect($effect[Ode to Booze]) < 1)
      repeat {wait(5); refresh_status();}
      until (have_effect($effect[Ode to Booze]) > 1);
   if ( my_name() == "jtn2002" ) 
   { 
     cli_execute("overdrink corpse island");
   }
   else
   {
     cli_execute("overdrink bucket of wine");
   }
   cli_execute("logout");
}

Yeah, everyone's dumping accounts on me due to this.

I hate using if my_name to handle things, is there a way to say "if I have this item" or "if I have this skill" instead?

Thanks a bunch,
JTN2002, first time coder.
 

Winterbay

Active member
Code:
if(have_skill($skill[])) and if(item_amount($item[]) > 0)
That would be two ways of checking for items and skills.
 
Top