Thank you, this fixed the issue.
The issue is that run_combat is sending a string with the monster name, it does not send Wa%playername/lowercase% nor %alucard%
When you say "run_combat", I assume you mean "the filter function I gave to run_combat to be called for each round of combat".
If you are saying that that function is called with a monster name as a sting, that is incorrect. The filter function, like a consult script, is given a monster object, not a string.
Here is how a consut script is called:
Code:
Object[] parameters = new Object[3];
parameters[0] = new Integer( FightRequest.currentRound );
parameters[1] = MonsterStatusTracker.getLastMonster();
parameters[2] = FightRequest.lastResponseText;
...
consultInterpreter.execute( "main", parameters );
Here is how a filter function is called:
Code:
Object[] parameters = new Object[ 3 ];
parameters[ 0 ] = new Integer( FightRequest.getRoundIndex() );
parameters[ 1 ] = monster;
parameters[ 2 ] = FightRequest.lastResponseText;
...
Value returnValue = Macrofier.macroInterpreter.execute( macroOverride, parameters, false );
Your test function:
Code:
string test_combat(int round, string opp, string text)
{
print("you are facing the monster called = " + opp);
print("checking mafia recognition... function to_monster(opp)");
test(to_monster( opp ));
abort();
return "needed after abort or it will not run";
}
Is incorrect.
The parameter "opp" should be a monster.
When you specify that it is a string, KoLmafia coerces the monster to a string - the monster name - and gives it to your function.
Your function then turns it back in to a monster via to_monster().
Aside from being inefficient - why look up a monster by name when you already have a monster? - it is buggy. The monster object you are given is the specific monster you are actually fighting. So, for example, in OCRS, the monster your function is given has the specific random modifiers that your specific opponent has, in the opp.random_modifiers proxy record field. When you use to_monster on a monster name, you get a generic monster with no random modifiers.
Code:
string test_combat(int round, monster opp, string text)
{
print("you are facing the monster called = " + opp);
print("checking mafia recognition...");
test(opp);
abort();
return "needed after abort or it will not run";
}
will work.