SRL Archive - SRL Archives

procedure GetBounds(TimeInSecks, Rms : Integer);


WhiteShadow

2006-06-01 23:41:29

{*******************************************************************************
procedure GetBounds(TimeInSecks, Rms : Integer);
By: WhiteShadow
Description: Moves mouse around the activated client. Weird movements.
*******************************************************************************}
procedure GetBounds(TimeInSecks, Rms : Integer);
var
n, w, e, v, XBounds, YBounds, Ji, Nit, BoundsMark, MSpeed : Integer;
BMouse : Boolean;
begin
GetClientDimensions(n, w);
MarkTime(BoundsMark);
MSpeed:= MouseSpeed;
BMouse:= BenMouse;
BenMouse:= True;
MMouse(0, 0, n, w);
repeat
MouseSpeed:= 10 + random(Rms);
GetMousePos(e, v);
XBounds:= n - e
YBounds:= w - v
MMouse(XBounds, YBounds, 1, 1);
Ji:= Random(w);
if(Ji < YBounds)then
begin
MouseSpeed:= 5 + random(Rms);
MMouse(XBounds, Ji, 1, 1);
end;
Nit:= Random(n);
if(Nit < XBounds)then
begin
MouseSpeed:= 10 + random(Rms);
MMouse(Nit, YBounds, 1, 1);
end;
if(Ji < YBounds) and (Nit < XBounds)then
begin
MouseSpeed:= 10 + random(Rms);
MMouse(Nit, Ji, 1, 1);
end;
until(TimeFromMark(BoundsMark) >= TimeInSecks * 1000)
BenMouse:=BMouse;
MouseSpeed:=MSpeed;
end;
//TimeInSecks = TIme in Seconds you would like this to run.
//RMS= random mouse speeds you would like to add to 10 mousespeed.

Please open scar, copy and paste it in there, put this procedure in mainloop and fill params, select scar as client. Run. Or run it on any client, I'm just explaining the easy way so the chances of it being tested is higher.

Feedback is greatly appreciated.

Ace

2006-06-02 15:16:49

It works pretty well. Nice Job. :)

phantombmx

2006-06-02 20:37:04

i liked this :)

WhiteShadow

2006-06-03 00:11:05

Thank you for providing feedback, greatly appreciated. *Stares at noncommenteers. :p

Bebe

2006-06-03 02:50:28

My version:

program New;
{.include SRL/SRL.scar}



{*******************************************************************************
procedure GetBounds(TimeInSecks, Rms : Integer);
By: WhiteShadow edited by Bebemycat2
Description: Moves mouse around the activated client. Weird movements.
*******************************************************************************}
procedure GetBounds(TimeInSecks, Rms : Integer);
var
n, w, e, v, XBounds, YBounds, Ji, Nit, BoundsMark, MSpeed : Integer;
BMouse : Boolean;
math: array [1..7] of integer;
begin
GetClientDimensions(n, w);
MarkTime(BoundsMark);
MSpeed:= MouseSpeed;
BMouse:= BenMouse;
BenMouse:= True;
Ji:= Random(w);
MMouse(0, 0, n, w);
Math[1]:= Trunc(random(3)*(Pow(Ji, 2)));
Math[2]:= random(4)*Ji+random(3);
Math[3]:= Math[1]+Math[2];
Math[4]:= Trunc(Abs(Sqrt(Math[3])));
Math[5]:= n div 2;
Math[6]:= w div 2;
Math[7]:= Math[4] div 2;
repeat
MouseSpeed:= 10 + random(Rms);
GetMousePos(e, v);
XBounds:= n - e
YBounds:= w - v
MMouse(XBounds, YBounds, 1, 1);
if(Ji < YBounds)then
begin
MouseSpeed:= 8 + random(Rms);
(* MMouse(XBounds, Ji, 1, 1); *)
MMouse(Math[7], Ji,1,1);
end;
Nit:= Random(n);
if(Nit < XBounds)then
begin
MouseSpeed:= 12 + random(Rms);
MMouse(Nit, YBounds, 1, 1);
end;
if(Ji < YBounds) and (Nit < XBounds)then
begin
MouseSpeed:= 10 + random(Rms);
MMouse(Nit, Ji, 1, 1);
end;
until(TimeFromMark(BoundsMark) >= TimeInSecks * 1000)or
(Distance(e, v, Math[5], Math[6])>=650)
BenMouse:=BMouse;
MouseSpeed:=MSpeed;
end;
//TimeInSecks = TIme in Seconds you would like this to run.
//RMS= random mouse speeds you would like to add to 10 mousespeed.

begin
setupSRL;
repeat
GetBounds(10, 5);
until(false)
end.

WhiteShadow

2006-06-04 00:05:28

I like mines more. :p Yours div's coord sometimes resulting in rather short fast movements at times. *Just what I observed though.

I like the math though. ;) One question, why Trunc(Random(3))?

P.s - thanks for making feedback by just modding my work.

<3 ;P

Bebe

2006-06-04 22:04:06

I do:
Trunc(random(3)*(Pow(Ji, 2)));
Because somtimes that equation will result in a non-whole number (extended) and my arrrays are integers therefor I naeeded to have the "Trunc" there to round it down and make it an integer. ;)

WhiteShadow

2006-06-04 22:12:19

I thought those were separate like (Result of Trunc(3) * (Result). My bad. :p