This is copied sorta directly from the gobbiescheduler. It will check if we are infight at coord x,y (where the mouse is currently at) by looking for either the green, red status or the blue and red from hit/missed. If none is around the mouse it will return True;
PHP Code:
const MissedColor = 16728128;
const HitColor = 192;
const GreenStatusColor = 65280;
const RedStatusColor = 225;
//----------------------------------------------------------------------------//
Function InFightAt(x, y: Integer):Boolean;
var
dx, dy: Integer;
begin
Result:= (FindColor(dx, dy, GreenStatusColor, x - 20, y - 10, x + 20, y + 10) or
FindColor(dx, dy, RedStatusColor, x - 20, y - 10, x + 20, y + 10) or
FindColor(dx, dy, MissedColor, x - 20, y , x + 20, y + 20) or
FindColor(dx, dy, HitColor, x - 20, y, x + 20, y + 20));
end;