SRL Archive - SRL Archives

My Other MMouse Function XD


SKy Scripter

2007-07-10 07:59:06

lol i made another one this has more curve and ect…
i like it :)

program New;

const
MouseSpeed = 6; // leave between 4 - 8


procedure MMouse(dx, dy, rx, ry : Integer);
var
x, y, step, Angle, r, b1, b2 : Extended;
cx, cy, mx, my, Speed, Slow, xx, yy : integer;
Ctrls : array [0..2] of TPoint;
begin
dx := dx + Random(rx);
dy := dy + Random(ry);
GetMousePos(mx, my);
Angle := Random(360) + 1;
r := Random(Distance(mx, my, dx, dy)) + 10;
cx := Trunc(r * Sin((Pi/180) * Angle) + dx - mx);
cy := Trunc(-r * Cos((Pi/180) * Angle) + dy - my);
Ctrls[1] := Point(cx, cy);
Ctrls[2] := Point(dx - mx, dy - my);
Speed := (MouseSpeed mod 6) + 1
repeat
Step := Step + (Speed * 0.01);
b1 := Pow(Step, 3);
b2 := 3 * b1 * (1 - step);
x := Ctrls[0].x * b1 + Ctrls[1].x * b2 + Ctrls[2].x * b1 + mx;
y := Ctrls[0].y * b1 + Ctrls[1].y * b2 + Ctrls[2].y * b1 + my;
xx := Round(x);
yy := Round(y);
MoveMouse(xx, yy);
if (Distance(xx, yy, dx, dy) < 100) and (Distance(xx, yy, dx, dy) <> 0) then
Slow := Slow + ((Speed * MouseSpeed) / Distance(xx, yy, dx, dy)) + 2;
if (Slow > 20) then Slow := 20;
wait(((Speed * MouseSpeed) + Slow) + random(2));
until (Step >= 1);
end;


var
i : integer;
begin
for i := 1 to 4 do
begin
MMouse(0, 0, 700, 500);
wait(100);
end;
end.

Pentti

2007-07-10 08:04:15

Hehe! Damn, that looks nice!
Very cool! :D

SKy Scripter

2007-07-10 08:16:37

Hehe! Damn, that looks nice!
Very cool!


Thanks. :)

mastaraymond

2007-07-10 09:46:54

Its kinda cool at far distances, but at small distances it is acting strange. The mouse moves really slow. But at large distances i like it!
Also i noticed it sometimes skips a part of the curve, not really human :P

Santa_Clause

2007-07-10 09:59:18

I just realised the same thing. Seems pretty good though.

Harry

2007-07-10 10:32:16

Nice!

shaunthasheep

2007-07-10 15:27:51

same comments as mastaraymond
kind of skippy.