Sign in to follow this  
Followers 0
mini

New on Autoit Need help to make a window Check and if not exist Open

4 posts in this topic

#1 ·  Posted (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 script

If $answer = 7 Then

MsgBox(0, "Pre-config", "OK. Bye!")

Exit

EndIf

run("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 by mini

Share this post


Link to post
Share on other sites



look for winexist in help file

Share this post


Link to post
Share on other sites

#3 ·  Posted (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 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]

Share this post


Link to post
Share on other sites

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.

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  
Followers 0