Separate ControlClick Sleep/Loop/Delay Topic is solved

Get help with using AutoHotkey and its commands and hotkeys
wyw
Posts: 72
Joined: 12 Dec 2015, 19:11

Separate ControlClick Sleep/Loop/Delay

09 Feb 2018, 16:49

There's something in my script that I want to be so that it ControlClicks every 10 seconds, but it shouldn't affect the other ControlClicks. Basically, "SetControlDelay" should not be changed. The small change here is "ControlClick, X2576 Y1556" every 10 seconds. But since there is no other way apparently, you have to do it with SetTimer

Code: Select all

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
#MaxThreadsPerHotkey 2
Settimer pressBevery10seconds, % 10 * 1000
banana:=0
SetTitleMatchMode, 2
F1::
banana:=!banana
    while (banana=1)
	{
		pressBevery10seconds:
		ControlClick, X2576 Y1556, ahk_class ahk_class Chrome_WidgetWin_1
		return
		
		
		ControlClick, X1966 Y766, ahk_class ahk_class Chrome_WidgetWin_1
		SetControlDelay -1
		ControlClick, X1248 Y1099, ahk_class ahk_class Chrome_WidgetWin_1
		SetControlDelay -1
		ControlClick, X2446 Y1837, ahk_class ahk_class Chrome_WidgetWin_1
		SetControlDelay -1
		ControlClick, X3089 Y1238, ahk_class ahk_class Chrome_WidgetWin_1
		SetControlDelay -1
		ControlClick, X2869 Y1521, ahk_class ahk_class Chrome_WidgetWin_1
		SetControlDelay -1
		ControlClick, X6886 Y1672, ahk_class ahk_class Chrome_WidgetWin_1
		SetControlDelay -1
		SetControlDelay 120
		
    }
return

f7::ExitApp 
Can someone help me with this?
User avatar
Nextron
Posts: 1219
Joined: 01 Oct 2013, 08:23
Location: Netherlands OS: Win7 x64 AHK: Unicode x32

Re: Separate ControlClick Sleep/Loop/Delay  Topic is solved

09 Feb 2018, 18:06

?

Code: Select all

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
#MaxThreadsPerHotkey 2
Settimer pressBevery10seconds, % 10 * 1000
banana:=0
SetTitleMatchMode, 2
F1::
banana:=!banana
SetControlDelay -1
    while (banana=1)
	{
		ControlClick, X1966 Y766, ahk_class ahk_class Chrome_WidgetWin_1
		ControlClick, X1248 Y1099, ahk_class ahk_class Chrome_WidgetWin_1
		ControlClick, X2446 Y1837, ahk_class ahk_class Chrome_WidgetWin_1
		ControlClick, X3089 Y1238, ahk_class ahk_class Chrome_WidgetWin_1
		ControlClick, X2869 Y1521, ahk_class ahk_class Chrome_WidgetWin_1
		ControlClick, X6886 Y1672, ahk_class ahk_class Chrome_WidgetWin_1
    }
return

pressBevery10seconds:
	SetControlDelay 120
	ControlClick, X2576 Y1556, ahk_class ahk_class Chrome_WidgetWin_1
return

f7::ExitApp 
wyw
Posts: 72
Joined: 12 Dec 2015, 19:11

Re: Separate ControlClick Sleep/Loop/Delay

10 Feb 2018, 04:58

Nextron wrote:?

Code: Select all

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
#MaxThreadsPerHotkey 2
Settimer pressBevery10seconds, % 10 * 1000
banana:=0
SetTitleMatchMode, 2
F1::
banana:=!banana
SetControlDelay -1
    while (banana=1)
	{
		ControlClick, X1966 Y766, ahk_class ahk_class Chrome_WidgetWin_1
		ControlClick, X1248 Y1099, ahk_class ahk_class Chrome_WidgetWin_1
		ControlClick, X2446 Y1837, ahk_class ahk_class Chrome_WidgetWin_1
		ControlClick, X3089 Y1238, ahk_class ahk_class Chrome_WidgetWin_1
		ControlClick, X2869 Y1521, ahk_class ahk_class Chrome_WidgetWin_1
		ControlClick, X6886 Y1672, ahk_class ahk_class Chrome_WidgetWin_1
    }
return

pressBevery10seconds:
	SetControlDelay 120
	ControlClick, X2576 Y1556, ahk_class ahk_class Chrome_WidgetWin_1
return

f7::ExitApp

Thanks! Didn't know it was so easy.

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], colt, CyL0N, ryancoll22 and 58 guests