I have this function:
SCAR Code:
program SymbolCustom;
{.include srl\srl.scar}
var X, Y : Integer;
const
Speed = 16;//Mouse speed
{*******************************************************************************
function FindDTMSymbol(Color, Tol, Rand : Integer; Click : Boolean): Boolean;
Author : Floor66
Description : Custom Symbol finder, uses DTMs and toleranced colors.
HowTo : Set color and tol. True for click, False for no click.
You can also set the amount of randomness when clicking.
___________________________
------------------------------------>>>>>>> Created & Tested by Floor66
*******************************************************************************}
function FindDTMSymbol(var cx, cy : Integer; Color, Tol, Rand : Integer; Click : Boolean): Boolean;
var U, C, SymbolDTM : Integer;
begin
begin
SymbolDTM := DTMFromString('78DA63EC606260706740012AFE8F18FE03694' +
'620FE0F048C7D4035CEA86A18191919B8A06AC0FC16A01A47026A' +
'1A31EDC250D30654E347400DC83DDE04D4F403D5B8E1570300CA5' +
'E0C6A');
end;
MarkTime(U);
if (DTMRotated(SymbolDTM, cx, cy, MMX1, MMY1, MMX2, MMY2)) then
begin
C := GetColor(cx, cy)
if (SimilarColors(C, Color, Tol)) then
begin
if (Click = True) then
begin
// FindNormalRandoms;
Mouse(cx, cy, Rand, Rand, True);
Writeln('Found Symbol');
Result := True;
Writeln('Took : '+IntToStr(TimeFromMark(U))+' msec');
Writeln('Symbol is located at : '+IntToStr(cX)+', '+IntToStr(cY)+'.');
end else
begin
Writeln('Found Symbol');
Result := True;
Writeln('Took : '+IntToStr(TimeFromMark(U))+' msec');
Writeln('Symbol is located at : '+IntToStr(cX)+', '+IntToStr(cY)+'.');
end;
end;
end;
FreeDTM(SymbolDTM);
end;
{*******************************************************************************
^^©Floor 66^^
*******************************************************************************}
begin
SetUpSRL;
MouseSpeed := Speed;
ActivateClient;
FindDTMSymbol(x, y, 16741963, 25, 5, False);
Mouse(x, y, 5, 5, True);
end.
It's set like this:
It goes and look for the symbol, without clicking IN the function, but when the function is done, it'll click it at x, y.
But it doesnt work...
It clicks somewhere on the edge of the minimap (in the decoration).
I'm sure its not the color.