Feature - Implemented Add rave combo learning to "special action"

Rinn

Developer
I would like to see an additional option for special action which will automatically learn a rave combo if possible.

Alternatively a new command "combo learn" could be added with the same functionality.

I understand his wouldn't be that difficult to do with a consult script but I'd much prefer being able to use combat macros.
 

jasonharper

Developer
Putting combo random rave in your CCS should do this already (except for the already-reported detail that it doesn't infer the 6th combo after learning five combos). This line won't do anything until you've learned the three basic rave skills, and will stop doing anything once you've learned all combos.
 

Veracity

Developer
Staff member
(except for the already-reported detail that it doesn't infer the 6th combo after learning five combos)
Revision 8920 supposedly infers the 6th combo when there is only one unknown combo left. Unfortunately, I finished my DB Nemesis this run before coding this up and will be going away until Monday and will have no chance to check it any time soon.

If anyone would like to test this, I'd be appreciative.
 

Rinn

Developer
Revision 8920 supposedly infers the 6th combo when there is only one unknown combo left. Unfortunately, I finished my DB Nemesis this run before coding this up and will be going away until Monday and will have no chance to check it any time soon.

If anyone would like to test this, I'd be appreciative.
I just got around to learning some db rave combos and I can say the 6th combo is not inferred, and it seems like it will never be learned from "combo random rave":

Code:
[1116] Outside the Club
Encounter: pop-and-lock raver
Strategy: C:\Users\Rinn\Documents\My Dropbox\kolmafia\ccs\ascension.ccs [pop-and-lock raver]
Round 0: Epicgamer loses initiative!
Round 1: Epicgamer executes a macro!
Round 1: Epicgamer casts GOTHY HANDWAVE!
You learned a new skill: Pop and Lock It
Round 2: Epicgamer attacks!
Round 3: pop-and-lock raver takes 159 damage.
Round 3: Epicgamer attacks!
Round 4: pop-and-lock raver takes 125 damage.
Round 4: Epicgamer wins the fight!
After Battle: Spicy smiles a three-lipped smile from beneath the shade of his little sombrero.
You gain 17 Muscleboundness
You gain a Muscle point!
You gain 18 Mysteriousness
You gain 21 Sarcasm

Libram summon #16 when MP > 230.

Request 21 of 129 (Volcano: Outside the Club) in progress...

[1117] Outside the Club
Encounter: pop-and-lock raver
Strategy: C:\Users\Rinn\Documents\My Dropbox\kolmafia\ccs\ascension.ccs [pop-and-lock raver]
Round 0: Epicgamer loses initiative!
Round 1: Epicgamer executes a macro!
Round 1: Epicgamer casts RUN LIKE THE WIND!
Round 2: pop-and-lock raver takes 10 damage.
Round 2: Epicgamer casts POP AND LOCK IT!
Round 3: pop-and-lock raver takes 13 damage.
Round 3: Epicgamer casts BREAK IT ON DOWN!
You gain 2 Chutzpah
You gain 2 Wizardliness
Round 4: Epicgamer casts RUN LIKE THE WIND!
Round 5: pop-and-lock raver takes 10 damage.
Round 5: Epicgamer casts POP AND LOCK IT!
Round 6: pop-and-lock raver takes 10 damage.
Round 6: Epicgamer casts BREAK IT ON DOWN!
Round 7: pop-and-lock raver takes 7 damage.
Round 7: Epicgamer casts RUN LIKE THE WIND!
Round 8: pop-and-lock raver takes 8 damage.
Round 8: Epicgamer casts POP AND LOCK IT!
Round 9: pop-and-lock raver takes 13 damage.
Round 9: Epicgamer casts BREAK IT ON DOWN!
Round 10: pop-and-lock raver takes 9 damage.
Round 10: Epicgamer casts RUN LIKE THE WIND!
Round 11: pop-and-lock raver takes 7 damage.
Round 11: Epicgamer casts POP AND LOCK IT!
Round 12: pop-and-lock raver takes 12 damage.
Round 12: Epicgamer casts BREAK IT ON DOWN!
Round 13: pop-and-lock raver takes 5 damage.
Round 13: Epicgamer casts RUN LIKE THE WIND!
Round 14: pop-and-lock raver takes 7 damage.
Round 14: Epicgamer casts POP AND LOCK IT!
Round 15: pop-and-lock raver takes 11 damage.
Round 15: Epicgamer casts BREAK IT ON DOWN!
Round 16: pop-and-lock raver takes 5 damage.
Round 16: Epicgamer casts RUN LIKE THE WIND!
Round 17: pop-and-lock raver takes 9 damage.
Round 17: Epicgamer casts POP AND LOCK IT!
Round 18: pop-and-lock raver takes 14 damage.
Round 18: Epicgamer wins the fight!
After Battle: Spicy smiles a three-lipped smile from beneath the shade of his little sombrero.
You gain 13 Fortitude
You gain 20 Mysteriousness
You gain 21 Roguishness

Libram summon #16 when MP > 231.

Request 22 of 129 (Volcano: Outside the Club) in progress...

[1118] Outside the Club
Encounter: running man
Strategy: C:\Users\Rinn\Documents\My Dropbox\kolmafia\ccs\ascension.ccs [running man]
Round 0: Epicgamer loses initiative!
Round 1: Spicy takes a pull on the hookah, and immediately goes into a coughing fit, blowing a cloud of smoke in your face. Since this is magic smoke, instead of giving you cancer (or, perhaps in addition to giving you cancer), it gives you an effect:
You acquire an effect: Cotton Mouthed (duration: 6 Adventures)
Round 1: Epicgamer executes a macro!
Round 1: Epicgamer casts POP AND LOCK IT!
Round 2: running man takes 5 damage.
Round 2: Epicgamer casts RUN LIKE THE WIND!
Round 3: running man takes 15 damage.
Round 3: Epicgamer casts BREAK IT ON DOWN!
Round 4: Epicgamer casts POP AND LOCK IT!
Round 5: running man takes 7 damage.
Round 5: running man takes 20 damage.
Round 5: Epicgamer casts RUN LIKE THE WIND!
Round 6: running man takes 15 damage.
Round 6: running man takes 28 damage.
Round 6: Epicgamer casts BREAK IT ON DOWN!
Round 7: running man takes 5 damage.
Round 7: Epicgamer casts POP AND LOCK IT!
Round 8: running man takes 7 damage.
Round 8: Epicgamer casts RUN LIKE THE WIND!
Round 9: running man takes 15 damage.
Round 9: Epicgamer casts BREAK IT ON DOWN!
Round 10: running man takes 9 damage.
Round 10: Epicgamer casts POP AND LOCK IT!
Round 11: running man takes 6 damage.
Round 11: Epicgamer casts RUN LIKE THE WIND!
Round 12: running man takes 12 damage.
Round 12: Epicgamer casts BREAK IT ON DOWN!
Round 13: running man takes 9 damage.
Round 13: Epicgamer wins the fight!
After Battle: Spicy smiles a three-lipped smile from beneath the shade of his little sombrero.
You gain 15 Beefiness
You gain 8 Magicalness
You gain 26 Sarcasm

Libram summon #16 when MP > 231.

Request 23 of 129 (Volcano: Outside the Club) in progress...

[1119] Outside the Club
Encounter: breakdancing raver
Strategy: C:\Users\Rinn\Documents\My Dropbox\kolmafia\ccs\ascension.ccs [breakdancing raver]
Round 0: Epicgamer loses initiative!
Round 1: Epicgamer executes a macro!
Round 1: Epicgamer casts RUN LIKE THE WIND!
Round 2: breakdancing raver takes 7 damage.
Round 2: Epicgamer casts BREAK IT ON DOWN!
Round 3: breakdancing raver takes 13 damage.
You lose 3 hit points
Round 3: Epicgamer casts POP AND LOCK IT!
Round 4: breakdancing raver takes 16 damage.
You acquire an effect: Rave Nirvana (duration: 1 Adventure)
Round 4: Epicgamer casts RUN LIKE THE WIND!
Round 5: breakdancing raver takes 10 damage.
Round 5: Epicgamer casts BREAK IT ON DOWN!
Round 6: breakdancing raver takes 12 damage.
Round 6: Epicgamer casts POP AND LOCK IT!
Round 7: breakdancing raver takes 9 damage.
Round 7: Epicgamer casts RUN LIKE THE WIND!
Round 8: breakdancing raver takes 6 damage.
Round 8: Epicgamer casts BREAK IT ON DOWN!
Round 9: breakdancing raver takes 11 damage.
Round 9: Epicgamer casts POP AND LOCK IT!
Round 10: breakdancing raver takes 9 damage.
Round 10: Epicgamer casts RUN LIKE THE WIND!
Round 11: breakdancing raver takes 7 damage.
Round 11: Epicgamer casts BREAK IT ON DOWN!
Round 12: breakdancing raver takes 12 damage.
Round 12: Epicgamer casts POP AND LOCK IT!
Round 13: breakdancing raver takes 10 damage.
Round 13: Epicgamer casts RUN LIKE THE WIND!
Round 14: breakdancing raver takes 5 damage.
Round 14: Epicgamer casts BREAK IT ON DOWN!
Round 15: breakdancing raver takes 11 damage.
Round 15: Epicgamer casts POP AND LOCK IT!
Round 16: breakdancing raver takes 6 damage.
Round 16: Epicgamer casts RUN LIKE THE WIND!
Round 17: breakdancing raver takes 10 damage.
Round 17: Epicgamer casts BREAK IT ON DOWN!
Round 18: breakdancing raver takes 14 damage.
Round 18: Epicgamer wins the fight!
After Battle: Spicy smiles a three-lipped smile from beneath the shade of his little sombrero.
You gain 8 Strengthliness
You gain 14 Wizardliness
You gain 29 Roguishness

Libram summon #16 when MP > 231.
Restoring MP! Currently at 255 of 255 HP, 67 of 284 MP, current meat: 43062175 ... Target MP = 142.
Searching for "knob goblin superseltzer"...
Purchasing Knob Goblin superseltzer (3 @ 100)...
You acquire Knob Goblin superseltzer (3)
Purchases complete.
Using 3 Knob Goblin superseltzer...
You gain 81 Mojo Points
Finished using 3 Knob Goblin superseltzer.

Request 24 of 129 (Volcano: Outside the Club) in progress...

[1120] Outside the Club
Encounter: running man
Strategy: C:\Users\Rinn\Documents\My Dropbox\kolmafia\ccs\ascension.ccs [running man]
Round 0: Epicgamer loses initiative!
Round 1: Epicgamer executes a macro!
Round 1: Epicgamer casts BREAK IT ON DOWN!
Round 2: running man takes 8 damage.
Round 2: Epicgamer casts RUN LIKE THE WIND!
Round 3: running man takes 13 damage.
Round 3: Epicgamer casts POP AND LOCK IT!
Round 4: running man takes 15 damage.
You acquire an effect: Rave Concentration (duration: 1 Adventure)
Round 4: Epicgamer casts BREAK IT ON DOWN!
Round 5: running man takes 10 damage.
Round 5: Epicgamer casts RUN LIKE THE WIND!
Round 6: running man takes 15 damage.
Round 6: Epicgamer casts POP AND LOCK IT!
Round 7: running man takes 9 damage.
Round 7: Epicgamer casts BREAK IT ON DOWN!
Round 8: running man takes 5 damage.
Round 8: Epicgamer casts RUN LIKE THE WIND!
Round 9: running man takes 12 damage.
Round 9: Epicgamer casts POP AND LOCK IT!
Round 10: running man takes 8 damage.
Round 10: Epicgamer casts BREAK IT ON DOWN!
Round 11: running man takes 5 damage.
Round 11: Epicgamer casts RUN LIKE THE WIND!
Round 12: running man takes 13 damage.
Round 12: Epicgamer casts POP AND LOCK IT!
Round 13: running man takes 9 damage.
Round 13: Epicgamer casts BREAK IT ON DOWN!
Round 14: running man takes 6 damage.
Round 14: Epicgamer casts RUN LIKE THE WIND!
Round 15: running man takes 10 damage.
Round 15: Epicgamer casts POP AND LOCK IT!
Round 16: running man takes 9 damage.
You lose 3 hit points
Round 16: Epicgamer casts BREAK IT ON DOWN!
Round 17: running man takes 7 damage.
Round 17: Epicgamer casts RUN LIKE THE WIND!
Round 18: running man takes 12 damage.
Round 18: Epicgamer wins the fight!
After Battle: Spicy smiles a three-lipped smile from beneath the shade of his little sombrero.
You gain 13 Strengthliness
You gain 10 Enchantedness
You gain 25 Cheek

KoLmafia declares world peace. // I aborted and ran the next combat manually.

[1121] Outside the Club
Encounter: breakdancing raver
Round 0: Epicgamer loses initiative!
Round 1: Epicgamer executes a macro!
Round 1: Epicgamer casts POP AND LOCK IT!
Round 2: breakdancing raver takes 7 damage.
You lose 3 hit points
Round 2: Epicgamer casts BREAK IT ON DOWN!
Round 3: breakdancing raver takes 13 damage.
Round 3: Epicgamer casts RUN LIKE THE WIND!
Round 4: breakdancing raver takes 17 damage.
You acquire an item: candy necklace
All rave combos have been identified!
For reference here is the macro I was running if it's relevant:
Code:
[ breakdancing raver ]
if !hasskill break it on down
    while !match "he raver drops "
        item dictionary
    endwhile
    skill gothy handwave
endif
call learn_rave
default

[ default ]
call pilfer
special action
special action
special action
call mp_restore
attack with weapon

[ global prefix ]
scrollwhendone
sub learn_rave
    combo Random Rave
    combo Random Rave
    combo Random Rave
    combo Random Rave
    combo Random Rave
    combo Random Rave
endsub
sub mp_restore
    if mppercentbelow 100
        skill spring raindrop attack
    endif
endsub
sub pilfer
    try to steal an item
    if !match "You deftly slip your fingers into your opponent's pocket and grab something."
        combo Rave Steal
    endif
endsub

[ pop-and-lock raver ]
if !hasskill pop and lock it
    while !match "movements suddenly became spastic and jerky."
        item dictionary
    endwhile
    skill gothy handwave
endif
call learn_rave
default

[ running man ]
if !hasskill run like the wind
    while !match "The raver turns"
        item dictionary
    endwhile
    skill gothy handwave
endif
call learn_rave
default
 
Last edited:

slyz

Developer
The combo you did manually (POP AND LOCK IT!, BREAK IT ON DOWN!, RUN LIKE THE WIND!) was used by Mafia during the combat on turn [1118], but apparently no item was stolen and the combo wasn't properly identified that time around.

Another quick remark: when the macro is generated, all instances of "combo Random Rave" result in the same combination of rave skills being used. You can use it only once, or you can use a consult function that does something like:
PHP:
string randrave( int rnd, string opp, string text )
{
	return "combo Random Rave";
}
although it would need to be in a different CCS or it will completely break your ascension CCS.
 

Rinn

Developer
Oh yeah that's actually the issue, it never use that combo since it was just doing the same one over and over each combat.
 

slyz

Developer
Each time a combo is identified, Random Rave is changed. In your example, a different combo is used in each combat. This way, you should end up identifying all the combos in 5 combats (the last one is deduced from the 5 you learned).

In a specific combat, though, all instances of "combo Random Rave" spawn the same combo since at the time the macro is generated, Random Rave doesn't change.

I don't know if that was clear.
 

Veracity

Developer
Staff member
Yes. "Random Rave" really means "Next Unidentified Rave" - with the expectation that using it will identify it.

Now, there are certain combos that we can only identify by looking at what happens in the next round of combat - in particular, Rave Knockout and Rave Bleeding. If there is no next round - you killed the monster on the round in which you did the final move of the combo - we can't learn it.

Rave Steal will always show up on the round of the third rave move - if it shows up at all. Perhaps we could deduce that you tried a failed Rave Steal if you just tried a previously unknown combo and nothing showed up that round OR the next round. I may experiment with that, by and by: I'm currently a DB. I just have essentially no free time, at the moment, to do anything complicated with KoLmafia.

In any case, this complaint has nothing to do with "we don't deduce the 6th combo when using random rave". It has to do with "it's hard to tell that you've done a rave steal when nothing was knocked lose."
 

Rinn

Developer
I'm pretty sure in this case I was just mistaken and it never used the rave steal combo because in error assumed it would add several different random raves, which didn't happen because it was converted into a macro.
 
Last edited:

Veracity

Developer
Staff member
Very interesting.

Yes, as coded, multiple "combo random rave" automated into a macro will always use the "next" unknown combo, as of the time the macro is generated.

I'm willing to beef up deduction of Rave Steal when it doesn't succeed in yoinking an item, but I'm not going to think about that little "quirk".
 

zarqon

Well-known member
Is there a way to access this Random Rave functionality within a consult script? I'm looking to add learning unknown combos to my script -- and I'd like a shortcut. :)

I'm assuming that submitting "combo random rave" in a macro won't work since mafia won't alter the information submitted by a visit_url() call.
 

slyz

Developer
You will have to build the random rave combo yourself I think, from the raveComboX preferences, with something like this:
PHP:
boolean random_combo()
{
	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";
	
	boolean known;
	for i from 1 to 6
	{
		known = false;
		for j from 1 to 6
		{
			if ( get_property( "raveCombo" + j ) == rave_possible[ i ] )
			{
				known = true ;
				break;
			}
		}
		if ( !known )
		{
			return rave_possible[ i ];
		}
	}
	return "";
}
 

Bale

Minion
As slyz says, it isn't a hard function to write yourself. FYI, I'd probably write it like this:

PHP:
string random_rave() { 
	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"; 
	 
	boolean not_found(string rave) {
		for i from 1 to 6
			if(get_property("raveCombo" + i) == rave) return false;
		return true;
	}
	foreach key,rave in rave_possible
		if(not_found(rave)) {
			string [int] r = split_string(rave,",");
			return "skill "+r[0]+ ";skill "+r[1]+ ";skill "+r[2];+";";
		}
	return "";
}

I wonder if zarqon's version will be more fun? I can imagine a version that does not use a map.
 
Last edited:

slyz

Developer
For only 6 permutations, it would take up more code to automatically find them than to hardcode them, at least with this algorithm I found:
PHP:
string random_rave() { 
	string random_combo;
	string [ int ] raveskill;

	foreach str in $strings[ Break It On Down, Pop and Lock It, Run Like the Wind ]
		raveskill[ raveskill.count() + 1 ] = str;

	int [ int ] perm; foreach i in raveskill perm[ i ] = 0;
	int level = -1;

	boolean not_found( string rave ) { 
		for i from 1 to 6 
			if ( get_property( "raveCombo" + i ) == rave ) return false;
		return true; 
	}

	string to_prop( int [ int ] p ) {
		string str;
		foreach i in p str += raveskill[ p[ i ] ] + ",";
		return substring( str, 0, str.length() - 1 );
	}

	string to_macro( int [ int ] p ) {
		string str;
		foreach i in p str += "skill " + raveskill[ p[ i ] ] + ";";
		return str;
	}

	void visit( int k ) {
		level += 1; perm[ k ] = level;
		if ( level == perm.count() && perm.to_prop().not_found() ) random_combo = perm.to_macro();
		else foreach i in perm if ( perm[i] == 0 ) visit( i );
		level -= 1; perm[ k ] = 0;
	}
	visit(1);

	return random_combo;
}
 
Last edited:

zarqon

Well-known member
So what you're saying is "no Zarqon, there isn't a shortcut." Okay.

Here's a mapless version, by the way.

PHP:
string unknown_rave() {
   for i from 50 to 52
      for j from 50 to 52 {
         if (j == i) continue;
         for k from 50 to 52 {
            if (k == j || k == i) continue;
            boolean found = false;
            for l from 1 to 6 if (get_property("raveCombo"+l) == to_skill(i)+","+to_skill(j)+","+to_skill(k)) found = true;
            if (!found) return "skill "+i+";skill "+j+";skill "+k;
         }
      }
   return "";
}
 
Last edited:

Bale

Minion
Yay. That's my zarqon!! I had a feeling he'd come up with something more eloquent than us!
 
Top