So every RelayAgent has an associated RelayAutoCombatThread.
This is used to automate the whole fight when the browser requests /fight.php?action=custom
This is used to automate the whole fight when the browser requests /fight.php?hotkey=11
This is used to execute a single combat action when the browser requests /fight.php?hotkey=XX where XX is not 11
"Automating the whole fight" means calling FightRequest.INSTANCE.run() in a RelayAutoCombatThread.
"Executing a single combat action" means calling FightRequest.INSTANCE.runOnce( this.desiredAction ) in a RelayAutoCombatThread.
Neither of those request is synchronized, so you could have multiple RelayAutoCombatThreads in there stepping on each other.
I don't see evidence of that in your log.
When we call FightRequest.run(), that is, by definition, automating the fight. Extracted from that method:
I'd synchronize those methods and put the set/clear of the static class variable in try/finally, just to protect from real double clicks coming from the browser.
I'm still trying to figure out how FightRequest.run() got called for your second fight BEFORE you later pressed the "script" button.
This is used to automate the whole fight when the browser requests /fight.php?action=custom
This is used to automate the whole fight when the browser requests /fight.php?hotkey=11
This is used to execute a single combat action when the browser requests /fight.php?hotkey=XX where XX is not 11
"Automating the whole fight" means calling FightRequest.INSTANCE.run() in a RelayAutoCombatThread.
"Executing a single combat action" means calling FightRequest.INSTANCE.runOnce( this.desiredAction ) in a RelayAutoCombatThread.
Neither of those request is synchronized, so you could have multiple RelayAutoCombatThreads in there stepping on each other.
I don't see evidence of that in your log.
When we call FightRequest.run(), that is, by definition, automating the fight. Extracted from that method:
Code:
FightRequest.isAutomatingFight = true;
do
{
this.runOnce( null );
}
while ( this.responseCode == 200 && FightRequest.currentRound != 0 && !KoLmafia.refusesContinue() );
if ( this.responseCode == 302 )
{
FightRequest.clearInstanceData();
}
FightRequest.isAutomatingFight = false;
I'm still trying to figure out how FightRequest.run() got called for your second fight BEFORE you later pressed the "script" button.
Last edited: