Rich
2010-06-08 13:15:50
Nothing exciting. Will move near to X and Y, and if it isn't within X + randomness and Y + randomness, will slowly move to X + randomness and Y + randomness…
I'm not expecting very good feedback for this, but thought I may as well post it.
{*******************************************************************************
procedure MissMouse(X, Y, RandX, RandY, Action : Integer);
By: R1ch
Description: Moves the mouse near to X and Y like a human would, then if not
near enough (set by RandX and RandY) will move closer. Action:
1 = Left click
2 = Right click
Any other = Move only
*******************************************************************************}
procedure MissMouse(X, Y, RandX, RandY, Action : Integer);
var
Cx, Cy, Ms : Integer;
begin
Ms:= MouseSpeed;
Cx:= (X - (RandX * 2) + Random(RandX * 4));
Cy:= (Y - (RandY * 2) + Random(RandY * 4));
MMouse(Cx, Cy, 0, 0);
Wait(RandomRange(300, 500));
if (not InRange(Cx, (X - RandX), (X + RandX)) or
not InRange(Cy, (Y - RandY), (Y + RandY))) then
begin
MouseSpeed:= Ms - Random(6);
MMouse(X, Y, RandX, RandY);
end;
Wait(RandomRange(300, 800));
GetMousePos(Cx, Cy);
case Action of
1 : Mouse(Cx, Cy, 0, 0, True);
2 : Mouse(Cx, Cy, 0, 0, False);
end;
MouseSpeed:= Ms;
end;I'm not expecting very good feedback for this, but thought I may as well post it.