Simba Code:
// 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.