A lot of functions that requires a box to search in need the following parameters; xs, ys ,xe and ye(x start, y start, x end and y end). For some reason it starts to look 5 pixels above the client, but I don't see you use any function that requires a search box, like FindColors or such. Maybe it is a mistake in FindObjectCustom?
These lines can be removed as they aren't used: x:=MSX1;
y:=MSY1;
edit:
Could you replace FindObjectEx in Srl/srl/Object.simba with the following code, and post here if the debug tells you something new?
Simba Code:
function FindObjEx(var cx, cy: Integer; Text: TStringArray; Color: TIntegerArray;
Tol, Step, xs, ys, xe, ye: Integer): Boolean;
var
CurX, CurY, a, b, c, i: Integer;
Start: Boolean;
begin
for b := 0 to (GetArrayLength(Color)-1) do
begin
if (FindColorSpiralTolerance(cx, cy, color[b], xs, ys, xe, ye, Tol)) then
begin
Start := True;
Break;
end;
end;
if (Start) then
begin
CurX := Round((xs + xe) div 2);
CurY := Round((ys + ye) div 2) - Step;
i := 1;
repeat
for c := 1 to i do
begin
case a of
0: begin //To allow for beginning offset and loop
a := a + 1;
i := 0;
CurY := CurY + Step;
end;
1: CurX := CurX + Step;
2: CurY := CurY - Step;
3: CurX := CurX - Step;
4: CurY := CurY + Step;
end;
if (CurX >= xs) and (CurX <= xe) and (CurY >= ys) and (CurY <= ye) then
begin
try
for b := 0 to (GetArrayLength(Color)-1) do
begin
if (CurY-(Step div 2) < 0)then
writeln('Fast tell everyone the FindObjectCustom function is bad');
if (FindColorTolerance(cx, cy, Color[b], CurX-(Step div 2), CurY-(Step div 2), CurX+(Step div 2), CurY+(Step div 2), Tol)) then
begin
MMouse(cx, cy, 3, 3);
If (WaitUptextMulti(Text, 300)) then
begin
GetMousePos(cx, cy);
Result := True;
Exit;
end;
end;
end;
except
end;
end;
end;
a := a + 1;
if a mod 5 = 0 then a := 1;
if (a = 1) or (a = 3) then i := i + 1;
until (Result) or ((CurX > xe) and (CurY > ye))
end;
end;