SRL Archive - Other Scripts

Mouse recorder


Negaal

2008-01-07 13:42:54

Mouse recorder-
-by Nielsie95, Mick and Negaal

I edited it out and got idea from Micks mouse recorder…

-Nielsie helped me to get holding mouse working :)
-I made the base:)

Records mouse clicks and moving very exactly, It's not needed to drag window, I don't recommend it at all…

Made it for text based online game…:)

program MouseRecorder;
//By Negaal, Nielsie95, Mick
//You can see whats happening from status bar and debug box
//Just hit run
type
mousepos1 = record
x : integer;
y : integer;
isdown : boolean;
timetorelease : Integer;
end;

Const
Randomnessx = 0;
Randomnessy = 0;
Smoothness = 4; //LOWER = SMOOTHER MOVEMENT HIGHER = LESS LAG// //Recommended 1 - 10
RecordLenght = 2200; //HOW MANY COORDS TO RECORD?
PlayBackOnce = True; // plays back only once, if false repeats it


var x, y, i :integer;
var mousecp : Array of mousepos1;

procedure MakecoordsArray;
begin
SetArraylength(mousecp, Recordlenght);
for I:=0 to (RecordLenght)-1 do
begin
Status('Recording');
Wait(Smoothness);
GetMousePos(x, y)
mousecp[i].x := X;
mousecp[i].y := Y;
if ismousebuttondown(true) then
begin
mousecp[i].isdown := true;
for i:=i to (RecordLenght)-1 do
begin
Wait(Smoothness);
GetMousePos(x, y)
mousecp[i].x := X;
mousecp[i].y := Y;
if not ismousebuttondown(true) then
begin
mousecp[i].timetorelease := i;
break;
end;
end;
end;
end;
end;

procedure MoveTheDamnMouse;
begin
Status('Moving mouse...');
for I:=0 to (RecordLenght)-1 do
begin
wait(Smoothness);
MoveMouse(mousecp[i].x+random(Randomnessx), mousecp[i].y+random(Randomnessy));
if mousecp[i].isdown = true then
begin
movemouse(mousecp[i].x,mousecp[i].y);
holdmouse(mousecp[i].x,mousecp[i].y, true)
repeat
MoveMouse(mousecp[i].x+random(Randomnessx), mousecp[i].y+random(Randomnessy));
Wait(Smoothness);
Inc(i);
if mousecp[i].timetorelease = i then Break;
until i >= RecordLenght -1;
i := i -1;
releasemouse(mousecp[i].x,mousecp[i].y, true);
end;
end;
end;

begin
ClearDebug;
Writeln('Press F4 to record');
While not isFKeydown(4) do wait(100);
MakecoordsArray;
Writeln('Recording done!');
Writeln('Press F5 to move your mouse...');
While not isFkeyDown(5) do wait(100);

if playbackonce then MoveTheDamnMouse else
begin
repeat
wait(2000);
MoveTheDamnMouse;
until false
end;
Writeln('Done');
end.

Have fun

nething

2008-01-13 23:55:42

Can you make it repeat? Anyway looks nice I'll try it.

Sir R. M8gic1an

2008-01-14 06:50:06

hehe nice, actually i used something like this the first time i tried to auto :p a mouse recorder that would walk me from al kharid bank to furnace, failed miserably :p

nething

2008-01-14 14:29:45

From: Rasta Magician
hehe nice, actually i used something like this the first time i tried to auto :p a mouse recorder that would walk me from al kharid bank to furnace, failed miserably :p


Yea I tried that once. Kept messing up because RS rotates the map so it would click the wrong places. Tried to make it craft airs for me =\.

[ONTOPIC] Haven't tried yet because I found a different way to do what I was going to use it for[/ONTOPIC]

GoF

2008-01-16 08:46:46

I think I made one of these some time ago.. Worked like crap though so never released it.

Gj, seems lewt.