RISK
2012-11-28 18:40:02
Features:
- Random mouse adjustment while autoclicking
- Mouse repositioning to make sure it doesn't get too far from the original clicking spot
Setup:
1. Setup the options at the top of the script and then start the script
2. Once the script is started, press shift on your keyboard while your mouse is where you want to autoclick
If you have any problems or errors, please report them in this thread. Make sure you also babysit it for a while to make sure it doesn't mess up in any way.
I hope this script helps someone in some way or lets them learn something about scripting.
- Random mouse adjustment while autoclicking
- Mouse repositioning to make sure it doesn't get too far from the original clicking spot
Setup:
1. Setup the options at the top of the script and then start the script
2. Once the script is started, press shift on your keyboard while your mouse is where you want to autoclick
// Version: 01
// See the script thread for setup instructions
program AutoClicker;
{$i SRL/SRL.simba}
const
// The min. and max. waits between clicks
MIN_WAIT = 2000;
MAX_WAIT = 3000;
RANDOM_ADJUSTMENT = True; // Do you want the mouse to move slightly randomly
STOP_KEY = VK_ESCAPE; // What key do you want to use for the stop key?
function GetClickingPos(): TPoint;
var
x, y: Integer;
begin
WriteLn('Detecting position to click at, please hit shift on your keyboard to select one.');
repeat
if IsKeyDown(VK_SHIFT) then
begin
SetupSRL;
GetMousePos(x, y);
Result := Point(x, y);
Break;
end;
Wait(50);
until(False);
WriteLn('Position detected at: ' + ToStr(Result) + '.');
end;
procedure Loop();
var
x, y, xx, yy, i: Integer;
p, po, originalP: TPoint;
begin
originalP := GetClickingPos();
p := originalP;
MMouse(p.x, p.y, 0, 0);
repeat
if RANDOM_ADJUSTMENT then
if (i >= RandomRange(25, 100)) then
if (Distance(p.x, p.y, originalP.x, originalP.y) > 5) then
begin
MMouse(originalP.x, originalP.y, 1, 1);
p := originalP;
end else
begin
i := 0;
MMouse(p.x, p.y, 4, 4);
GetMousePos(x, y);
p := Point(x, y);
end;
GetMousePos(xx, yy);
po := Point(xx, yy);
if (po <> p) then
begin
p.x := p.x + Random(4);
p.y := p.y + Random(4);
MMouse(p.x, p.y, 0, 0);
end;
ClickMouse2(True);
Wait(RandomRange(MIN_WAIT, MAX_WAIT));
Inc(i);
until(IsKeyDown(STOP_KEY));
end;
begin
ClearDebug();
Loop();
end.If you have any problems or errors, please report them in this thread. Make sure you also babysit it for a while to make sure it doesn't mess up in any way.
I hope this script helps someone in some way or lets them learn something about scripting.