Separate ControlClick Sleep/Loop/Delay

Post a reply

Confirmation code
Enter the code exactly as it appears. All letters are case insensitive.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :| :mrgreen: :geek: :ugeek: :arrow: :angel: :clap: :crazy: :eh: :lolno: :problem: :shh: :shifty: :sick: :silent: :think: :thumbup: :thumbdown: :salute: :wave: :wtf: :yawn: :facepalm: :bravo: :dance: :beard: :morebeard: :xmas: :HeHe: :trollface: :cookie: :rainbow: :monkeysee: :monkeysay: :happybday: :headwall: :offtopic: :superhappy: :terms: :beer:
View more smilies

BBCode is ON
[img] is OFF
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Separate ControlClick Sleep/Loop/Delay

Re: Separate ControlClick Sleep/Loop/Delay

by wyw » 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.

Re: Separate ControlClick Sleep/Loop/Delay

by Nextron » 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 

Separate ControlClick Sleep/Loop/Delay

by wyw » 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?

Top