AutoHotKey:#IffWinActive not working
问题描述:
所以我制作了一个AFK
挡板,但是我需要它只能在一个程序中运行,所以我使用#If WinActive
但无济于事。AutoHotKey:#IffWinActive not working
#If WinActive("ahk_class WINDOWSCLIENT")
while(1 = 1) {
Send, {W down}
sleep 240
Send, {W up}
sleep 240
Send, {A down}
sleep 240
Send, {A up}
sleep 240
Send, {S down}
sleep 240
Send, {S up}
sleep 240
Send, {D down}
sleep 240
Send, {D up}
}
答
的#IfWin directives仅用于创建上下文相关的热键和热字串。 尝试使用循环或SetTimer的与IfWinActive:
Loop
{
If WinActive("ahk_class WINDOWSCLIENT")
{
while(1 = 1)
{
; do something
}
}
}
干杯我的朋友。 – Ninsto