First Things First -- a multipurpose pre-combat consult script

Status
Not open for further replies.
I think line 343 (and 345?) is missing a "break;". FTF kept trying to use a plus-size phylactery on dirty thieving brigands
 
You're right -- there were two missing "break"s. Fixed locally. I think enough things have been fixed that it's about time to update on the site and annoy my users with improved functionality. :)
 
This is a great script however, I am always getting an unable to macrofy due to action: consult FirstThingsFirsh.ash. Any tips?
 
Consult scripts cannot be macrofied. The "unable to macrofy" message is informational, not an error.

However, zarqon may change the rules in a surprising way once he's worked the bugs out of his next version. (I await it eagerly.)
 
I see. I thought it wasn't working for some reason because my character is outright just attacking with a finger cymbal as a sauceror. Thanks for the info.
 
Pasta ghost summoning is no longer restricted the first round of combat, nor does it require you to get the jump. It should probably be moved to the post-noodle section.
 
I know it's not a proper item, but one of my recent changes that should make the Island battle much less annoying is auto-cleeshing the NSN here. I put it into the use_special_item function, since that was parsing through monsters already. If there's somewhere else where it would make more sense, that would probably be good. Also, if there's a good/easy way to check estimated damage, that could be done as well... if the NSN is going to die to your weapon anyways, no reason to lose out on an adventure... but better to cleesh and move on than waste 30 turns in automation. :) Anyways, here's what I've currently got to remove the NSN.
Code:
      case $monster[naughty sorority nurse]: if (have_skill($skill[cleesh]) && my_mp() >= mp_cost($skill[cleesh]))
         page = act(use_skill($skill[cleesh])); break;
 
Last edited:
How easy would it be to treat gremlins as a special case so as to flyer them more gracefully if one has funkslinging? Specifically, hold off flyering until we know whether they have the tool or not and, if they do have it, use the flyer and molybdenum magnet together.
 
Guy made of bees fight just summoned a pasta combat rather than flyering him?

I thought I saw something about this being fixed a long while ago...? I could have swore this came up back in the spring but I can't find the post.

Thanks.

~~~~~~~~~~

[939] Haunted Bathroom
Encounter: Having a Medicine Ball
choice.php?whichchoice=105&option=3&pwd
Encounter: The Guy Made Of Bees
Round 0: Joe wins initiative!
Round 1: Joe summons Rammerhusk the Undead Elbow Macaroni!
Round 2: You focus your thoughts and call out to Rammerhusk. He claws his way up from beneath the ground at your feet.
Round 2: You are mentally exhausted by the effort of summoning Rammerhusk.
Round 2: Rammerhusk bites your opponent for 9 damage.
Round 2: the guy made of bees takes 9 damage.
You lose 37,533 hit points
 
Last edited:
Autolearn Rave Combos

Lovely package, but one things that irks me is it while it will learn the moves through SS, nothing helps in learning the combos, which FTF can't use unless it knows them. In the mean time, I've been using my own script to automate learning the different combos. I've test it with several characters, all of them Disco Bandits (surprise!). Considering how FTF is intended to learn things out quickly, I figured I'd share my bit of code.
PHP:
boolean rave_collected(){ return
(have_skill($skill[Run Like the Wind])&&have_skill($skill[Pop and Lock It])&&have_skill($skill[Break It On Down]));}
boolean rave_master(){ return( get_property("raveCombo1")!="" && get_property("raveCombo2")!=""
&& get_property("raveCombo3")!="" && get_property("raveCombo4")!=""
&& get_property("raveCombo6")!="" && get_property("raveCombo5")!="");}
if(rave_collected()){
while(!rave_master()){
string[int]combomix;
combomix[1]="Run Like the Wind,Pop and Lock It,Break It On Down";
combomix[2]="Run Like the Wind,Break It On Down,Pop and Lock It";
combomix[3]="Pop and Lock It,Run Like the Wind,Break It On Down";
combomix[4]="Pop and Lock It,Break It On Down,Run Like the Wind";
combomix[5]="Break It On Down,Run Like the Wind,Pop and Lock It";
combomix[6]="Break It On Down,Pop and Lock It,Run Like the Wind";
boolean[int]combodone; for i from 1 to 6 combodone[i]=false;
string whattodo;
for x from 1 to 6{
	for y from 1 to 6{
		if(combomix[x]==get_property("raveCombo"+y)) combodone[x]=true;}}
for z from 1 to 6{
	if(!combodone[z]){
		foreach j,movement in split_string(combomix[z],","){
			whattodo+="skill "+to_int(to_skill(movement))+";";}
		visit_url("fight.php?action=macro&macrotext="+whattodo); whattodo="";}}}}
I'd try to find a way to work it in to FTF myself, but good heavens, your code scares me! Seriously, though, I'm afraid of breaking it.

And if it turns out that this has been in existence already, I'm going to go hide. Somewhere.
 
CCS line "combo Random Rave"? In theory it should call the random rave bits in the disco combat helper, if I'm reading the code correctly.
 
combo Random Rave? First off, where the heck is that even listed?! Heh, and second, I offer this for completeness. My CCS has pretty much been "consult SS and then attack" or rather spamattack. I like thing nice and tidy ^^ And if I can help a little, so much the better.
(No, really, where is the combo Random Rave listed? If there's docs I'm missing, I wanna read!)
 
