PsychicHigh Posted June 27, 2006 Share Posted June 27, 2006 In this script for a bottler for this game I am unable to put in a hotkey for pause as the game captures all hotkeys and will cause the script to not pause. Instead, I want the script to pause the moment the game client is not the active program. I don't know how to go about doing this. I can litter every second line with If Not WinActive("game client","") Then WinWaitActive("game client","") but there is a possibility the script will slow down considerably since it has to check constantly if the window is in focus. I tried wrapping the working part of the script in While WinActive("game client","") ... WEnd But that waits until it hits WEnd before it checks to see if the client is the window that is in focus. Looking for any suggestions or ideas on this. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted June 27, 2006 Moderators Share Posted June 27, 2006 You could always use AdlibEnable to poll a search to check every X milliseconds (AdlibEnable() would start where you would want to check the first time)AdlibEnable('_CheckWindowStatus') Func _CheckWindowStatus() If Not WinActive('window name') Then WinWaitActive('window name') EndFunc Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Valuater Posted June 27, 2006 Share Posted June 27, 2006 while 1 if WinActive("game client","") then ; do your stuff endif wend 8) Link to comment Share on other sites More sharing options...
PsychicHigh Posted June 30, 2006 Author Share Posted June 30, 2006 while 1 if WinActive("game client","") then ; do your stuff endif wend 8) Tried this one, but it didn't kick out of the IF statement the moment the client wasn't in focus. You could always use AdlibEnable to poll a search to check every X milliseconds (AdlibEnable() would start where you would want to check the first time)AdlibEnable('_CheckWindowStatus') Func _CheckWindowStatus() If Not WinActive('window name') Then WinWaitActive('window name') EndFunc Giving an attempt to this one tonight once the game servers are back on. Thanks for your input, both of you. Much appreciated Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now