AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Controlclick problem

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Logman



Joined: 19 Feb 2008
Posts: 54

PostPosted: Sun Jul 06, 2008 8:17 am    Post subject: Controlclick problem Reply with quote

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
View user's profile Send private message
SpiderGames



Joined: 09 Jun 2008
Posts: 290
Location: Canada

PostPosted: Sun Jul 06, 2008 5:00 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Logman



Joined: 19 Feb 2008
Posts: 54

PostPosted: Mon Jul 07, 2008 8:05 am    Post subject: Reply with quote

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
View user's profile Send private message
Logman



Joined: 19 Feb 2008
Posts: 54

PostPosted: Mon Jul 07, 2008 11:58 am    Post subject: Reply with quote

I found a different way that didn't give me he extra clicks problem, thanks again SG.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group