marpis
2009-01-08 15:46:30
Now the InFight function doesnt work correctly. I am not sure if this one works 100% of time but id like you to test it.
Thanks to Tniffoc who gave me the idea. :)
I quickly tested it and it seems to detect fights. But so does SRL's InFight sometimes :S
EDIT: CONFIRMED better than SRL's. Maybe fix this (i know there's something that needs to be fixed) and add to SRL? :)
Thanks to Tniffoc who gave me the idea. :)
I quickly tested it and it seems to detect fights. But so does SRL's InFight sometimes :S
function InFight2 : boolean;
var cTPA : TPointArray;
tpalen : integer;
begin
FindColorsSpiralTolerance(MSCX, MSCY, cTPA, 255, 230, 115, 330, 190, 0);
tpalen := GetArraylength(cTPA);
if (tpalen < 15) then
begin
FindColorsSpiralTolerance(MSCX, MSCY, cTPA, 65280, 230, 115, 330, 190, 0);
tpalen := GetArraylength(cTPA);
if (tpalen < 15) then
begin
Result := false;
end else
begin
Result := true;
writeln('Fight detected!');
end;
end else
begin
Result := true;
writeln('Fight detected!');
end;
end;EDIT: CONFIRMED better than SRL's. Maybe fix this (i know there's something that needs to be fixed) and add to SRL? :)