Script not stopping after untoggling

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
211298
Posts: 1
Joined: 14 Oct 2018, 01:58

Script not stopping after untoggling

15 Oct 2018, 04:18

Hey i am very new to ahk and i have a issue with this code not stopping after i press XButton1 it just keeps clicking.
What i would like for it to do is to stop clicking when i press the XButton1. If anyone could help me out with this it would mean a lot. Thanks for your time.
#SingleInstance, force

Loop
{
vsleep = 60
Sleep, 3000
vsleep = 120
Sleep, 3000
}

XButton1::
Toggle := !Toggle
While Toggle{
Click
Sleep %vsleep%
}
return
Rohwedder
Posts: 7645
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Script not stopping after untoggling

15 Oct 2018, 05:32

Hallo,
Unfortunately, this site is messed up so that I can no longer make a codebox!
Try:
SetTimer, vsleep, 3000
vsleep:
If vs := !vs
vsleep = 60
Else
vsleep = 120
Return
#MaxThreadsPerHotkey, 2
XButton1::
#MaxThreadsPerHotkey, 1
Toggle := !Toggle
While Toggle
{
Click
Sleep %vsleep%
}
return

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: gongnl, inseption86, jaka1 and 283 guests