Jump to content

help with program


Recommended Posts

I am trying to write an Autoit script that will monitor for a window from a certain program to pop up and activate a control in it and restart the program again.

my script seems to shutdown randomly, and at times it will work properly and others it will not.

Can some one look at the code below and tell me what I am doing wrong.

i=0

While $i <20000000

WinWait("program")

ControlClick("Program popup", "", 2)

sleep (15000)

Run("C:\Program Files\program.exe")

$i=$i+1

WEnd

Link to comment
Share on other sites

Will that allow the autoit script to keep running and restart the program.exe when it stops? I am trying to keep this program running 24/7

Yeap.

The code will go on and on and on...

The problem is your computer... can he manage? :)

Cheers

Old Scriptology

Visual Ping 1.8 - Mass Ping Program with export to txt delimited.

Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code.

Desktop 2 RGB - Pick a color in the desktop and get the RGB code.

ShootIT 1.0 - Screen Capture full and partial screen

[font="'Arial Black';"]Remember Remember The Fifth of November.[/font]

Link to comment
Share on other sites

Small addition/correction:

While 1
  WinWait("program popup")
  WinActivate("program popup")
  ControlClick("program popup", "", 2)
    
  ; wait for process close
  While ProcessExists("program.exe")
    Sleep(100)
  WEnd
    
  Run("C:\Program Files\program.exe")
WEnd
I changed the program using the above code, but the system tray icon keeps flashing a RED X. Is that normal?
Link to comment
Share on other sites

I changed the program using the above code, but the system tray icon keeps flashing a RED X. Is that normal?

It's just making sure the "program popup" is the active window. You can take it out. I'm just the paranoid type. :)
Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

I noticed that if I have this script running and the popup pops up it will not do anything, but if I have the popup active and I start this script it gets rid of the popup, but does not restart the program.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...