stop loop Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
malboro8
Posts: 5
Joined: 18 Jan 2021, 12:18

stop loop

27 Jan 2021, 10:59

hi i have a question how to stop a loop there
i need it exactly below settimer coz i need it to smap like qqqqw / if i will set it in "pme" it will sync and spam qwqw etc / in future there will be some imagesearh functions (pme sections) and i need to spam q without adding it into "pme"

Code: Select all

#SingleInstance Force
#Persistent
#MaxHotkeysPerInterval 99000000
#HotkeyInterval 99000000
#KeyHistory 0
SendMode Input
SetWorkingDir %A_ScriptDir%
SetTitleMatchMode, 3
SetMouseDelay, -1
SetControlDelay, -1
Process, Priority, , H
SetBatchLines, -1

~CapsLock::
If GetKeyState("CapsLock", "T")
Settimer,pme, 40
loop                          
{
send q
sleep 40
}
If !GetKeyState("Capslock", "T")
Settimer,pme, Off                           ; need to stop it here with pme
Return

pme:
send w
sleep 60
return

x::
Reload
Rohwedder
Posts: 7643
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: stop loop  Topic is solved

27 Jan 2021, 11:16

Hallo,
replace:

Code: Select all

If !GetKeyState("Capslock", "T")
by:

Code: Select all

Until, !GetKeyState("Capslock", "T")
malboro8
Posts: 5
Joined: 18 Jan 2021, 12:18

Re: stop loop

27 Jan 2021, 11:41

Thank you

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: slowwd and 239 guests