mrpickle
2010-07-03 00:47:43
Will Move Mouse randomly around an area until it detects a specific uptext
Uses: Failsafe and when no other method work.
Uses: Failsafe and when no other method work.
Function MouseAroundForUpTextEx(UpText:String;WaitMs,NumTrials,x1,y1,x2,y2:Integer):Boolean;
var
x,y,i:integer;
begin
repeat
x := random(x2 - x1);
y := random(y2 - y1);
MMouse(x1,y1,x,y);
wait(WaitMs+random(150));
If(IsUpText(UpText))Then
begin
getmousepos(x, y);
mouse(x, y, 0, 0, True);
Result:= True;
exit;
end;
wait(WaitMs+random(150));
inc(i);
until(i > NumTrials) xor (Result)
if(i > NumTrials)then
Result := False;
end;
Function MouseAroundForUpText(UpText:String):Boolean;
begin
If(MouseAroundForUpTextEx(UpText,250,100,5,5,513,335))Then // Covers RS Screen on min.
Result := True;
end;