hotstring not being recognized in a click loop

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
tg4m2FHzu8xZsytA
Posts: 1
Joined: 07 Jun 2023, 00:57

hotstring not being recognized in a click loop

Post by tg4m2FHzu8xZsytA » 07 Jun 2023, 01:19

hi, i've created a loop which just has click and an if statement that breaks the loop if stop is true, and every other loop in the code works with this and stops the loop once i type "stop", but when i try typing "stop" after activating the *click* loop by typing "click", the "stop" hotstring doesn't work anymore, which causes me to have to go to my desktop and try to exit the script

i'd expect this to happen with the loops that send keyboard input as it might mess with the hotstring, but definitely not a loop that sends mouse input
heres my code:

Code: Select all

#singleinstance force

stop := false
text := ""
amount := 0

:*:chaos::
stop := false
inputbox, text,, text
inputbox, amount,, amount
loop %amount% {
	send, {enter}
	send, %text%
	send, {enter}
	if (stop == true) {
		break
	}
}
return

:*:stop::
stop := true
return

:*:redo::
stop := false
loop %amount% {
	send, {enter}
	send, %text%
	send, {enter}
	if (stop == true) {
		break
	}
}
return

:*:click::
stop := false
loop {
	if (stop == true) {
		break
	}
	click
}
return

Rohwedder
Posts: 7647
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: hotstring not being recognized in a click loop

Post by Rohwedder » 07 Jun 2023, 02:47

Hallo,
specify the line #Hotstring NoMouse anywhere in the script (untested).
https://www.autohotkey.com/docs/v1/Hotstrings.htm#remarks

Post Reply

Return to “Ask for Help (v1)”