mini Posted December 10, 2009 Share Posted December 10, 2009 (edited) Like the title says "help to make a window Check and if not exist Open".Im making a little program that will monitor some windows, sow if it is close it will open it again.I've been looking around and i cant find nothing.Sow, i can make my program to run the app and do all, now i need to make it to check every 20min if the program is running, and if its not, it runs the script from the top.Can some one help me on this?i got this till now =P; Prompt the user to run the script - use a Yes/No prompt (4 - see help file)$answer = MsgBox(4, "Pre-config", "First open iBot and set the loader port on Loader .ini file. Run?"); Check the user's answer to the prompt (see the help file for MsgBox return values); If "No" was clicked (7) then exit the scriptIf $answer = 7 Then MsgBox(0, "Pre-config", "OK. Bye!") ExitEndIfrun("Loader.bat","C:\Documents and Settings\ras00l\Desktop\Silkroad\Ibot\01_JudRa") Sleep( 20000 ) send("{ESC}") send("{ESC}") send("{ESC}") send("ID") send("{tab}") send("PASS") send("{ENTER}") Edited December 10, 2009 by mini [size="4"]My first work[/size], it checks if one prograrm is running and if not it closes all necessery windows and run them again.[size="4"]My second work[/size], Script Function: It saves a Client Info and creates a INI file for all clients with all the info.[size="4"]My third work[/size], Script Function: It change some INFO on a working program, every X min configured. Link to comment Share on other sites More sharing options...
d0n Posted December 10, 2009 Share Posted December 10, 2009 look for winexist in help file Link to comment Share on other sites More sharing options...
bo8ster Posted December 11, 2009 Share Posted December 11, 2009 (edited) Also look for while and sleep so you have something structured like While 1 If Not WinExists() Run(program) Else Sleep 20 minutes End If End While Edited December 11, 2009 by bo8ster Post your code because code says more then your words can. SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y. Use Opt("MustDeclareVars", 1)[topic="84960"]Brett F's Learning To Script with AutoIt V3[/topic][topic="21048"]Valuater's AutoIt 1-2-3, Class... is now in Session[/topic]Contribution: [topic="87994"]Get SVN Rev Number[/topic], [topic="93527"]Control Handle under mouse[/topic], [topic="91966"]A Presentation using AutoIt[/topic], [topic="112756"]Log ConsoleWrite output in Scite[/topic] Link to comment Share on other sites More sharing options...
mini Posted December 11, 2009 Author Share Posted December 11, 2009 Also look for while and sleep so you have something structured like While 1 If Not WinExists() Run(program) Else Sleep 20 minutes End If End While Thx allot for your help, its working now perfectly ^^ you give me a big help. [size="4"]My first work[/size], it checks if one prograrm is running and if not it closes all necessery windows and run them again.[size="4"]My second work[/size], Script Function: It saves a Client Info and creates a INI file for all clients with all the info.[size="4"]My third work[/size], Script Function: It change some INFO on a working program, every X min configured. 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