Sign in to follow this  
Followers 0
Papo

Exit script after 25seconds

7 posts in this topic

Hi, quick question.

I'm getting an unknown issue on one of my scripts so as a temporary fix i was wondering if there is a command that i can set at the beginning of my script that if it is up for more than 25 seconds to close the script.

Thanks for any responses.

Papo

Share this post


Link to post
Share on other sites



Thanks a lot I will try it ASAP

Share this post


Link to post
Share on other sites

Hi, thanks for the help the code works but since I inputed it the script wont follow the rest of the code. Should it be at the end? should it be mixed in seperate places. I'm a little new at the Autoit thing.

Here's my code:

Opt("WinTitleMatchMode", 2)
Run ("C:\Program Files\Internet Explorer\iexplore.exe", "", @SW_MAXIMIZE)
AdlibEnable("exitnow",25000)
While 1
    Sleep(10)
WEnd
Func ExitNow()
    Exit
EndFunc
WinWait ("D-LINK")
WinActivate("D-LINK", "")
WinSetOnTop("D-LINK", "", 1)
MouseMove (820,332,0)
MouseClick ("left")
Send ("admin")
Send ("{Tab}")
Send ("comp")
Send ("{enter}")
WinWaitActive("SETUP")
MouseMove (1026,246,0)
MouseClick ("left")
WinWaitActive("STATUS")
MouseMove(979,574,0)
MouseClick("left")
Sleep(2000)
MouseMove(821,389,0)
MouseClick("left")
WinWaitActive("STATUS")
Sleep (5000)
MouseMove (903,570,0)
MouseClick("left")
Sleep(5000)
MouseMove(841,390,0)
MouseClick("left") 
MouseMove(1662,6,0)
MouseClick("left")

The issue i get is sometimes it won't login(but it could be a cpu load thing or the program thats executing my script) but with your code implemented it wont log in at all.

Thanks again for your help

Papo

Share this post


Link to post
Share on other sites

Move the following lines

;-------------------

While 1

Sleep(10)

WEnd

Func ExitNow()

Exit

EndFunc

;--------------------

to the end of your script ...

Share this post


Link to post
Share on other sites

Thanks a bunch! I will try that

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