0
votes

Well, I have this autohotkey script I wrote and it looks like this:

^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}

This is meant for SAMP and it works pretty good. t is the key that triggers the input box to open in the game.

What I need to do is this: If I open the box manually in game (I press t) and then I randomly press the hotkeys, I don't want them to send anything! IF the input box is on the screen - hotkeys should be void during that time; They only should work when the input box is hidden/closed.

Is there any way to achieve this?

Thank you.

2

2 Answers

1
votes

Have you not looked at the docs? Look at IfWinActive - that page includes IfWinNotActive (if you look closely enough), which is what you need.

Also, there is an example here of how you can use it with your hotkeys.

(I should get a point for fetching you the link to the docs)

1
votes

As this is for a game with its own client, ifwin will not help with ingame boxes or windows.

for something like that your best bet maybe to use a form of pixel or image search

http://www.autohotkey.com/docs/commands/ImageSearch.htm

Hope it helps