 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Logman
Joined: 19 Feb 2008 Posts: 54
|
Posted: Sun Jul 06, 2008 8:17 am Post subject: Controlclick problem |
|
|
Hi,
I have this bit of code working but I would like to do a couple of extra things with it that are causing problems. I want it to click the contol once every three seconds for a total period of thirty seconds (10 clicks) when the hotkey is hit. Howerver I have more than one identical window open at the time so it's clicking double, triple, whatever at each click making the windows flash. I am playing a game throughout the 30 seconds as well. I tried SetKeyDelay but ControlSend won't work with this button.
| Code: |
T::
Option(getid())
return
;********************************
getid()
{
id := ""
MouseGetPos, , , id
return id
}
;********************************
Option(id)
{
IfWinExist, ahk_class #32770,
{
WinGet, idList, List, ahk_class #32770,
Loop, %idList%
{
winID := idList%a_index%
ControlClick, AfxWnd42u38, ahk_id%winID%
}
}
}
return |
|
|
| Back to top |
|
 |
SpiderGames
Joined: 09 Jun 2008 Posts: 290 Location: Canada
|
Posted: Sun Jul 06, 2008 5:00 pm Post subject: |
|
|
for teh controal thing this is what u can do...
| Code: |
Loop, 10
{
Send, {ControlDown}{ControlUp}
Sleep, 3000
}
|
simple _________________ http://www.spider-games77.piczo.com
Join the Elite few... |
|
| Back to top |
|
 |
Logman
Joined: 19 Feb 2008 Posts: 54
|
Posted: Mon Jul 07, 2008 8:05 am Post subject: |
|
|
Thanks SpiderGames, I've got it working every three seconds. So I just need to work out how to send only one click for each three seconds if there is more than one of the button AfxWnd42u38 visible at the time. Can anyone show me how to do that, or suggest what control to use?
| Code: |
T::
Loop, 10
{
Send, {ControlDown}{ControlUp}
Option(getid())
Sleep, 3000
}
return
;********************************
getid()
{
id := ""
MouseGetPos, , , id
return id
}
;********************************
Option(id)
{
IfWinExist, ahk_class #32770,
{
WinGet, idList, List, ahk_class #32770,
Loop, %idList%
{
winID := idList%a_index%
ControlClick, AfxWnd42u38, ahk_id%winID%
}
}
}
return |
|
|
| Back to top |
|
 |
Logman
Joined: 19 Feb 2008 Posts: 54
|
Posted: Mon Jul 07, 2008 11:58 am Post subject: |
|
|
| I found a different way that didn't give me he extra clicks problem, thanks again SG. |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|