SRL Archive - SRL Archives

Procedure JMouse(hl,hk : integer ; jl, jk : integer; left:boolean);


JuKKa

2006-12-16 19:16:57


{*******************************************************************************
procedure JMouse(hl,hk : integer ; jl, jk : integer; left:boolean);
By: JuKKa
Description: Moves the mouse a little randomly. should be pretty undetectable
*******************************************************************************}
Procedure JMouse(hl,hk : integer ; jl, jk : integer; left:boolean);
var
KK,KL : Integer;
GK,Gl : Integer;
begin
getmousepos(kk,kl)
Case random(2)of
0 : kk:= kk + 250;
1 : kk:= kk - 250;
end;

Case random(2)of
0: kl:= kl + 250;
1: kl:= kl - 250;
end;

case random(2)of
0: GL:= hl + 150;
1: GL:= HL - 150;
end;

Case Random(2)of
0: GK:= Hk + 150;
1: Gk:= Hk - 150;
end;

MouseSpeed:= 5+random(5);
MMouse(kk,Kl,10,10)
MouseSpeed:= 15+random(5);
MMouse(Gl,Gk,Jl,Jk)
MouseSpeed:= 10+random(5);
Mouse(Hl,Hk,Jl,Jk,left)
end;

u use it like this:


Begin
SetupSRL;
activateclient;
JMouse(895, 121,5,5,true)
End.

and for the lazy ones:


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

procedure setup;
begin
setupsrl;
x:= 500;
y:= 500;
end;

Procedure JMouse(hl,hk : integer ; jl, jk : integer; left:boolean);
var
KK,KL : Integer;
GK,Gl : Integer;
begin
getmousepos(kk,kl)
Case random(2)of
0 : kk:= kk + 250;
1 : kk:= kk - 250;
end;

Case random(2)of
0: kl:= kl + 250;
1: kl:= kl - 250;
end;

case random(2)of
0: GL:= hl + 100;
1: GL:= HL - 100;
end;

Case Random(2)of
0: GK:= Hk + 100;
1: Gk:= Hk - 100;
end;

MouseSpeed:= 5+random(5);
MMouse(kk,Kl,10,10)
MouseSpeed:= 15+random(5);
MMouse(Gl,Gk,Jl,Jk)
MouseSpeed:= 10+random(5);
Mouse(Hl,Hk,Jl,Jk,left)
end;

begin
Setup;
activateclient;
JMouse(X, Y,5,5,true)
end.

open up a BIG window in paint, if u wonder how it will move.

Yakman

2006-12-16 19:51:20


modern art :p

i think its a good idea, but its too regular, perhaps you should add more of those case random statments

JuKKa

2006-12-17 02:13:23

looks good lol .. yeah i might add when i come back from church..

edit:/ while in church i got a idea… show u later :)
k.. im so brain washed… is there a way to make it choose a value from 0-250?

Akriam

2006-12-17 11:00:36

Yes:


Begin Case Random(2)
0: X :=0+Random(250)
1: X :=250-Random(250)
end;

Something like that :)

JuKKa

2006-12-17 13:13:19

k thx ill credit j00 :P


{*******************************************************************************
procedure JMouse(hl , hk, jl , jk : integer; left:boolean);
By: JuKKa, Small credit to: Akriam
Description: Random mouse movement.
Example: Jmouse(500,500,5,5,true)
*******************************************************************************}
procedure JMouse(hl , hk, jl , jk : integer; left:boolean);
var
KK,KL : Integer;
GK,Gl : Integer;
begin
Case random(2)of
0: kk:= Hk + Random(250);
1: kk:= Hk - Random(250);
end;
Case random(2)of
0: kl:= Hl + Random(250);
1: kl:= Hl - Random(250);
end;
case random(2)of
0: GL:= Hk + Random(250);
1: GL:= Hk - Random(250);
end;
Case Random(2)of
0: Gk:= Hl + Random(250);
1: Gk:= Hl - Random(250);
end;
mousespeed:=15;
MMouse(hl,hk,kk,kl);
writeln('33,3%')
MMouse(hl,hk,gk,gl);
writeln('66,6%')
Mouse(Hl,Hk,Jl,Jk,left)
writeln('99,9%')
writeln('100% Succsessfuly Moved Mouse.')
end;

had a few problems with it but should work fine now.

developers feel free to add this into –> SRL/SRL/Core/MouseFlag.Scar. i would feel honoured! ^_^

-Known bugs if it moves over the "screen" it kinds of tilt's and moves up and down fast.
-Need fix omg :O

Akriam

2006-12-17 16:19:36

You should add an option at the end that would make it move the mouse in a random pattern like a parabula:


var KK,KL ,GK,GL
begin
getmouspos(X,Y)
GK :=X*2
GL :=Y
end;


That is a simple curve :)

Bebe

2006-12-17 16:25:39

From: Akriam
You should add an option at the end that would make it move the mouse in a random pattern like a parabula:


var KK,KL ,GK,GL
begin
getmouspos(X,Y)
GK :=X*2
GL :=Y
end;


That is a simple curve :)


If you want a parabola then just use even powers:

pow(X,2)

:)

Akriam

2006-12-17 17:03:30

I didn't even know you could do a power function…erm…actually I did I just couldn't remember it. I just used 2 to demonstrate x to the power of 2 or whatever :) Thanks Bebe.