SRL Archive - Test corner

procedure HSWait(time : integer);


realrune

2006-06-22 19:58:41


program New;

{.include srl/srl.scar}

procedure HSWait(time : integer);
Var TimeMarker, Cx, Cy, S : integer;
begin
S := Time + Random(Time / 10);
MarkTime(TimeMarker);
if(Random(100) = 1)then
begin
writeln('Sleeping and moving mouse');
SleepAndMoveMouse(S);
exit;
end
Else
if(Random(10) = 1)then
begin
writeln('Using idletime');
IdleTime(time,(time/10),1.0)
exit;
end;
repeat
if(Random(40) = 1)then
begin
if(Random(4) = 1)then
begin
IdleTime(100, 100, 1.0 + random(10))
writeln('Using a short idletime');
end
Else
begin
Writeln('Moving the mouse a little')
GetMousePos(cx, cy);
if(Random(2) = 1)then
MMouse(cx - random(5), cy - random(5), 0, 0)
Else
MMouse(cx + random(5), cy + random(5), 0, 0);
end;
end;
Wait(1);
until(TimeFromMark(TimeMarker) >= S);
end;

begin
SetupSRL;
BenMouse := False;
MouseSpeed := 25;
repeat
HSWait(1000);
writeln('done');
until(false);
end.

It's meant to try and simulate a human hand on an actual mouse, tell me what you think of it.

The Prince of Randomness?

2006-06-23 03:19:16

Its great, but whern it moves the mouse a little, i barely notice it. it would look more realistic if it had the movemouse a little, increasing for about 10 pixels, and then used idletime.

Great coding though.

phantombmx

2006-06-23 03:25:38

this seems VERY detectable..

XxKanexX

2006-06-23 03:36:18

Not really, Phantom. Remember, it's on repeat, so it dosn't repeat moving it. :)

Good Job. <3

c0de

2006-06-23 09:16:28

My hand isn't this shakey :S

Bebe

2006-06-23 12:13:18

This stuff doesn't apply to me, since I don't use a mouse (I use a laptop, so I have a touchpad) but, it would be better if you didn't use "sleepandmovemouse" but rather make your own, or atleast add a distance regulator. Say it gets about 15 pixels from the starting point, it will reverse it's direction and stay within a "box".

Good job though… :)

realrune

2006-06-23 12:49:35

Here's an updated version…

program New;

{.include srl/srl.scar}

procedure SleepAndMoveMouse2(Time : Integer); // By RSN, edit by RealRune
var
Moving : Boolean;
mx, my : Integer;
x, y, xv, yv : Extended;
gx, gy : Extended;
T : Integer;
begin
GetMousePos(mx, my);
x := mx;
y := my;
if (Random(2) = 0) then
Moving := False
else
Moving := True;
gx := 130 + Random(500);
gy := 130 + Random(300);
T := GetTickCount;
repeat
Sleep(10);
if (Moving) then
begin
if (gx > x) then
xv := xv + 0.1
else
xv := xv - 0.1;
if (gy > y) then
yv := yv + 0.1
else
yv := yv - 0.1;
x := x + xv;
y := y + yv;
MoveMouse(Round(x), Round(y));
end;
if (Random(100) = 0) then
Moving := not Moving;
if (Random(30) = 0) then
begin
gx := 130 + Random(500);
gy := 130 + Random(300);
end;
if (Distance(mx, my, Round(x), Round(y)) >= 120)then
begin
sleep(20 + random(20));
writeln('Moved over 120 pixels');
if(Random(2) = 1)then
MMouse(mx - random(5), my - random(5), 0, 0)
Else
MMouse(mx + random(5), mx + random(5), 0, 0);
repeat
sleep(10);
until (Abs(GetTickCount - T) >= Time);
exit;
end;
until (Abs(GetTickCount - T) >= Time);
end;

