
Originally Posted by
KingKong
Freddy, does scar support mousekeys?
Not yet, I'm hoping to get that done tonight. I just added FindColor and some tolerance support. Currently there's only support for tolerance algorithms 0 and 1 though, but the rest should follow soon. You'll also be able to use your own script-defined algorithms:
SCAR Code:
uses
Types, Tolerance;
function MyCompareColors(const c1, c2, Tol: Integer): Boolean;
begin
Print(ToStr(c1) + ', ' + ToStr(c2) + ', ' + ToStr(Tol));
Result := False;
end;
begin
Print(CompareColors(1, 2, 3));
Set_CompareColors(@MyCompareColors);
Print(CompareColors(1, 2, 3));
end.
Code:
Succesfully compiled (16ms)
true
1, 2, 3
false
Script finished (0ms)
And:
SCAR Code:
uses
Types, Tolerance;
function MyGetTol(const c1, c2: Integer): Integer;
begin
Result := 9001;
end;
begin
Print(GetTol(1, 2));
Set_GetTol(@MyGetTol);
if GetTol(1, 2) > 9000 then
Print('It''s over 9000!');
end.
Code:
Succesfully compiled (16ms)
1
It's over 9000!
Script finished (0ms)
(Note that SimilarColors will also be used internally for tolerance comparison in find functions)