ron1337
2008-11-03 18:07:31
My very first script.
I wrote this to keep my account from being logged out while doing boring things like cutting wood, fishing, fighting giants…lol
It moves the mouse randomly at a random time.
I wrote this to keep my account from being logged out while doing boring things like cutting wood, fishing, fighting giants…lol
It moves the mouse randomly at a random time.
program KeepAlive;
//Date: November 03, 2008
//Author: ron1337
//Credits: XxKanexX Super Basics Tutorial
// WhoCares357 Unmatched Beginner's Guide to Scripting Scar
Var
intWait, intRandom: Integer;
a, b, x, y, x1, y1, x2, y2, i, LoopCount: Integer;
mouseSpeed, ctrlSpacing, ctrlVariance: Integer;
begin
i := 0;
//How many time to iterate the loop
LoopCount := 5000; //<--USER CAN EDIT
//How long to pause between mouse movement (1000 = 1 second)
intWait := 10000; //<--USER CAN EDIT
//How much tolerance to randomize the pause time
intRandom := 5000; //<--USER CAN EDIT
//Controls speed of mouse (40-60 is best)
mouseSpeed := 50 //<--USER CAN EDIT
//Controls the distance between control points along the spline (20-50 is best)
ctrlSpacing := 35 //<--USER CAN EDIT
//Controls the randomness in each control point, smaller values = more straightness, larger values = more curvyness (50-80 is best)
ctrlVariance := 25 //<--USER CAN EDIT
//***************************************
//BEGIN SCRIPT CODING
//DO NOT EDIT BELOW THIS POINT
//***************************************
Writeln('');
Writeln('** Begin KeepAlive Script by ron1337 **');
Writeln('');
//get initial mouse position "base point"
Getmousepos(a, b);
Getmousepos(x, y);
//Start the loop
Repeat
i := i+1;
//wait ~30 seconds (randomized)
Wait((intWait + random(intRandom)) - random(intRandom));
//get current mouse position
Getmousepos(x1, y1);
//compare to previous mouse position
If (x = x1)and(y = y1) then
Begin
//Mouse has not moved since last loop
//Move mouse forward
x2 := x1 + 50 + random(100) - random(100);
y2 := y1 + 50 + random(100) - random(100);
MoveMouseSplineEx(x2,y2, 5, 5, (mouseSpeed + random(5)), (ctrlSpacing + random(5)), (ctrlVariance + random(5)));;
//Move mouse back toward base point
x2 := a + random(50) - random(50);
y2 := b + random(50) - random(50);
MoveMouseSplineEx(x2,y2, 5, 5, (mouseSpeed + random(5)), (ctrlSpacing + random(5)), (ctrlVariance + random(5)));
//Set mouse point
Getmousepos(x, y);
Writeln(' -KeepAlive was activated, mouse has been moved');
End else
Begin
//Mouse was manually move, reset base point
Writeln(' -Mouse was manually moved');
Getmousepos(a, b);
Getmousepos(x, y);
End;
Until(i = LoopCount);
end.