Simba Code:
program new; // Edits shown in comments
{$i srl/srl.simba}
function CheckAndClick(UpText, Option:String; X,Y:Integer; RClick:Boolean):Boolean; //by YoHoJo
begin
MMouse(x, y, 5, 5);
if WaitUptext(UpText, 1500*Random(500)) then //changed this to: (Uptext, 1500 + Random(500))
begin // works fine now
Result:=True;
GetMousePos(x, y);
if RClick then
begin
Mouse(X, Y, 5, 5, false);
Result:=WaitOption(Option, 2000);
Writeln('CheckAndClick (False - RClick)');
if Result then FFlag(0);
end else
begin
Mouse(x, y, 5, 5, true);
Writeln('CheckAndClick (True - LClick)');
Wait(100 * Random(50));
FFlag(0);
end;
end;
end;
function FindGroveDoor: Boolean;
var
Dx, Dy: integer;
TPA: Array of TPoint;
ATPA: T2DPointArray;
I: integer;
begin
FindColorsSpiralTolerance(Dx, Dy, TPA, 3894411, MSX1, MSY1, MSX2, MSY2, 17);
begin
ATPA:= SplitTPA(TPA, 20);
for I := 0 to High(ATPA) do
if MiddleTPAEX(ATPA[i], Dx, Dy) then
begin
case Random(2) of
0:
begin
GetMousePos(Dx, Dy); //took out GetMousePos as suggested by Home
CheckAndClick('door', 'pen', Dx, Dy, true); // I don't think it would hurt if left in
Writeln('Found Door');
Result:= true;
end;
1:
begin
GetMousePos(Dx, Dy); // Took this one out, too
CheckAndClick('door', 'pen', Dx, Dy, false);
Writeln('Found Door');
Result:= true;
end;
end;
end else
Result:= False;
Exit;
end;
end;
begin
SetUpSRL;
ActivateClient;
FindGroveDoor;
end.