Jump to content
Sign in to follow this  

Auto restarting an application over time

Recommended Posts

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")

Func _Terminate()

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?

Share this post

Link to post
Share on other sites

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!

Share this post

Link to post
Share on other sites

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

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...