Get Slimy

gemelli

Member
To be fair, I was playing with a modified version of the script that ignored the damage calculations altogether. Basically, I set Mafia's HP/MP restore to aggressive levels, and simply looked for $effect[Covered in Slime] to equal 5 before deciding whether to use a chamois or hot tub.

I'm out of turns now, but will play with the revised logic tomorrow (I didn't know about run_combat, which says a lot about how out-of-date my ASH knowledge is :) ). Thanks again for the continued support.
 

Rinn

Developer
I would suggest you wait until he addresses the issues I brought up, I believe the logic used in this script isn't correct and won't have the desired effect.
 

cankergoyle

New member
hrm...I can't seem to even get the outfit change to work for me. Here is the output from DEBUG:

[NORMAL] <- true
Param #1: min_ml_outfit
[NORMAL] <- "mlminus f:volleyball m:mlminus"
Entering function outfit
You can't wear that outfit.
Function outfit returned: false
[EXIT] <- false

Outfit is already defined and works in CLI:
> outfit mlminus

Putting on mlminus...
You are already wearing "mlminus."

familiar is there. mood is set.

Am I missing something obvious here?
 

Rinn

Developer
I don't think that mood call works either. Anyway, I fixed the script, take note of a few changes. Ur-kel should be in the mood you use when maximizing ml if you want it, there was no reason for it not to be. I also separated out the mood, outfit, and familiar into 3 different globals, and defaulted tattering and using the vip hot tub to false.
 

Attachments

  • slime.ash
    3.9 KB · Views: 54
Last edited:

cankergoyle

New member
Rinn's script works as advertised for tatter=false, but should probably caveat that for tatter=true, one must use something that is not susceptible to mafia's auto-setting of the auto-attack feature (which overrides the tatter when one just has 'attack with weapon' set as default). The script works for me once I disable auto-attack and setup a custom combat script with 'attack with weapon' as my default instead.

amazingly useful script. thanks!
 

salien

New member
I also whacked it into working shape (the incorrect usage of the elemental resistance calculation was what took me a bit, heh). I left in the aria special case handling, and removed the mood changes as there really isn't any reason to use a different mood for the low-ml version; aria's the only buff worth changing, as it only matters if you cross a multiple of 100 ML. For similar reasons I left out the MCD-changing Rinn added; it doesn't affect the number of turns of Coated I get, and it saves on server hits, also speeding the whole thing up.

This version of the script is currently set to use tatter, with green smoke bombs as the tatter-equivalent. And I've used it just perfectly on 2 speed runs now. :)
 

Attachments

  • slimetatter.ash
    3.8 KB · Views: 63

Rinn

Developer
I forgot you can check current MCD with current_mcd(), that would reduce the server hits.
 

BDragon

New member
You can; it depends on how close you're willing to cut it if the slimes are capable of hitting you, since tatters are unreliable (especially without funkslinging).

I figured it was the unreliability, since it could be multiple rounds before you actually get out. I assume "without funkslinging" means the fact that you can't funksling them, so you've always got a 50% chance you're stuck in the fight that round.
 

salien

New member
I figured it was the unreliability, since it could be multiple rounds before you actually get out. I assume "without funkslinging" means the fact that you can't funksling them, so you've always got a 50% chance you're stuck in the fight that round.

Uh... You can funksling them; I do it all the time... Was just doing it yesterday, in fact, and am absolutely certain I saw 2 used in a single round.

I've seen people talk about them only appearing in the top item box on the old-style combat form. I never use that form, I just use left-click right-click to funksling them with the CAB, or assign them to a number and hit that number twice. Mafia is also fine with funkslinging them if I set my combat action to "item tattered scrap of paper". It certainly doesn't make any sense to not be able to funksling them, since KoL's code now processes items sequentially and won't use the second item if the first one ends the combat.

Are you also unable to funksling green smoke bombs/divine champagne poppers?
 

Alhifar

Member
A note to anybody using this script: It really SHOULDN'T work. >.<
The effect name is COATED in Slime, not COVERED in Slime. D'oh! In any case, here's an updated version. It includes all of the fixes included above, plus I've added back in MCD support; change_mcd() only makes a server hit if the mcd is not already set to that value.
 
Last edited:

Alhifar

Member
I must have uploaded the wrong version. Sorry about that.

This version has a new, untested feature. It will switch to another clan, presumably one with no bladders squeezed, for the single adventure for gaining more turns of Coated in Slime. Please include at least a CLI output with any bug report.

