Hotkey only working once?

Get help with using AutoHotkey and its commands and hotkeys
zantaff
Posts: 2
Joined: 30 Nov 2016, 03:19

Hotkey only working once?

29 Aug 2017, 20:39

The Numpad1 hotkey will only execute once. If I hit it again, it does nothing.

Code: Select all

Top:
WinActivate, 
Click 150, 1075
Sleep 10
Click 150, 1075
Sleep 500
WinWaitActive, 
Sleep 100
WinActivate, 
Sleep 100
WinMove, , ,1925, 10
Sleep 2000
Click 500,555
Sleep 8000
Click 803, 504
Sleep 100
Click 360,582
Sleep 1000
Click 940,335
Sleep 200

Start:
WinActivate, 
Click 280, 450
Sleep 400
Click 280, 500
sleep 1700
Goto Start
Return

Numpad1::
WinClose, 
sleep 500
Goto Top
Return

Esc::
WinClose, 
ExitApp
Return
obeeb
Posts: 140
Joined: 20 Feb 2014, 19:15

Re: Hotkey only working once?

29 Aug 2017, 22:00

Probably because it gets stuck in WinWaitActive. You can verify it by double clicking on the script icon in the taskbar and checking which lines executed last.
User avatar
Cuadrix
Posts: 224
Joined: 07 May 2017, 08:26

Re: Hotkey only working once?

30 Aug 2017, 03:43

It's probably because of WinClose, that you placed before Goto, Top
If you press the Numpad1 button, it will first close the window and, AFTER that go to Top label where it will get stuck in WinWaitActive because there is no window to be activated.
----

Return to “Ask For Help”

Who is online

Users browsing this forum: 3d1t0r, Bing [Bot], boiler, drewjbx1, evilmanimani, mikeyww, yyardim and 53 guests