procedure HSWait(time : integer); // By RealRune
Var TimeMarker, Cx, Cy, S : integer;
begin
S := Time + Random(Time / 10);
MarkTime(TimeMarker);
if(Random(100) = 1)then
begin
writeln('Sleeping and moving mouse');
SleepAndMoveMouse2(S);
exit;
end
Else
if(Random(10) = 1)then
begin
writeln('Using idletime');
IdleTime(time,(time/10),1.0)
exit;
end;
repeat
if(Random(300) = 1)then
begin
if(Random(4) = 1)then
begin
IdleTime(100, 100, 1.0 + random(10))
writeln('Using a short idletime');
end
Else
begin
Writeln('Moving the mouse a little')
GetMousePos(cx, cy);
if(Random(2) = 1)then
MMouse(cx - random(7), cy - random(7), 0, 0)
Else
MMouse(cx + random(7), cy + random(7), 0, 0);
end;
end;
Wait(1);
until(TimeFromMark(TimeMarker) >= S);
end;

begin
SetupSRL;
BenMouse := False;
MouseSpeed := 25;
repeat
HSWait(1000);
writeln('done');
until(false);
end.

phantombmx

2006-06-23 18:25:45

take out the repeat until and set it on 10 seconds ;)

the second version is better..

but as i said kane, remove the repeat until in the main loop, and set it to 10 seconds

realrune

2006-06-23 19:07:05


program New;

{.include srl/srl.scar}

procedure SleepAndMoveMouse2(Time : Integer); // By RSN, edit by RealRune
var
Moving : Boolean;
mx, my : Integer;
x, y, xv, yv : Extended;
gx, gy : Extended;
T : Integer;
begin
GetMousePos(mx, my);
x := mx;
y := my;
if (Random(2) = 0) then
Moving := False
else
Moving := True;
gx := 130 + Random(500);
gy := 130 + Random(300);
T := GetTickCount;
repeat
Sleep(10);
if (Moving) then
begin
if (gx > x) then
xv := xv + 0.1
else
xv := xv - 0.1;
if (gy > y) then
yv := yv + 0.1
else
yv := yv - 0.1;
x := x + xv;
y := y + yv;
MoveMouse(Round(x), Round(y));
end;
if (Random(100) = 0) then
Moving := not Moving;
if (Random(30) = 0) then
begin
gx := 130 + Random(500);
gy := 130 + Random(300);
end;
if (Distance(mx, my, Round(x), Round(y)) >= 120)then
begin
sleep(20 + random(20));
writeln('Moved over 120 pixels');
if(Random(2) = 1)then
MMouse(mx - random(5), my - random(5), 0, 0)
Else
MMouse(mx + random(5), mx + random(5), 0, 0);
repeat
sleep(10);
until (Abs(GetTickCount - T) >= Time);
exit;
end;
until (Abs(GetTickCount - T) >= Time);
end;

procedure ShakyWait(time : integer); // By RealRune
Var T, Cx, Cy : integer;
begin
T := GetTickCount;
repeat
if(Random(30) = 1)then
begin
if(Random(4) = 1)then
begin
IdleTime(100, 100, 1.0 + random(10))
writeln('Using a short idletime');
end
Else
begin
Writeln('Moving the mouse a little')
GetMousePos(cx, cy);
if(Random(2) = 1)then
MMouse(cx - random(7), cy - random(7), 0, 0)
Else
MMouse(cx + random(7), cy + random(7), 0, 0);
end;
end;
Sleep(10);
until (Abs(GetTickCount - T) >= Time);
end;

procedure HSWait(time : integer); // By RealRune
var S : integer;
begin
S := Time + Random(Time / 10);
if(Random(1000) = 1)then
begin
writeln('Using SleepAndMoveMouse');
SleepAndMoveMouse(S);
exit;
end
Else
if(Random(100) = 1)then
begin
writeln('Using SleepAndMoveMouse2');
SleepAndMoveMouse2(S);
exit;
end
Else
if(Random(10) = 1)then
begin
writeln('Using shaky wait');
ShakyWait(S);
exit;
end
Else
if(Random(10) = 1)then
begin
writeln('Using idletime');
IdleTime(S, 0, 1.0 + random(3))
exit;
end;
Sleep(s);
end;

