set_auto_attack() – Potential bug?

Banana Lord

Member
After executing set_auto_attack() mafia still thinks my autoattack is whatever I was using before. eg:
Code:
get_auto_attack();
=> 0
set_auto_attack(99666);
get_auto_attack();
=> 0

visit_url("account.php?tab=combat");
get_auto_attack();
=> 99666
Bug or feature?
 

slyz

Developer
I'll try to look at this, but you can use cli_execute( "/aa <name>" ) instead of set_auto_attack().
 

slyz

Developer
In AutoAttackCommand.java, I changed setAutoAttackSkill() to parse the result of the request by changing
PHP:
if ( skillId != KoLCharacter.getAutoAttackAction() )
{
	AutoAttackCommand.AUTO_ATTACKER.addFormField( "value", String.valueOf( skillId ) );
	RequestThread.postRequest( AutoAttackCommand.AUTO_ATTACKER );
}
to
PHP:
if ( skillId != KoLCharacter.getAutoAttackAction() )
{
	AutoAttackCommand.AUTO_ATTACKER.addFormField( "value", String.valueOf( skillId ) );
	RequestThread.postRequest( AutoAttackCommand.AUTO_ATTACKER );
	StaticEntity.externalUpdate( AutoAttackCommand.AUTO_ATTACKER.getURLString(), AutoAttackCommand.AUTO_ATTACKER.responseText );
}
but that will update what Mafia thinks your autoattack is based on the URL submitted only. That means you can trick it into thinking that your autoattack is "Toss" even if you don't have that skill. That can probably be treated as a different bug though.
 
Top