Er, unless i'm mistaken FindFight or whatever it's called in SRL checks for the color already, then checks the hp and if its less than 100% runs. The checking can be disabled though, i forget how. One sec, lemme check.
Edit: From core/antirandoms/antirandoms.scar Checks color, then hp.
SCAR Code:
{*******************************************************************************
function FindFight: Boolean;
by: Stupid3ooo
Description: Results True if in Fight
*******************************************************************************}
function FindFight: Boolean;
var
xf, yf: Integer;
begin
if (FindColor(xf, yf, 65280, 217, 129, 297, 209)) then
begin
if (CheckHpFirst = True) then
begin
GameTab(2);
Wait(500 + Random(100));
if (HpPercent < 100) then
begin
Result := True;
WriteLn('******** FOUND FIGHTING RANDOM ********');
WriteFileString(TheFile, '******** FOUND FIGHTING RANDOM ********' +
Chr(13))
TakeScreen('Found Fight');
Fights := Fights + 1;
end;
end
else
begin
WriteLn('******** FOUND FIGHTING RANDOM ********');
WriteFileString(TheFile, '******** FOUND FIGHTING RANDOM ********' +
Chr(13))
Result := True;
TakeScreen('Found Fight');
Fights := Fights + 1;
end;
GameTab(4);
end;
end;
Edit2: Ah, my bad. Talking about in autofighters, not antirandom stuff. Well you could still look the beginning of it over to get a general idea on the way it checks for the color.