Simba Code:
function A_FindObj(color, tol, count : integer; uptext : string; left : boolean): Boolean;
var
X, Y, A, M, curCTS: Integer;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
Result := False;
if not LoggedIn then exit;
curCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
if not FindColorsSpiralTolerance(MSCX, MSCY, TPA, Color, MSX1, MSY1, MSX2, MSY2, tol) then
begin
ColorToleranceSpeed(1);
writeln('Cannot find color');
exit;
end;
ColorToleranceSpeed(1);
ATPA := TPAtoATPAEx(TPA, 10, 10);
M := High(ATPA);
for A := 0 to M do
begin
if Length(ATPA[A]) < count then
continue;
if MiddleTPAEx(ATPA[A], X, Y) then
begin
MMouse(X, Y, 6, 6);
Wait(100 + Random(50));
if WaitUptext(uptext, 100) then
begin
GetMousePos(X, Y);
Mouse(X, Y, 0, 0, left);
Result := True;
ColorToleranceSpeed(curCTS);
Exit;
end;
end;
end;
ColorToleranceSpeed(curCTS);
end;
I'm trying to use this to detect the range in catherby. And this is what i have so far.
Simba Code:
procedure clickthisitem;
begin
mouseitem(1, 0);
end;
function if A_FindObj(rangecol, 10, 10, 'ange', true) then
var
X, Y, A, M, curCTS: Integer;
TPA: TPointArray;
ATPA: T2DPointArray;
begin
Result := False;
if not LoggedIn then exit;
curCTS := GetColorToleranceSpeed;
ColorToleranceSpeed(2);
if not FindColorsSpiralTolerance(MSCX, MSCY, TPA, 2962580, 5339537, MSX1, MSY1, MSX2, MSY2, tol) then
begin
ColorToleranceSpeed(1);
writeln('Cannot find color');
exit;
end;
ColorToleranceSpeed(1);
ATPA := TPAtoATPAEx(TPA, 10, 10);
M := High(ATPA);
for A := 0 to M do
begin
if Length(ATPA[A]) < count then
continue;
if MiddleTPAEx(ATPA[A], X, Y) then
begin
MMouse(X, Y, 6, 6);
Wait(100 + Random(50));
if WaitUptext(uptext, 100) then
begin
GetMousePos(X, Y);
Mouse(X, Y, 0, 0, left);
Result := True;
ColorToleranceSpeed(curCTS);
Exit;
end;
end;
end;
ColorToleranceSpeed(curCTS);
end;
I keep getting the error
Simba Code:
[Error] (27:10): Identifier expected at line 26
I'm so lost atm...