Jump to content


Photo

help with controlclick


  • Please log in to reply
24 replies to this topic

#1 Ronins

Ronins
  • Members
  • 115 posts

Posted 16 April 2012 - 08:12 PM

hey guys,
i've been trying to do control click, n it works... Problem is, it only works for some spot, not all... Tried to check my script at paint too... Was not able to click some spots, dont know why.... Any help please? It worked at other places

#2 janopn

janopn
  • Members
  • 691 posts

Posted 16 April 2012 - 08:18 PM

Leave us your code, please

#3 Ronins

Ronins
  • Members
  • 115 posts

Posted 16 April 2012 - 09:33 PM

controlclick, X430 Y630, app
controlclick, X565 Y635, app
controlclick, X570 Y545, app
sleep, 5000
controlclick, X230 Y140, app

Code isnt the final one... jst the blueprint one.... i know final one will be much shorter....
This is jst a part of series m gonna click....

EDIT:: that last control click... x230 y140 is the one aint working.. rest are working good....

#4 Leef_me

Leef_me
  • Moderators
  • 7704 posts

Posted 16 April 2012 - 10:46 PM

What is the program you are trying to control. Be specific. :!:

What is spacial about the 'last' location.
Actually, tell us what you are doing with each click.

Depending on the program, AHK can do a better job than just clicking 'random' locations.
Have you heard about and tried to use "Window Spy" on the program?

#5 Roninz

Roninz
  • Guests

Posted 17 April 2012 - 10:23 AM

Actually i got those coords from windows spy utility itself.. My app is a c sharp program which includes web browser control direction to a flash content of a website (a game).. In that game, we have to do a lvl again n again to get a tech upgrade which becomes quite time consuming n boring later in the game.. Anyways back to topic.. Herez wat these control clicks do..
1. Clicks on an icon leading to space station
2. Clicks on military menu
3. Clicks on refill option
sleeps for some seconds to refresh the weapons list
4. Refills ammo..
5. Confirms refills..
Havent used 5th one yet, 4th, n 5th are only having problems.. So i tried changing the sequence, then controlclicked on paint.. Same as before, only these 2 coords cant be clicked.. All other clicks are being made.. App is a sort of a bot..

#6 Ronins

Ronins
  • Members
  • 115 posts

Posted 17 April 2012 - 04:22 PM

any help?

#7 Ronins

Ronins
  • Members
  • 115 posts

Posted 18 April 2012 - 07:31 AM

this comment is to bring post back up... Help guys..

#8 janopn

janopn
  • Members
  • 691 posts

Posted 18 April 2012 - 01:03 PM

I read this many times, and i don't have idea why it won't work.
Other controlclicks worked and this is not.

Have tou tried to controlclick the last position first?
So we will ensure the problem may be the coords.

controlclick, X230 Y140, app

Does it click?

#9 CodeKiller

CodeKiller
  • Members
  • 2066 posts

Posted 18 April 2012 - 01:28 PM

By the way, why do you use ControlClick ? a single "Click" is as much effective as it click "through" (on ?) the window (don't really know how to say it sorry).
ControlClick is better if you want to use the name of a Ctrl.
But if you use Coord what's the point ???

#10 Ronins

Ronins
  • Members
  • 115 posts

Posted 18 April 2012 - 06:09 PM

my app displays flash content, so i need coords to click. And i cant use click cuz i dont want mouse to go at coords. I want simple clicks
And ya, i tried changing sequences n stuffs, doesnt work either. I even tried this on paint. no results here too..

#11 janopn

janopn
  • Members
  • 691 posts

Posted 18 April 2012 - 06:57 PM

Weird.
Errorlevel does not retrieve 1?

I read something that could help, in the info of controlclick..

Controlclick structure:

ControlClick [, Control-or-Pos, WinTitle, WinText, WhichButton, ClickCount, Options, ExcludeTitle, ExcludeText]

You say it's a flash application. In the coords X230 Y140 there is no control?
I image there is not (if so, you can just controlclick that control).

Ok, now, the interesting thing comes in the "Option" option of Controclick Structure..

Xn: Specify for n the X position to click at, relative to the control's upper left corner. If unspecified, the click will occur at the horizontal-center of the control.

Yn: Specify for n the Y position to click at, relative to the control's upper left corner. If unspecified, the click will occur at the vertical-center of the control.


This means that, if there is a control near, you can get the coords of that control, and try to add Xn and Yn positions untill you reach the X230 Y140. Do you understand?

You make the controlclick structure as if you were clicking another control. Then you start "moving" the coords with the Xn Yn option, untill you reach the X230 Y140.

I know this sounds stupid.. but it's still an option

#12 0x150

0x150
  • Guests

Posted 18 April 2012 - 07:06 PM

my app displays flash content

controlclick, X430 Y630, app
Make sure your Click Coordinates are relative to the window and not screen coordinates ( a common mistake when clicking con coords ).
You may have to do subtractive math to determine the actual relative coords.. just sayin' ;)

#13 Ronins

Ronins
  • Members
  • 115 posts

Posted 18 April 2012 - 09:04 PM

Weird.
Errorlevel does not retrieve 1?

I read something that could help, in the info of controlclick..

Controlclick structure:

ControlClick [, Control-or-Pos, WinTitle, WinText, WhichButton, ClickCount, Options, ExcludeTitle, ExcludeText]

You say it's a flash application. In the coords X230 Y140 there is no control?
I image there is not (if so, you can just controlclick that control).

Ok, now, the interesting thing comes in the "Option" option of Controclick Structure..


Xn: Specify for n the X position to click at, relative to the control's upper left corner. If unspecified, the click will occur at the horizontal-center of the control.

Yn: Specify for n the Y position to click at, relative to the control's upper left corner. If unspecified, the click will occur at the vertical-center of the control.


This means that, if there is a control near, you can get the coords of that control, and try to add Xn and Yn positions untill you reach the X230 Y140. Do you understand?

You make the controlclick structure as if you were clicking another control. Then you start "moving" the coords with the Xn Yn option, untill you reach the X230 Y140.

I know this sounds stupid.. but it's still an option



Ya, dats a flash application, literally full of buttons. But those are inbuilt in flash, so cant get their IDs with windows spy. I tried using your code in paint, but seems like it clicks just over itself, not with any displacement.

EDIT: i did some experiments, n i guess i cant seem to click above the half the height of my app... Thats just a guess that it is half. Maybe more or less. But lets say its half. I can click below the half, not above. Make any sense?


my app displays flash content

controlclick, X430 Y630, app
Make sure your Click Coordinates are relative to the window and not screen coordinates ( a common mistake when clicking con coords ).
You may have to do subtractive math to determine the actual relative coords.. just sayin' ;)


And ya, its relative i got those coords from window spy's active window coords part

Another EDIT: I made browser embedded GUI, just to make sure if there was any problem with my app. I am facing same problem in that browser embedded GUI too.

#14 Ronins

Ronins
  • Members
  • 115 posts

Posted 19 April 2012 - 07:15 AM

i cant use regular click, cuz i need the app to work even when it is minimized. Also, regular click will obstrtuct with some one's work

#15 Maestr0

Maestr0
  • Members
  • 649 posts

Posted 19 April 2012 - 10:53 AM

Try it when it's active with the code like below, just to make sure there's clicks in exactly the right spot:
MouseMove, 430, 630
sleep 100
tooltip click
sleep 1000
tooltip
MouseMove, 230, 140
sleep 100
tooltip click
sleep 1000
tooltip