Flight
2011-12-03 13:12:55
So I whipped something up quick to simulate such humanish mistakes. First off, this will use the standard MMouse to move our mouse to a "mistake box region", and this region's size is determined by both the mouse speed and distance of travel. From there it's just another standard MMouse to the final destination.
So obviously it's nothing fancy or state of the art, but it goes to show how just tiny modifications like this could make our scripts that much more human.
Here's a couple of tests I did. The blue circles are the starting points, the red are the targets.
~
~
~
Edit:
Here's the procedure I used for the above testing:
{*******************************************************************************
Procedure HumanMMouse(eX, eY: Integer);
By: Flight
Description: Human-like miss-and-correct mouse movement
*******************************************************************************}
Procedure HumanMMouse(eX, eY: Integer);
var
randSpeed: extended;
X,Y,A,Dist,MP: integer;
begin
A := MouseSpeed;
GetMousePos(X, Y);
Dist := Distance(X, Y, eX, eY);
MP := Round(Dist/150);
if MP < 0 then
MP := 1;
randSpeed := (random(MouseSpeed) / 2.0 + MouseSpeed) / 10.0;
MMouse(RandomRange(eX-(A*MP), eX+(A*MP)), RandomRange(eY-(A*MP), eY+(A*MP)), 0, 0);
GetMousePos(X, Y);
MMouse(eX, eY, 0, 0);
MouseSpeed := A;
end;
And here's a super version of it directly using WindMouse: (If I remember correctly, it looks like a drunk player)
{*******************************************************************************
Procedure HumanMMouse(eX, eY: Integer);
By: Flight
Description: Human-like miss-and-corect mouse movement
*******************************************************************************}
Procedure HumanMMouse(eX, eY: Integer);
var
randSpeed: extended;
X,Y,A,Dist,MP: integer;
begin
A := MouseSpeed;
GetMousePos(X, Y);
Dist := Distance(X, Y, eX, eY);
MP := Round(Dist/100);
if MP < 0 then
MP := 1;
randSpeed := (random(MouseSpeed) / 2.0 + MouseSpeed) / 10.0;
WindMouse(X, Y, RandomRange(eX-(A*MP), eX+(A*MP)), RandomRange(eY-(A*MP), eY+(A*MP)),
30, 55, 10.0 / randSpeed, 12.0 / randSpeed, 10.0 * randSpeed, 10.0 * randSpeed);
GetMousePos(X, Y);
WindMouse(X, Y, eX, eY, 30, 55, 10.0 / randSpeed, 12.0 / randSpeed, 10.0 * randSpeed, 10.0 * randSpeed);
MouseSpeed := A;
end;




Mat