ClickWindMouse

From SCAR Divi Manual
Revision as of 09:48, 6 July 2011 by Freddy (talk | contribs) (Created page with "==Definition== <source lang="scar" lines="false"> procedure ClickWindMouse(x, y, rx, ry: Integer; Left: Boolean); </source> ===Source Code=== <source lang="scar"> procedure Clic...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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
    MyWait(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 > Current

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