Slime Tube Adventuring Script

I love this script and have been using it a lot to level a character up to where he can take on super hodgman, and while I am at it making a lot of fiends by getting them nodules for the cost of a reset.

I do have one request, is it possible to have the script only use 1 tatter like when you have a character that has funkslinging? I hate using 2 divines when I only need to use 1 (slimeling runs only)
 
Was thinking it might be nice to add the option to abort if you aren't in the "right" clan, for those of us who hop around to enjoy chat in one clan & tubing in another. Really easy using the function Grotfang & I worked on today:
Code:
int clan_id() {
    string x = visit_url( "showplayer.php?who=" + my_id().to_string() );
    string clan_num = "";
    
    if( contains_text( x , "showclan.php?whichclan=" ) )     {
        matcher mat = create_matcher("whichclan\=(\\d+)",x);
        if(find(mat)) clan_num = group(mat,1);
    }
        return clan_num.to_int();
}
 
Nice! That can be simplified a bit:

Code:
int clan_id() {
   matcher mat = create_matcher("whichclan\=(\\d+)",visit_url( "showplayer.php?who="+my_id().to_string()));
   if (find(mat)) return to_int(group(mat,1));
   return 0; 
}

(protective gloves and tongs were used while editing this function)
 
Yeah, I didn't bother going beyond getting what I was given to work. ;) Hey, I'm wondering, both for the wiki and elsewhere (mostly cause I've had issues with it before)... what do you get as a result of visit_url() if the request times out? Blank string, or what? A matcher would just fail to find anything on a blank string, but abort if it was never set, correct?
 
I'm very amused that the code just posted is nearly identical to something I wrote yesterday as part of a script to hop to BAfH, get a buff and hop back.

PHP:
int origin_clan() {
	matcher clan = create_matcher("whichclan\=(\\d+)", visit_url("showplayer.php?who="+ to_string(my_id())));
	if(clan.find())
		return clan.group(1).to_int();
	return 0;
}


A matcher would just fail to find anything on a blank string, but abort if it was never set, correct?
There's no difference. If it is never set, then it is the default string = "";
 
And by that I mean that I dont know how to activate the scripts, I can fill in the "blanks" so to say, but not load it in Mafia...
 
And by that I mean that I dont know how to activate the scripts, I can fill in the "blanks" so to say, but not load it in Mafia...

First, the script should be placed in your "scripts" directory or a sub-directory thereof. The "scripts" directory should exist at the same level as "session," "data," etc. If it doesn't exist, you may need to create it. After that, it's pretty simple; you can either go to the "Scripts" menu from KoLmafia & select it (selecting "Refresh" first if it doesn't show up), or you can just type "slime.ash" into the gCLI. Either way, you'll need to specify the number of adventures to spend. If you call it from the gCLI, you can just pass that as a parameter; ie "slime.ash 20" will run the script for 20 adventures.
 
I've been doing some slimeling runs using the script and have run into a problem where it does not shrug off Aria. I see the line of code responsible for this but I'm not sure how to understand it.
PHP:
case extra_ml <= numeric_modifier( "ur-kel's aria of annoyance" , "Monster Level" ) && have_skill( $skill[Ur-Kel's Aria of Annoyance] ):

				cli_execute( "uneffect Ur-kels" );

My best guess is that extra_ml is compared to the ML provided by aria, in my case 60. I have no idea how to read the line that sets extra_ml however.
PHP:
			int extra_ml = ( bladders * 20 + numeric_modifier( "Monster Level" ) ) % 100;
Ok, bladders*20 is 100, I guess numeric_modifier( "Monster Level") is what mafia displays as +ML, but what is the % 100?
So I'm real unclear what the intended affect is. I want it to shrug aria before getting coated in slime but that isn't happening. In my case shrugging aria when getting slimed at minml means 1 more turn of coated in slime, which in turn means using a lot fewer tattered scraps. The MP to recast aria is a lot cheaper than the scraps.

In short, how do I make it always shrug aria before getting coated in slime?
 
In short, I don't know the answer, but I can tell you about % 100; % is the modulus operator, and gives the remainder. So extra_ml is the remainder when ML is divided by 100.

I don't think this actually helps you, but at least now you understand the code a little bit better.
 
Ok, bladders*20 is 100, I guess numeric_modifier( "Monster Level") is what mafia displays as +ML, but what is the % 100?
So I'm real unclear what the intended affect is. I want it to shrug aria before getting coated in slime but that isn't happening. In my case shrugging aria when getting slimed at minml means 1 more turn of coated in slime, which in turn means using a lot fewer tattered scraps. The MP to recast aria is a lot cheaper than the scraps.

In short, how do I make it always shrug aria before getting coated in slime?
Are you sure that shrugging mafia will cause an extra turn of coated in slime? The code you are asking about checks to see if your total monster level will be reduced to the next 100ML break point to decide if it will help to shrug it.

As aqualectrix says, extra_ml is the remainder of all ML plus the bladder squeezing ML divided by 100.

The other line compares extra_ml to the value of your Aria bonus to ML. If aria's ML bonus is greater than or equal to extral_ml (and you have the skill aria), then it will shrug it. Otherwise there is no advantage to shrugging it.
 
Yes, now I see it. My minml changed due to loss of a buff, putting me just under the point where shrugging mattered. Seems to be working as expected. I'd noticed the script sometimes shrugging and sometimes not shrugging during other runs, so I'm glad to understand how it works anyway. Thanks for the info!
 
I've got my ML at exactly 100 for my minml outfit (including MCD, Ur-kel's, and squeezes), yet the script keeps setting my MCD to 0 for minml fights. I'm sure it's exactly 100ML with the MCD at 10, because when I do the fight manually, I get 10 turns of Coated in Slime. Not that big of a deal, just wondering what's up with it.
 
I suppose the change would be
int extra_ml = ( bladders * 20 + numeric_modifier( "Monster Level" ) - 1 ) % 100;
just to nail this corner case.
 
Back
Top