H
hoogli
Guest
if you thought mining in runescape was boring, check out http://www.braingle.com/games/click/index.php. The name is self-explanatory. The high scores for it go up to 4 million! Personally, I'm up to 50,000. I made a script to auto-click it using SCAR 3.03. It's not perfect, so I'm open to suggestions.
Code:
program clickthebutton;
//Version 1.0. Written by hoogli for
//http://www.braingle.com/games/click/index.php. Find
//the coordinates of the top left corner of the flash
//BEFORE starting the script, and enter them when prompted.
//Press alt+f4 to exit the script, since ctrl+f4 doesn't work.
//Feel free to change the number of saves made (line 45).
//Don't change anything else unless you know what you're doing.
//And don't forget to sign in before starting the script!
var
topleftX, topleftY, Xcoord, Ycoord,
clickssofar, savecount, randomwait, maxclicks, seed : integer;
setupform: TForm;
OKbutton: TButton;
imputX, imputY: TEdit;
procedure click;
begin
savecount := 0;
repeat
for seed := 3 to 4 do
begin
randomwait := seed * seed * seed * seed;
maxclicks := 555 - seed * seed * seed * seed * 2 + random(50);
clickssofar := 0;
repeat
if findcolor(Xcoord, Ycoord, 3945227,
topleftX, topleftY, topleftX + 350, topleftY + 300) then
begin
clickmouse(Xcoord, Ycoord, true);
clickssofar := clickssofar + 1;
wait(randomwait + random(seed * seed * seed));
end
else
begin
writeln('color not found');
exit;
end
until (clickssofar > maxclicks);
clickmouse(topleftX + 150, topleftY + 250, true);
savecount := savecount + 1;
wait(5000);
end;
until savecount = 100
end;
procedure ButtonClick(sender: TObject);
begin
topleftX := strtoint(imputX.text);
topleftY := strtoint(imputY.text);
setupform.ModalResult:= mrOk;
click;
end;
procedure setup;
begin
setupform := createform;
setupform.Left := 250;
setupform.Top := 114;
setupform.BorderStyle := bsDialog;
setupform.Caption := 'Setup';
setupform.ClientHeight := 60;
setupform.ClientWidth := 160;
setupform.Visible := false;
OKbutton := TButton.Create(nil);
OKbutton.parent := setupform;
OKbutton.Left := 1;
OKbutton.Top := 25;
OKbutton.Width := 155;
OKbutton.Height := 25;
OKbutton.Caption := 'OK';
OKbutton.TabOrder := 3;
OKbutton.OnClick:= @ButtonClick;
OKbutton.default := true;
imputX := TEdit.Create(nil);
imputX.parent := setupform;
imputX.Autoselect := true;
imputX.Left := 1;
imputX.Top := 1;
imputX.Width := 75;
imputX.Height := 21;
imputX.TabOrder := 1;
imputX.Text := 'X';
imputY := TEdit.Create(nil);
imputY.parent := setupform;
imputY.Autoselect := true;
imputY.Left := 80;
imputY.Top := 1;
imputY.Width := 75;
imputY.Height := 21;
imputY.TabOrder := 2;
imputY.Text := 'Y';
end;
procedure SafeMainInitForm;
var
v: TVariantArray;
begin
SetArrayLength ( V, 0);
ThreadSafeCall ( 'setup', V);
end;
procedure ShowFormModal;
begin
setupform.ShowModal;
end;
procedure SafeShowFormModal;
var
v: TVariantArray;
begin
setarraylength(V, 0);
ThreadSafeCall('ShowFormModal', v);
end;
begin
SafeMainInitForm;
SafeShowFormModal;
end.
