Jump to content

Recommended Posts

Posted

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?

  • Moderators
Posted

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!

Posted

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

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
×
×
  • Create New...