Papo Posted January 30, 2008 Share Posted January 30, 2008 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 More sharing options...
Developers Jos Posted January 30, 2008 Developers Share Posted January 30, 2008 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 More sharing options...
Papo Posted January 30, 2008 Author Share Posted January 30, 2008 Thanks a lot I will try it ASAP Link to comment Share on other sites More sharing options...
Papo Posted January 30, 2008 Author Share Posted January 30, 2008 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 More sharing options...
AdmiralAlkex Posted January 30, 2008 Share Posted January 30, 2008 (edited) You never exit the While-loop, and it doesn't look like you need it either, you should remove it Edited January 30, 2008 by TzarAlkex .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
whim Posted January 30, 2008 Share Posted January 30, 2008 Move the following lines ;------------------- While 1 Sleep(10) WEnd Func ExitNow() Exit EndFunc ;-------------------- to the end of your script ... Link to comment Share on other sites More sharing options...
Papo Posted January 30, 2008 Author Share Posted January 30, 2008 Thanks a bunch! I will try that 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