Jump to content
Sign in to follow this  
punisa

multiple operations, multiple processes?

Recommended Posts

punisa

hi !

I have my script which checks multiple things on my computer, it runs inside a 20 second loop. Now I need to be able to close a specific window "error occured" when it shows.

I do it like this:

While 1
    Sleep(1)
        If WinExists ("error occured") Then WinClose ("error occured")
Wend

This works fine, but how do I include this bit of code in my big script which is itself a loop? I can't wait for the main loop to execute in order to check on this bit.

I already use AdlibEnable for some other stuff, it gets checked every few seconds.

The above example must close the error window as soon as it shows.

Please help, I'm still relatively new to scripting : ))


carpe diem

Share this post


Link to post
Share on other sites
Fend

If you are allready using adlib and do not want to use it here, you could simply make that a function and call it periodically through out the code.

Func WindowStatus()

If WinExists ("error occured") Then WinClose ("error occured")

EndFunc

Then just call this function from time to time.

I have seen a script for multiple adlib like executions, you can find it by searching multitasking I believe. Downside of adlib is it stops the execution of the script while running. The multitasking post I believe avoided this to some extent.


I like cookies?

Share this post


Link to post
Share on other sites
punisa

http://www.autoitscript.com/forum/index.php?showtopic=83967

I had a few secs to check for it...have fun!

nice one ! thanks ! : )

BTW, is there any "danger" of using Adlib? I know that it stops (pauses) the execution of the main script, but can it crash it? hope not : ))

Anyway I left quite the space for mine to "breath", 5 seconds - hope that's enough


carpe diem

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  

×