Jump to content

ControlClick using XY co-ords


Recommended Posts

Posted Image

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 by emog
Link to comment
Share on other sites

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 by emog
Link to comment
Share on other sites

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

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.php

and 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
ÈÍ
K

Thanks

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...