Here are two functions that I made earlier whilst I was bored. They are FreezeMouse, and FreezeMousePos.
procedure FreezeMouse(X, Y, Rx, Ry, WaitMS : Integer);
What FreezeMouse does is freeze the mouse at X, Y for WaitMS milliseconds. If the mouse cursor is not already at X, Y, it will move the mouse to there with Rx, Ry randomness, and then wait.
SCAR Code:procedure FreezeMouse(X, Y, Rx, Ry, WaitMS : Integer);
var
T, C, V : Integer;
begin
GetMousePos(C, V);
if (C <> X) or (V <> Y) then
MMouse(X, Y, Rx, Ry);
T:= GetSystemTime;
GetMousePos(C, V);
repeat
MoveMouse(C, V);
until((GetSystemTime - T) = WaitMS);
end;
procedure FreezeMousePos(WaitMS : Integer);
FreezeMousePos is similar to FreezeMouse except this freezes the mouse where it already is, for WaitMS milliseconds.
SCAR Code:procedure FreezeMousePos(WaitMS : Integer);
var
X, Y : Integer;
begin
GetMousePos(X, Y);
FreezeMouse(X, Y, 0, 0, WaitMs);
end;
Comments?
Richard.
