Sign in to follow this  
Followers 0
jgus

Timed stopping of the script

6 posts in this topic

Is their a way that the script can be told to just give up(quit) if a certain amount of time goes by? I would just like to make sure the script doesn't hang up on the users PC with a splash screen and then the user will have to call us to kill the script. It would be nice if the script could know to kill itself if it is taking too long.

Share this post


Link to post
Share on other sites



Do not double post. The answer to your first question was answered in the first post. You do not need this functionality if you read the helpfile and understood it the first time. Read the other post.


Who else would I be?

Share this post


Link to post
Share on other sites

This was not the same question as my other post. I just wonder if there is a way to have the script stop if it isn't finished in a certain amount of time.

Share this post


Link to post
Share on other sites

Timeouts are in most winwait related functions and messageboxes, so they will allow the script to continue. The script may fail it's objective but it may finish. depending on the way that you code it. You can add more if..else..endif and so on, with may make your script a safer script.

Share this post


Link to post
Share on other sites

Also as a quick reply... check the help file for TimerInit() and TimerDiff().

JS


AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Share this post


Link to post
Share on other sites

Also you can use a global timer with adlib.

Set adlib to quit after a certain TimerDiff

You can reset the timer as you go along as well.

ex:

adlibenable("myadlib")
$begin = TimerInit()

MsgBox(1,"Info","you have 3 sec to continue")
$begin = TimerInit(); reset timer

while 1
tooltip(int(TimerDiff($begin)/1000),0,0)
sleep(10); stuck
wend

Func myadlib()
If TimerDiff($begin)>3000 Then 
    MsgBox(0,"Error","Time limit exceded!")
    exit
EndIf
endfunc

AutoIt3, the MACGYVER Pocket Knife for computers.

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