toggle spams buttons

Get help with using AutoHotkey and its commands and hotkeys
keanpteamos
Posts: 4
Joined: 21 Dec 2017, 03:08

toggle spams buttons

09 Aug 2020, 12:46

Code: Select all

F7::
  if v1 = 1
    then v1 = 0

if v1 = 1
     then
   {
     Send, {r}
     MouseClick, left
   }
Return
So F7 makes v1 change depending on if it is already pressed or not, and if it is already pressed it spams send r and mouseclick left
I need help... why doesnt it work?
Error at line 3....
User avatar
Smile_
Posts: 279
Joined: 03 May 2020, 00:51

Re: toggle spams buttons

09 Aug 2020, 13:38

You don't need then in Auto-hotkey to execute line after checking a conditions,
plus you don't have to check the same condition 2 times just put them together.
something like this :

Code: Select all

v1 = 1
F7::
    if v1 = 1
    {
        v1 = 0
        Send, {r}
        MouseClick, left
    }
Return
I really don't see the need of checking if v1 = 1 unless this is a just part of a another script.
keanpteamos
Posts: 4
Joined: 21 Dec 2017, 03:08

Re: toggle spams buttons

09 Aug 2020, 15:13

hmm... that doesnt work, it just sends it once and then it doesnt work upon hitting F7
User avatar
Smile_
Posts: 279
Joined: 03 May 2020, 00:51

Re: toggle spams buttons

09 Aug 2020, 15:15

If you want it like that just do it without condition

Code: Select all

F7::
    Send, {r}
    MouseClick, left
Return

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], hamilbody, RubbeH, Xtra and 43 guests