Casablanca0s Posted January 15, 2015 Share Posted January 15, 2015 Hi guys! Help me pls to join these codes into one While 1 If Not ProcessExists("FirstProgram.exe") Then Run("FirstProgram.exe") EndIf WEnd While 1 If @MIN = 28 Then RunWait ("File28.exe") EndIf WEnd While 1 If ProcessExists("EMAIL.exe") Then Sleep(20000) Else Run("TIME.exe") EndIf WEnd As you can see I need for with 1 script to monitoring 3 programs and run at different times how can i realize that? Thank you Link to comment Share on other sites More sharing options...
UEZ Posted January 15, 2015 Share Posted January 15, 2015 (edited) Try this: $iSleep = TimerInit() While Sleep(100) If Not ProcessExists("FirstProgram.exe") Then Run("FirstProgram.exe") EndIf If @MIN = 28 Then RunWait ("File28.exe") EndIf If Not ProcessExists("EMAIL.exe") And TimerDiff($t) > 20000 Then Run("TIME.exe") $iSleep = TimerInit() EndIf WEndBr,UEZ Edited January 15, 2015 by UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
Guest Posted January 15, 2015 Share Posted January 15, 2015 (edited) I tried to do a more elegant solution (elegant if you look at it from the outside. Inside is a different story) '?do=embed' frameborder='0' data-embedContent>> It works but note that it has some limitations.Here's an example for your case: expandcollapse popup#include 'RegisterLoop_v2.au3' ; Press Exit to exit the script HotKeySet('{ESC}','Exit1') Func Exit1() Exit EndFunc RegisterLoop('loop1') RegisterLoop('loop2') RegisterLoop('loop3') Func loop1() If Not ProcessExists("FirstProgram.exe") Then Run("FirstProgram.exe") EndIf EndFunc Func loop2() If @MIN = 28 Then RunWait ("File28.exe") EndIf EndFunc Func Loop3() If ProcessExists("EMAIL.exe") Then WaitWhile('Loop3',20000) Else Run("TIME.exe") EndIf EndFunc ; Main loop just to keep the script running While 1 Sleep(10000) WEnd I do not recommend you use this solution because I do not use it myself Edited January 15, 2015 by Guest Link to comment Share on other sites More sharing options...
Bert Posted January 15, 2015 Share Posted January 15, 2015 I tried to do a more elegant solution (elegant if you look at it from the outside. Inside is a different story)'?do=embed' frameborder='0' data-embedContent>> It works but note that it has some limitations.Here's an example for your case:expandcollapse popup#include 'RegisterLoop_v2.au3' ; Press Exit to exit the script HotKeySet('{ESC}','Exit1') Func Exit1() Exit EndFunc RegisterLoop('loop1') RegisterLoop('loop2') RegisterLoop('loop3') Func loop1() If Not ProcessExists("FirstProgram.exe") Then Run("FirstProgram.exe") EndIf EndFunc Func loop2() If @MIN = 28 Then RunWait ("File28.exe") EndIf EndFunc Func Loop3() If ProcessExists("EMAIL.exe") Then WaitWhile('Loop3',20000) Else Run("TIME.exe") EndIf EndFunc ; Main loop just to keep the script running While 1 Sleep(10000) WEndI do not recommend you use this solution because I do not use it myselfI'm not sure about this one. Looks to me your processor time may be real high with it. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Casablanca0s Posted January 15, 2015 Author Share Posted January 15, 2015 Try this: $iSleep = TimerInit()While Sleep(100) If Not ProcessExists("FirstProgram.exe") Then Run("FirstProgram.exe") EndIf If @MIN = 28 Then RunWait ("File28.exe") EndIf If Not ProcessExists("EMAIL.exe") And TimerDiff($t) > 20000 Then Run("TIME.exe") $iSleep = TimerInit() EndIfWEnd thanks, your code working nice, but with some corrections for me $iSleep = TimerInit() While Sleep(100) If Not ProcessExists("FirstProgram.exe") Then Run("FIrstProgram.exe") EndIf If @MIN = 47 Then RunWait ("2ndProgram.exe") Sleep(20000) EndIf If Not ProcessExists("Program3.exe") And TimerDiff($iSleep) > 20000 Then Run("Program3.exe") $iSleep = TimerInit() EndIf WEnd 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