SCAR Code:
{*******************************************************************************
Function InFight: Boolean;
By: FrÕzÑ_§ÕµL, based on FindFight by Stupid3ooo.
Description: Checks for fights without changing game tabs. Prevents multiple runs.
*******************************************************************************}
Function InFight: Boolean;
var
x, HPTime : Integer;
ColorSign : String;
Begin
if Players[CurrentPlayer].level[8] <= 0 then
Players[CurrentPlayer].level[8] := GetSkillInfo('hitpoints',False);
if Players[CurrentPlayer].level[8] > HP then
if TimeFromMark(HPTime) >= 60000 then
Begin
x := TimeFromMark(HPTime) - 60000;
MarkTime(HPTime);
DecEx(HPTime, x);
Inc(HP);
end;
if FindColor(x, y, 65280, 217, 129, 297, 209) then
Begin
x := GetMMLevels('hp', ColorSign);
if x = -1 then
Begin
Result := FindFight;
Exit;
end;
if (x < HP) then
Begin
Result := True;
WriteLn('******** FOUND FIGHTING RANDOM ********');
WriteFileString(TheFile, '******** FOUND FIGHTING RANDOM ********' + Chr(13));
TakeScreen('Found Fight');
Inc(Fights);
MarkTime(HPTime);
HP := GetMMLevels('hp', ColorSign);
if HP = -1 then
HP := Players[CurrentPlayer].level[8];
end;
end;
end;
What it does is when it finds the green health bar above your character it checks to see if the HP next to the MM is lower than the one recorded (If none then it does it first) and then returns true. All fights found after this will be checked against your current hp before running away.
Just tested and works well. I think I have prevented the running away again when it runs back to where it found the fight when another player is fighting, using a mark time - 1min = HP + 1
I realize it is a simple function but it means we do not have to get unnecessary bans because of this, and also since the old one switches back gametabs after use some players are dead by that time 
Enjoy all