For info, here is the combo-learning section of nemesis.ash:
Code:
nt num_rave_skills_known()
{
	int num = 0 ;
	foreach sk in $skills[ Break It On Down, Pop and Lock It, Run Like the Wind ]
		if ( have_skill( sk ) ) num += 1 ;
	return num ;
}

int num_combos_known()
{
	int num = 0 ;
	if ( get_property( "lastNemesisReset" ) != get_property("knownAscensions") ) return num;
	for i from 1 to 6
		if ( get_property( "raveCombo" + i ) != "" ) num += 1;
	return num ;
}

boolean identify_combo()
{
	if ( get_property( "lastNemesisReset" ) != get_property("knownAscensions") ) return false;
	if ( get_property( "raveCombo5" ) != "" ) return true;
	if ( num_combos_known() < 5 ) return false;
	
	// 5/6 Rave combos have been identified, the last one is Rave Steal
	vprint( "Identifying last Rave combo", "green", 4 );
	string [ int ] rave_possible;
	rave_possible[ 1 ] = "Break It On Down,Pop and Lock It,Run Like the Wind";
	rave_possible[ 2 ] = "Break It On Down,Run Like the Wind,Pop and Lock It";
	rave_possible[ 3 ] = "Pop and Lock It,Break It On Down,Run Like the Wind";
	rave_possible[ 4 ] = "Pop and Lock It,Run Like the Wind,Break It On Down";
	rave_possible[ 5 ] = "Run Like the Wind,Pop and Lock It,Break It On Down";
	rave_possible[ 6 ] = "Run Like the Wind,Break It On Down,Pop and Lock It";
	
	for i from 1 to 6
	{
		boolean known = false;
		for j from 1 to 6
		{
			if ( get_property( "raveCombo" + j ) == rave_possible[ i ] )
			{
				known = true ;
				break;
			}
		}
		if ( !known )
		{
			set_property( "raveCombo5", rave_possible[ i ] );
			break;
		}
	}
	return true;
}

// combat filter, needs to be at the top level
string randrave( int rnd, string opp, string text )
{
	vprint( num_combos_known() + "/6 combos known","green", 4 );
	if ( num_combos_known() < 5 ) return "combo Random Rave";
	return "attack";
}

boolean learn2combo()
{
	if ( num_rave_skills_known() < 3 ) return vprint( "You have not learned all the Rave skills, exiting...",-1 );
	if ( get_property( "raveCombo5" ) != "" && get_property( "lastNemesisReset" ) == get_property( "knownAscensions" ) )
		return vprint( "Rave Steal combo already identified.",6 );
	if ( my_adventures() == 0 ) return vprint( "Out of adventures.",-1 );
	vprint( "Testing combos...","green",2 );
	
	// adventure outside the club until you identify Rave Steal
	if ( my_buffedstat( $stat[ moxie ] ) < ( 155+monster_level_adjustment() ) )
		cli_execute( "maximize moxie, -melee, -ML, -familiar" );
	use_familiar( best_fam("delevel") );
	set_property( "autoEntangle", "false" );
	
	while ( my_adventures() > 0 )
	{
		if ( my_mp() < 20 && !restore_mp( 20 ) ) return vprint( "Out of MP, exiting... please configure Mafia's automatic MP restoring",-1 );
		adventure( 1 ,$location[ Outside the Club ], "randrave" );
		if ( identify_combo() ) return vprint( "Rave Steal combo identified.",6 );
	}
	return vprint( "Out of adventures, exiting...",-1 );
}

It's an example of using "combo Random Rave". The only real (little) optimization is figuring out the last unknown combo without actually doing it.

learn2combo() isn't really relevant for FTF, I just put it there for completeness. I didn't test it extensively though, not in the current state at least. And this snipet only tries to identify the Rave Steal combo, so identify_combo() should become identify_last_combo() and be tweaked to work properly.
 
I don't think it's been documented, but:
line 824 of CustomCombatManager.java points to line 304 of DiscoCombatHelper.java, which then looks up the combo in COMBOS, which is located in that same file, lines 119-169. Line 166 is "Random Rave". (CustomCombatManager looks for "combo (.*)", then passes the first captured group to DiscoCombatHelper. The code technically doesn't use regexps, but they're mostly easier to read right off the bat than substrings.)

The closest to documentation that I recall seeing was "combo rave steal" being mentioned as usable in a CCS, so that led me to dig around in the code.
 
Slyz, thanks for the example. I've been learn bits and pieces here and there and some of that I think I can put to use down the road. I don't have much experience doing CCS, save for what little macro I purloined.
3hee, either you're showing off or... Nah, you're showing off ^^ Seriously though, I would have never thought to look for that in the code, let alone be able to read it from the code. Sometimes I wonder if this old dog can learn new tricks.
 
I saw that the Disco Combo Helper Veracity added for the Relay Browser had a "random rave" button, so I poked around in the code and figured a CCS would accept "combo Random Rave", just like heeheehee described.

In my example, "combo Random Rave" is returned from the consult function (or combat filter), but in FTF, Zarqon uses visit_url() or specific ASH functions to carry out actions. I just realized this, and I guess the "combo Random Rave" solution won't work for FTF.
 
I wonder if having that in the visit_url() text might work somehow, considering how Mafia has to somehow retrieve that input if you click the little button thingy in the relay browser. Not entirely sure, but either Mafia will interpret it specially, or it'll generate HTML that encodes a combo you don't know. Will test in a bit.

Edit: Nope, it generates HTML with generated skills in it, as far as I can tell.
 
Last edited:
Status
Not open for further replies.
Back
Top