GoogleDude Posted January 28, 2008 Share Posted January 28, 2008 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 Link to comment Share on other sites More sharing options...
weaponx Posted January 28, 2008 Share Posted January 28, 2008 Well any tray actions will pause your script. You cannot have 2 simultaneous while loops. Link to comment Share on other sites More sharing options...
GoogleDude Posted January 28, 2008 Author Share Posted January 28, 2008 (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 January 28, 2008 by GoogleDude Link to comment Share on other sites More sharing options...
XIXI Posted January 28, 2008 Share Posted January 28, 2008 Well maybe someone should come up with a autoit compatible threading class? Me myself ain't that good on AutoIt. Link to comment Share on other sites More sharing options...
weaponx Posted January 28, 2008 Share Posted January 28, 2008 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. Link to comment Share on other sites More sharing options...
XIXI Posted January 28, 2008 Share Posted January 28, 2008 As I said, I am not that experienced in Autoit Link to comment Share on other sites More sharing options...
GoogleDude Posted January 28, 2008 Author Share Posted January 28, 2008 (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 January 28, 2008 by GoogleDude Link to comment Share on other sites More sharing options...
weaponx Posted January 28, 2008 Share Posted January 28, 2008 (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 January 28, 2008 by weaponx Link to comment Share on other sites More sharing options...
GoogleDude Posted January 28, 2008 Author Share Posted January 28, 2008 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 Link to comment Share on other sites More sharing options...
Thatsgreat2345 Posted January 28, 2008 Share Posted January 28, 2008 Multithreading will not be added in AuotIT v3. Hopefully we can pray for it in v4 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