ClickWindMouse

From SCAR Divi Manual
Jump to: navigation, search

Definition

procedure ClickWindMouse(x, y, rx, ry: Integer; Left: Boolean);

Source Code

procedure ClickWindMouse(x, y, rx, ry: Integer; Left: Boolean);
var
  i: Integer;
  xx, yy: Integer;
begin
  MoveWindMouse(x, y, rx, ry);
  Wait(60 + Random(30));
  GetMousePos(xx, yy);
  HoldMouse(xx, yy, left);
  i := 0;
  repeat
    Wait(20 + Random(30));
    i := i + 1;
  until (i > 4);
  GetMousePos(xx, yy);
  ReleaseMouse(xx, yy, left);
  Wait(100 + Random(100));
end;

Availability

SCAR Divi 3.21 > 3.34

Description

This function moves the cursor in a "human-like" pattern to a coordinate (x, y) relative to the selected client window randomized within a range specified for each coordinate by rx and ry, after which it clicks there in a human-like way. If Left is true, the function will generate a left button click, if Left is false, a right button click.

Example

begin
  ClickWindMouse(500, 500, 100, 100, False);
end.

See Also