Spork Posted June 11, 2021 Share Posted June 11, 2021 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. Quote Link to comment Share on other sites More sharing options...
Wanted Posted June 16, 2021 Share Posted June 16, 2021 Do you have an image of what you're talking about? It's likely you'll need something like color TPA functions to find the center etc. Quote Link to comment Share on other sites More sharing options...