Sign in to follow this  
Followers 0
Azu

Permanent if statement?

4 posts in this topic

Sorry if this has been asked before but I couldn't find anything on it..

I'm wandering how I can make an if statement that will stay in effect the while time the script is running, and not hold up the script..

Like for example, if a certain window becomes active, minimize the window

And it would do it every time that if statement is fulfilled.. and in the mean time the rest of the script will run un-effected..

Can someone please explain to me how to do this? :S

Share this post


Link to post
Share on other sites



Sorry if this has been asked before but I couldn't find anything on it..

I'm wandering how I can make an if statement that will stay in effect the while time the script is running, and not hold up the script..

Like for example, if a certain window becomes active, minimize the window

And it would do it every time that if statement is fulfilled.. and in the mean time the rest of the script will run un-effected..

Can someone please explain to me how to do this? :S

Look up adlibenable in the help file. It will call a function every X milliseconds. You can have that function do whatever you want.


AutoIt Scripts:Aimbot: Proof of Concept - PixelSearching Aimbot with several search/autoshoot/lock-on techniques.Sliding Toolbar - Add a nice Sliding Toolbar to your next script. Click the link to see an animation of it in action!FontInfo UDF - Get list of system fonts, or search to see if a particular font is installed.Get Extended Property UDF - Retrieve a files extended properties (e.g., video/image dimensions, file version, bitrate of song/video, etc)

Share this post


Link to post
Share on other sites

Thanks for the fast reply.. exactly what I was looking for ^^

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Like for example, if a certain window becomes active, minimize the window

What about

$done = False
While Not $done
     WinWaitActive( "foo" )
     WinSetState( "foo", "", @WIN_MINIMIZE )
     WinActivate( "someotherwindow" )
; do whatever else
; set $done if we want to stop
WEnd

If you want to do other things in the meantime, launch it in a seperate thread, like http://www.autoitscript.com/forum/index.php?showtopic=23545.

Edited by cdr

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0