spartakos Posted February 3, 2014 Share Posted February 3, 2014 (edited) 1 Edited February 11, 2014 by spartakos Quote Link to comment Share on other sites More sharing options...
Bixby Sayz Posted February 3, 2014 Share Posted February 3, 2014 You could simply read the mouse position after calling mousebox and click at that position? procedure ClickMouseBoxEx(const Box: TBox; const MouseSpeed: LongInt); var MousePos: TPoint; begin MoveMouseBoxEx(Box, MouseSpeed); GetMousePos(MousePos.X, MousePos.Y); ClickMouse(MousePos.X, MousePos.Y, mbLeft); end; Quote Link to comment Share on other sites More sharing options...
spartakos Posted February 4, 2014 Author Share Posted February 4, 2014 (edited) 1 Edited February 11, 2014 by spartakos Quote Link to comment Share on other sites More sharing options...
Bixby Sayz Posted February 5, 2014 Share Posted February 5, 2014 Not sure on what you are trying to do. ClickMouseBoxEx would click somewhere in a rectangular area. If you want to click on an exact position ClickMouse will do everything you need. It is difficult to know what you are doing without seeing what you are working with. Often I will randomize the found point a bit (which is what you are trying to do here?) but how much to randomize depends entirely on the item you are clicking on: Too much randomization you'll miss the target. Not enough it looks very bot like. There is no hard and fast rule here. If I wanted to click somewhere within 10 pixels of the found point I would simply do something like this. var P: TPoint; // Left some out here cuz I'm too lazy to type... begin if FindBitmapTol(P.X, P.Y, ... then begin P := Point(RandomRange(P.X - 10, P.X + 10), RandomRange(P.Y - 10, P.Y + 10)); MoveMouse(P.X, P.Y); ClickMouse(P.X, P.Y, mbLeft); // more left out here end; // and here end; Quote Link to comment Share on other sites More sharing options...
spartakos Posted February 6, 2014 Author Share Posted February 6, 2014 (edited) 1 Edited February 11, 2014 by spartakos Quote Link to comment Share on other sites More sharing options...
Bixby Sayz Posted February 7, 2014 Share Posted February 7, 2014 (edited) I was trying to convey you can duplicate the functionality of ClickMouseBox exactly by doing the following: - Use MoveMouseBox (moves mouse to a random location inside the specified box) - Read the current mouse position using GetMousePos (to find out where MoveMouseBox moved the mouse to) - Click the mouse at that location using ClickMouse program New; var B: TBox; P: TPoint; begin B := Box(100, 100, 200, 200); MoveMouseBox(B); GetMousePos(P.X, P.Y); ClickMouse(P.X, P.Y, mbLeft); end. Edited February 7, 2014 by Bixby Sayz Quote Link to comment Share on other sites More sharing options...
spartakos Posted February 7, 2014 Author Share Posted February 7, 2014 (edited) 1 Edited February 11, 2014 by spartakos Quote Link to comment Share on other sites More sharing options...