Xylo Posted October 7, 2014 Share Posted October 7, 2014 Hey there, I just started my adventure with AutoIT and well, I have a problem. Basically, I need my program to do: 1. Start an application 2. Wait 13 minutes 3. Close the application 4. Do the following all the time (infinite loop) My code for now is: HotKeySet("{ESC}", "_Terminate") Func RunBot() While 1 Local $iPID = Run("directory to my application") Sleep(780000) ProcessClose($iPID) WEnd EndFunc Func _Terminate() Exit EndFunc RunBot() MsgBox ($MB_OK, "program is running somehow", "this is proof that this works") It does nothing. Even MsgBox doesn't show up. Can someone kindly help me please? Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted October 7, 2014 Moderators Share Posted October 7, 2014 You need to add error checking to your script. Add a ConsoleWrite after your $iPID declaration, to ensure you get that far. Then perhaps another ConsoleWrite when you enter Sleep. You need to determine where the break is, before you can resolve the issue. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Xylo Posted October 7, 2014 Author Share Posted October 7, 2014 The error checking with ConsoleWrite shows me that everything is fine. It's just that the program doesn't start. Destination is all good, as I have checked that. The directory is : D:folder1folder2Application.exe Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted October 7, 2014 Moderators Share Posted October 7, 2014 So if you comment everything else out and just do $iPID = Run(<path to app>) does it work? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Xylo Posted October 7, 2014 Author Share Posted October 7, 2014 Unfortunately, no. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted October 7, 2014 Moderators Share Posted October 7, 2014 What is the program? What if you use ShellExecute rather than run? "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Xylo Posted October 7, 2014 Author Share Posted October 7, 2014 That works Thank you very much for help! 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