Unable to get #IfWinActive to work

Get help with using AutoHotkey and its commands and hotkeys
AceSevenFive
Posts: 2
Joined: 30 Apr 2016, 09:08

Unable to get #IfWinActive to work

30 Apr 2016, 09:10

I'm trying to make an autoclicker script in Firefox, but I can't get the #IfWinActive portion to properly trigger. Here's my code:

Code: Select all

GroupAdd, Firefox, ahk_exe firefox.exe
#IfWinActive, akh_group Firefox
Numpad1::
Loop
{
If GetKeyState("Numpad1") {
If (AutoclickerOn = 1) {
Send {LButton}
Sleep, 50
}
Else
{
Break
}
}
}
Return

NumpadDel::
If (AutoclickerOn = 0) {
AutoClickerOn = 1
MsgBox Autoclicker enabled.
}
Else
{
AutoclickerOn = 0
MsgBox Autoclicker disabled.
}
Return
User avatar
Capn Odin
Posts: 1308
Joined: 23 Feb 2016, 19:45
Location: Denmark

Re: Unable to get #IfWinActive to work

30 Apr 2016, 10:30

There is a typo in the line:

Code: Select all

#IfWinActive, akh_group Firefox
it should be:

Code: Select all

#IfWinActive, ahk_group Firefox
Please excuse my spelling I am dyslexic.
AceSevenFive
Posts: 2
Joined: 30 Apr 2016, 09:08

Re: Unable to get #IfWinActive to work

30 Apr 2016, 10:36

Erm, those are the exact same lines...
User avatar
boiler
Posts: 5247
Joined: 21 Dec 2014, 02:44

Re: Unable to get #IfWinActive to work

30 Apr 2016, 10:40

Erm, there is a difference between "akh" and "ahk".

Return to “Ask For Help”

Who is online

Users browsing this forum: Elendiar and 306 guests