Sign in to follow this  
Followers 0
GoogleDude

Have 2 While 1 Loops going at the same time

10 posts in this topic

Is it possible to have two While 1 (loops) going at the same time looking for $MSG? I am trying to have my tray menu ping a IP address every so often using Sleep() while still being able to click on other TrayMenuItems. Because of the way my script is coded I am not nor (do I think) I can use the OnEventMode.

Thanks for any help provided.

GoogleDude

Share this post


Link to post
Share on other sites



Well any tray actions will pause your script. You cannot have 2 simultaneous while loops.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Damn. Thats why I thought. The only way I just thought of (Maybe, Im about to try it) is to have one of the While Loops running in a different compiled script/processes. I just hope that I can have a $var be read from across 2 different scripts if I make them a Global.

Thanks for the help.

GoogleDude

Edited by GoogleDude

Share this post


Link to post
Share on other sites

Well maybe someone should come up with a autoit compatible threading class?

Me myself ain't that good on AutoIt.

Share this post


Link to post
Share on other sites

Well maybe someone should come up with a autoit compatible threading class?

Me myself ain't that good on AutoIt.

You can probably synchronize multiple scripts using SendMessage somehow.

Share this post


Link to post
Share on other sites

As I said, I am not that experienced in Autoit :D

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Can $vars be read from across 2 scripts if they are compiled or compiled? If so how can I call a uncompiled script? I know how to RUN() a process but not a #include script.

Il have my main traymenu just call the other script where the other script simply pings an IP and sets a $var based on weather or not the ping was good or not, then have my main tray manu do somthing if the $var is true otherwise the main tray menu will just loop while the other script also loops a ping().

Make sense?

GoogleDude

Edited by GoogleDude

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

The tray menu cannot be updated while its open even if you could share variables across scripts. If you only need the tray to be updated each time you click on the tray icon, then you can do this with one script.

Edited by weaponx

Share this post


Link to post
Share on other sites

Well since I cant share $vars across scripts I guess I will just use the windows registry to write the ping status from one script and read the reg entry from the main script to determine what should be done.

I think this should be a sudo work around that should work.

Thanks

Share this post


Link to post
Share on other sites

Multithreading will not be added in AuotIT v3. Hopefully we can pray for it in v4 :D

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