emog Posted May 21, 2007 Share Posted May 21, 2007 (edited) I would like to use the newly updated ControlClick command to send a mouseclick to an X, Y co-ordinate within a control/window.The syntax in the updated manual states:ControlClick("title", "text", controlID [, button [, clicks [, x [, y ]]]] )However, when using the Window Info tool, I there isn't a "text" or a "controlID" inside the particular control I wish to click (as shown in the initial screengrab above). In fact, the fields are rather sparse, with no status bar, visible or hidden text, either.I have tried the following syntax variations, without success:-ControlClick("Mozilla Firefox", "", ImlWinCls, "left", 1, $X, $Y)ControlClick("Mozilla Firefox", "", "ImlWinCls", "left", 1, $X, $Y)ControlClick("Mozilla Firefox", "", "[CLASS:ImlWinCls]", "left", 1, $X, $Y)ControlClick("Mozilla Firefox", "", "[CLASS:ImlWinCls; INSTANCE:3]", "left", 1, $X, $Y)ControlClick("Mozilla Firefox", "[CLASS:ImlWinCls; INSTANCE:3]", "", "left", 1, $X, $Y)Several of them work ok (no errors upon executing them), but they don't actually physicially carry out the clicks. The script finishes normally, so it must probably be doing something, just that it's not visible.WinActivate was used prior to using ControlClick, which discounts that possibility.Any further ideas? Thanks. Edited May 21, 2007 by emog Link to comment Share on other sites More sharing options...
James Posted May 21, 2007 Share Posted May 21, 2007 Your saying : $X, $Y You need to define them: $X = 40 $Y = 60 etc Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
emog Posted May 21, 2007 Author Share Posted May 21, 2007 (edited) I forgot to mention the $X and $Y values were already defined earlier in my code. However, even "hard coding" them in with values like: ControlClick("Mozilla Firefox", "", "[CLASS:ImlWinCls; INSTANCE:3]", "left", 1, 177, 346) ... brings about the same result (ie. it does nothing). Edited May 21, 2007 by emog Link to comment Share on other sites More sharing options...
James Posted May 21, 2007 Share Posted May 21, 2007 Try this: ControlClick("Mozilla Firefox", "", "left", 1, 177, 346) Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
emog Posted May 21, 2007 Author Share Posted May 21, 2007 Thanks, still doesn't work. Link to comment Share on other sites More sharing options...
James Posted May 21, 2007 Share Posted May 21, 2007 Hmm.. Do you get errors? Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
emog Posted May 21, 2007 Author Share Posted May 21, 2007 No errors whatsoever. The script runs and ends, but it appears like it's not doing anything. Do i need to be in a certain co-ords mode? I've tried it with: Opt("MouseCoordMode", 0) Opt("MouseCoordMode", 1) Opt("MouseCoordMode", 2) .. but still without success. Link to comment Share on other sites More sharing options...
James Posted May 21, 2007 Share Posted May 21, 2007 Try Larrys code above. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ Link to comment Share on other sites More sharing options...
emog Posted May 21, 2007 Author Share Posted May 21, 2007 Still no worky, unfortunately. =/ Link to comment Share on other sites More sharing options...
emog Posted May 21, 2007 Author Share Posted May 21, 2007 Ah, i've got it to click, but you need to move the mouse pointer using MouseMove(x,y) prior to using ControlClick, which defeats the object!You can try it yourself if you wish. It's for a robot game.Go to: http://miniclip2.shockplay.com/robotrage/rearmed/default.phpand use:Test@xyz.com (as the login)Test (as the password)... Submit, and then click on the "Text xyz" robot and press "Use Robot". Then click on the "Paintshop" tab at the top. It takes you to a little graphics editor for your robot.All the code you need to paint a "dot" should be:WinActivate("Robo") WinWaitActive("Robo") ControlClick("Robo", "", "ImlWinCls3", "left", 1, 177, 346)oÝ÷ Ù8^~e£§+0«p¢é]æjYr«Þm秺ÇÂ+a¢ëB¢{k¢P¥ÉºÚ"µÍÜ ][ÝÓ[ÝÙPÛÛÜ[ÙI][ÝËBÚ[XÝ]]J ][ÝÔØÉ][ÝÊBÚ[ØZ]XÝ]J ][ÝÔØÉ][ÝÊBÌÍÐÝÜÙØÜ[ÞHHÛÛÛÙ]ÜÊ ][ÝÔØÉ][ÝË ][ÝÉ][ÝË ][ÝÒ[[Ú[ÛÌÉ][ÝÊB[ÝÙXÛXÚÊ ][ÝÛY ][ÝË ÌÍÐÝÜÙØÜ[ÞVÌH ÈMÍË ÌÍÐÝÜÙØÜ[ÞVÌWH ÈÍ KThanks Link to comment Share on other sites More sharing options...
emog Posted May 22, 2007 Author Share Posted May 22, 2007 Any further ideas? Many thanks. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now