If statement 为自动热键创建条件-如果框处于打开状态,则不发送任何内容

If statement 为自动热键创建条件-如果框处于打开状态,则不发送任何内容,if-statement,conditional,autohotkey,If Statement,Conditional,Autohotkey,我写了一个自动热键脚本,它看起来像这样: ^1::SendInput t/accepthelp 1{enter} ^2::SendInput t/accepthelp 2{enter} ^3::SendInput t/accepthelp 3{enter} ^4::SendInput t/accepthelp 4{enter} ^5::SendInput t/accepthelp 5{enter} ^6::SendInput t/accepthelp 6{enter} ^7::SendInput

我写了一个自动热键脚本,它看起来像这样:

^1::SendInput t/accepthelp 1{enter}
^2::SendInput t/accepthelp 2{enter}
^3::SendInput t/accepthelp 3{enter}
^4::SendInput t/accepthelp 4{enter}
^5::SendInput t/accepthelp 5{enter}
^6::SendInput t/accepthelp 6{enter}
^7::SendInput t/accepthelp 7{enter}
^8::SendInput t/accepthelp 8{enter}
^9::SendInput t/accepthelp 9{enter}
这是为SAMP设计的,效果非常好t是在游戏中触发输入框打开的键

我需要做的是:如果我在游戏中手动打开盒子(我按下t),然后随机按下热键,我不希望他们发送任何东西!如果输入框在屏幕上-热键在此期间无效;仅当输入框处于隐藏/关闭状态时,它们才应工作

有没有办法做到这一点

谢谢。

你没有吗?查看
IfWinActive
——该页面包括
IfWinNotActive
(如果您仔细查看),这正是您所需要的

此外,你可以如何使用它与你的热键


(我应该为您获取文档链接而得到一分)

由于这是一个有自己客户端的游戏,ifwin将不会帮助您使用ingame框或窗口

对于类似的东西,您最好使用像素或图像搜索的形式


希望能有所帮助

谢谢您的回复,但实际上我无法从您提供的链接中获得任何信息。如果输入框处于打开状态,我仍然不知道如何防止发送文本消息-我认为IfWinActive还有另一个用途。不,您使用文档中的查看
IfWinActive
(我链接了它),您将看到有
IfWinNotActive
,这正是您所需要的。另一个链接显示要与括号一起使用的格式。