Jump to content

Exit script after 25seconds


Papo
 Share

Recommended Posts

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

Link to comment
Share on other sites

  • Developers

AdlibEnable("exitnow",25000)

While 1
    Sleep(10)
WEnd

Func ExitNow()
    Exit
EndFunc

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

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

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...