Aaronator
2009-10-09 19:32:46
I made a function that will could be used in scripts to move the mouse randomly, just like a human would :).
C+P it into scar, and press run a few times.
I would appreciate ALL Comments good and bad on how i can improve.;)
C+P it into scar, and press run a few times.
program New;
{.include srl/srl.scar}
function A_MouseAntiBan: boolean;
var
x,y,i,t, n ,b,xx,yy,normalspeed: integer;
f1,f2,f3,f4:boolean;
begin
f1 := false;
f2 := false;
f3 := false;
f4 := false;
normalspeed := mousespeed;
for b := 0 to randomrange(1,3) do
begin
mousespeed := normalspeed + randomrange(5,20);
mmouse(mscx,mscy,380,380);
GetMousePos(x,y);
case random(4) of
0: f1 := true;
1: f2 := true;
2: f3 := true;
3: f4 := true;
end;
if f1 then
begin
for i := 0 to 10 do
begin
MMouse(x - randomrange(4,20), y - randomrange(4,10), 0, 0);
GetMousePos(x,y);
wait(randomrange(10,25));
end;
end;
if f2 then
begin
for i := 0 to 10 do
begin
MMouse(x + randomrange(4,20), y + randomrange(4,20), 0, 0);
GetMousePos(x,y);
wait(randomrange(10,25));
end;
end;
if f3 then
begin
for i := 0 to 10 do
begin
MMouse(x + randomrange(4,20), y - randomrange(4,20), 0, 0);
GetMousePos(x,y);
wait(randomrange(10,25));
end;
end;
if f4 then
begin
for i := 0 to 10 do
begin
MMouse(x - randomrange(4,20), y + randomrange(4,20), randomrange(0,1), randomrange(0,1));
GetMousePos(x,y);
wait(randomrange(10,25));
end;
end;
end;
MouseSpeed := NormalSpeed;
result := true;
end;
begin
setupsrl;
if A_MouseAntiBan then
writeln('Inc(MouseAntibans);');
end.
I would appreciate ALL Comments good and bad on how i can improve.;)