begin
SetupSRL;
BenMouse := False;
MouseSpeed := 25;
repeat
HSWait(1000);
writeln('done');
until(false);
end.

There, that should be good.

XxKanexX

2006-06-24 07:36:04

From: realrune

program New;

{.include srl/srl.scar}

procedure SleepAndMoveMouse2(Time : Integer); // By RSN, edit by RealRune
var
Moving : Boolean;
mx, my : Integer;
x, y, xv, yv : Extended;
gx, gy : Extended;
T : Integer;
begin
GetMousePos(mx, my);
x := mx;
y := my;
if (Random(2) = 0) then
Moving := False
else
Moving := True;
gx := 130 + Random(500);
gy := 130 + Random(300);
T := GetTickCount;
repeat
Sleep(10);
if (Moving) then
begin
if (gx > x) then
xv := xv + 0.1
else
xv := xv - 0.1;
if (gy > y) then
yv := yv + 0.1
else
yv := yv - 0.1;
x := x + xv;
y := y + yv;
MoveMouse(Round(x), Round(y));
end;
if (Random(100) = 0) then
Moving := not Moving;
if (Random(30) = 0) then
begin
gx := 130 + Random(500);
gy := 130 + Random(300);
end;
if (Distance(mx, my, Round(x), Round(y)) >= 120)then
begin
sleep(20 + random(20));
writeln('Moved over 120 pixels');
if(Random(2) = 1)then
MMouse(mx - random(5), my - random(5), 0, 0)
Else
MMouse(mx + random(5), mx + random(5), 0, 0);
repeat
sleep(10);
until (Abs(GetTickCount - T) >= Time);
exit;
end;
until (Abs(GetTickCount - T) >= Time);
end;

procedure ShakyWait(time : integer); // By RealRune
Var T, Cx, Cy : integer;
begin
T := GetTickCount;
repeat
if(Random(30) = 1)then
begin
if(Random(4) = 1)then
begin
IdleTime(100, 100, 1.0 + random(10))
writeln('Using a short idletime');
end
Else
begin
Writeln('Moving the mouse a little')
GetMousePos(cx, cy);
if(Random(2) = 1)then
MMouse(cx - random(7), cy - random(7), 0, 0)
Else
MMouse(cx + random(7), cy + random(7), 0, 0);
end;
end;
Sleep(10);
until (Abs(GetTickCount - T) >= Time);
end;

procedure HSWait(time : integer); // By RealRune
var S : integer;
begin
S := Time + Random(Time / 10);
if(Random(1000) = 1)then
begin
writeln('Using SleepAndMoveMouse');
SleepAndMoveMouse(S);
exit;
end
Else
if(Random(100) = 1)then
begin
writeln('Using SleepAndMoveMouse2');
SleepAndMoveMouse2(S);
exit;
end
Else
if(Random(10) = 1)then
begin
writeln('Using shaky wait');
ShakyWait(S);
exit;
end
Else
if(Random(10) = 1)then
begin
writeln('Using idletime');
IdleTime(S, 0, 1.0 + random(3))
exit;
end;
Sleep(s);
end;

begin
SetupSRL;
BenMouse := False;
MouseSpeed := 25;
repeat
HSWait(1000);
writeln('done');
until(false);
end.

There, that should be good.

That dosn't move for me, at all..

c0de

2006-06-24 11:24:31

What's the point of shaky wait ? Make us look retarded?

realrune

2006-06-24 20:00:04

From: c0de
What's the point of shaky wait ? Make us look retarded?


No, it moves the mouse a little bit, kindof acting like a human is playing… and not scar.

And it only moves if it uses shaky wait, idletime, or uses sleepandmovemouse.

z92

2006-06-25 01:41:21

It moves the mouse a bit wierd. forexample the moving mouse a little thing, it looks very strange.