Newest version is always at http://alhifar.dyndns.org/mafia/scriptlets/slime.ash and the script will prompt you to update whenever a new version is released.
 
Last edited:

Rinn

Developer
I don't think you can call adventure(1, $location[slime tube]) because the tattering makes the adventure not get consumed so it'll keep adventuring.
 

Alhifar

Member
Crap. I was trying to remember why I made that change. I figured I'd just done something stupid because I was coding way too late. >.< Fixed.
 

uknowforkids

New member
Hi Alhifar,

I've customized the script according to the instructions, but I'm pretty new to this script business and can't get it to work. I set a condition in my default mood, "Always, call slime.ash." When I try to adventure with that condition through the Mafia interface, I get this error message:

Expected ), found run_combat (slime.ash, line 156)

Any suggestions? I appreciate the script, and would love to get it working, as I'm going for a 2 nodule run right now. Thanks!
 
Last edited:

Bale

Minion
His script isn't for mood maintenance. It's for automation. Put it in kolMafia's /script directory and then you can type call slime.ash in the CLI
 

Bale

Minion
Took a look at the code for his latest version and it seems Alhifar made a boo-boo. Go to line 156 and add a second closing parenthesis. Or, if you just want to copy-paste...

Code:
## Slime Speed Run Script by Alhifar
notify Alhifar;

string version = "1.3.3";
string download_location = "http://alhifar.dyndns.org/mafia/scriptlets/";

## Outfit names may include "f=familiar name" and "m=mood name" to specify a mood/familiar to use.
## Note that the script takes care of aria, so it should NOT be in the mood being used.
string max_ml_outfit = "maxml f=purse rat";
string min_ml_outfit = "minml f=volleyball";

## Set use_tatter_like to true to use a tatter to escape from combat, or to false to simply kill the slime and use an adventure.
## Set which_tatter to which tatter-like item to use to escape from combats
## Reccommended not to use tattered scraps as your tatter-like, large chance of failure makes them inefficient. 
boolean use_tatter_like = true;
item which_tatter = $item[divine champagne popper];

## Set jump_clan to the clan that you will jump to when getting Coated in Slime at max turns!
## This should be a clan without any bladders squeezed in their tube. Leave blank to disable switching clans.
string jump_clan = "";

boolean use_hottub = true;

## End Options 

## Do not modify anything below this line unless you know what you are doing!
###################################################

float[int] slime_percent;
slime_percent[1] = 5.334167;
slime_percent[2] = 4.001677;
slime_percent[3] = 2.9025;
slime_percent[4] = 2.016667;
slime_percent[5] = 1.325;
slime_percent[6] = .805833;
slime_percent[7] = .4391667;
slime_percent[8] = .200833;
slime_percent[9] = .066667;
slime_percent[10] = 0;

int min( int a , int b )
{
	if( a < b ) return a;
	return b;
}

boolean check_version()
{
	return visit_url( download_location + "slime_ver.txt" ).to_string() == version;
}

int slime_damage()
{
	int damage = my_maxhp() * slime_percent[ min( have_effect( $effect[Covered in Slime] ) , 10 ) ];
	return ceil( damage * ( ( 100 - elemental_resistance( $element[slime] ) ) / 100 ) ) + expected_damage( $monster[slime1] );
}

boolean chamois()
{
	visit_url( "clan_slimetube.php?action=chamois" );
	if ( have_effect( $effect[Coated in Slime] ) > 0 )
	{
		## Tub code stolen... err... "borrowed" from matt.chugg
		print( "Chamois failed!" , "red" );
		if( use_hottub && get_property( "_hotTubSoaks" ).to_int() < 5 )
		{
			print ( "Using VIP bath..." );
			cli_execute( "soak 1" );
			if ( have_effect( $effect[Coated in Slime] ) > 0 )
			{
				return false;
			}
			return true;
		}
		return false;
	}
	print( "Chamois successfully used." );
	return true;
}

int max_mcd()
{
	return 10 + ( in_mysticality_sign().to_int() );
}

