Jump to content

Recommended Posts

Posted

I use AutoIt to run som scripts in explorer... the title of the window is "ikarim" which i use in the begining with WinActivate("Ikariam")

But i was wondering what to do if i want the script to pause if i manually unfocus ikariam...

Thnx in advance >_<

Posted (edited)

While 1
    If WinActive("ikarim") = 0 Then ;0 means the window is not active, check the helpfile for the return values of each function.
        Do
            Sleep(50)
        Until WinActive("ikarim") = 1
    EndIf
WEnd

This will pause your script if the window "ikarim" is not active.

Less Sleep() value means more CPU usage as far as I know.

Edited by Info

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...