Jump to content
Spork

A simple search and click script

Recommended Posts

I'm writing a simple script to search for a color, click it, and wait a fixed amount of time. This seemed very simple, but it has proven the exact opposite! Occasionally my target is quite small, and ClickMouse seems to occasionally click up to 20 pixels away from my target colored pixel. What can I do to fix this and make the click a little more consistent?

Code follows:

Const

Color = 3160642; // color you wish to click

Procedure Rotate;

Begin;
  VKeyDown(39); // Holds the "W"-key.
  Wait(700); // Teh wait...
  VKeyUp(39); // Releases the "W"-key.
end;

Procedure FindClick;
Var X,Y,W,H: Integer;

begin
  If FindColor(X,Y,Color,0,0,500,340) then
  Begin
    MoveMouse(X,Y);
    ClickMouse(X,Y,False);
  end else
  Begin
    //
  end;
end;

begin;
  Repeat // Repeats for ever.. or until program is stopped.
  FindClick;
  Wait(5000);
  Until False;
end.  

Thanks in advance, I hope people still use this service.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
  • Create New...