boolean join_clan( string clan_name )
{
	## Find clan number
	buffer find_clan = visit_url( "clan_signup.php?action=search&searchstring=" + clan_name.url_encode() + "&whichfield=1&searchform=Search&countoper=0&countqty=&furn1=0&furn2=0&furn3=0&furn4=0&furn5=0&furn9=0&pwd" );
	if( contains_text( find_clan , "(Search returned no results.)" ) )
	{
		print( "No clan named " + clan_name + " exists! Check that you correctly spelled the clan name." );
		return false;
	}
	string clan_num;
	matcher m_clan = create_matcher( "showclan.php\\?recruiter=\\d&whichclan=(\\d+)" , find_clan );
	if( m_clan.find() )
	{
		clan_num = m_clan.group( 1 );
	}
	else
	{
		abort( "Something happened! This shouldn't ever happen! Yell at Alhifar!" );
	}
	
	## Join clan
	buffer apply = visit_url( "showclan.php?recruiter=1&whichclan=" + clan_num + "&action=joinclan&apply=Apply+to+this+Clan&confirm=on&pwd" );
	if( contains_text( apply , "Recent Announcements" ) )
	{
		print( "Successfully joined " + clan_name + " on a whitelist!" , "green" );
		return true;
	}
	else if( contains_text( apply , "You have submitted a request to join" ) )
	{
		print( "Successfully applied to " + clan_name + "! You will receive a message when your application is processed!" , "blue" );
		return false;
	}
	else
	{
		print( "Could not join " + clan_name + "! You may already be a member of this clan." , "red" );
		return false;
	}
	print( "Error, the impossible occured!" , "red" );
	return false;
	
}

string get_clan()
{
	string hall = visit_url( "clan_hall.php" );
	matcher m_clan = create_matcher( "<td><center><b>([^<]+)</b><br>" , hall );
	if( m_clan.find() )
	{
		return m_clan.group( 1 );
	}
	return "none";
}

string run_adv( string page_text )
{
	matcher m_choice = create_matcher( "whichchoice value=(\\d+)" , page_text );
	while( contains_text( page_text , "choice.php" ) )
	{
		m_choice.reset( page_text );
		m_choice.find();
		string choice_adv_num = m_choice.group( 1 );
		
		string choice_adv_prop = "choiceAdventure" + choice_adv_num;
		string choice_num = get_property( choice_adv_prop );
		
		if( choice_num == "" ) abort( "Unsupported Choice Adventure!" );
		
		string url = "choice.php?pwd&whichchoice=" + choice_adv_num + "&option=" + choice_num;
		page_text = visit_url( url );
	}
	if( contains_text( page_text , "Combat" )) run_combat();
	return page_text;
}

void main( int adv_to_use )
{
	if( !check_version() )
	{
		if( !user_confirm( "You do not have the latest version of the script!\nYou can download the latest version from " + download_location + "slime.ash.\nWould you still like to continue?" ) )
		{
			abort( "Download the latest version from " + download_location + "slime.ash" );
		}
	}
	string old_action;
	string page_text;
	string my_clan = get_clan();
	if( adv_to_use < 1 ) adv_to_use = my_adventures();
	cli_execute( "autoattack disabled" );
	while( my_adventures() > 0 && adv_to_use > 0 )
	{
		if( have_effect( $effect[Coated in Slime] ) == 0 )
		{
			if( jump_clan != "" )
			{
				if( !join_clan( jump_clan ) ) abort( "Clan joining failed! Check that you have the correct clan name!" );
			}
			outfit( min_ml_outfit );
			change_mcd( 0 );
			if( have_skill( $skill[Ur-Kel's Aria of Annoyance] ) )
			{
				cli_execute( "uneffect Ur-kels" );
			}
			if( use_tatter_like )
			{
				old_action = get_property( "battleAction" );
				set_property( "battleAction" , "item " + which_tatter.to_string() );
			}
			page_text = visit_url( to_url( $location[The Slime Tube] ) );
			page_text = run_adv( page_text );
			if( use_tatter_like )
			{
				set_property( "battleAction" , old_action );
			}
			if( jump_clan != "" )
			{
				if( !join_clan( my_clan ) ) abort( "Clan return failed!" );
			}
		}
		else if( slime_damage() > my_maxhp() )
		{
			if( !chamois() ) abort( "Slime removal failed! You won't survive another turn!" );
			if( !restore_hp( my_hp() + slime_damage() + expected_damage( $monster[slime1] ) + 10 ) ) abort( "Unable to restore HP!" );
		}
		else
		{
			outfit( max_ml_outfit );
			change_mcd( max_mcd() );
			if( have_skill( $skill[Ur-Kel's Aria of Annoyance] ) && have_effect( $effect[Ur-Kel's Aria of Annoyance] ) == 0 )
			{
				use_skill( 1 , $skill[Ur-Kel's Aria of Annoyance] );
			}
			adventure( 1 , $location[The Slime Tube] );
			adv_to_use = adv_to_use - 1;
		}
	}
}
 
Top