Jump to content
Sign in to follow this  

i need help.

Recommended Posts

Ok, How do i put a timelimit kinda thingy, To my function?

As in, If my _sendabc() function took longer then 60 seconds, i would like it to exit the Do Loop, And call the _tooktolong() func, how can this be done?

And i can't take out the do loop in _sendabc(), my script needs it.

here is an example(this is not my actual script)

Func _sendabc()

local $int = 0



$int = 1

Until $int = 1

if not @error And $int = 1 Then

return 1


return 0



Func _tooktolong()

tooltip("_sendabc took longer then 60seconds.",0,0)

return 1


i've been trying to do it for hours, please help if you can.

Share this post

Link to post
Share on other sites

You need to use TimerInit() and TimerDiff(). Call TimerInit() before the start of your loop, and call TimerDiff() inside the loop to check the timeout has not occurred. If it has, exit the loop (either with ExitLoop or a condition in the Until statement).

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...