Allocated Run Time

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
Dobbythenerd1
Posts: 10
Joined: 14 Apr 2024, 02:55

Allocated Run Time

23 Apr 2024, 04:55

Hello everyone,

I'm wondering how i would go about adding a runtime to my scripts? For example i want the script to run for only 60 minutes. My script contains multiple loops and functions. I only want this script to run for 60 minutes. After this i want the script to end.... Not sure where to start with this.

Would the whole script need to be contained in a While function?
User avatar
boiler
Posts: 17329
Joined: 21 Dec 2014, 02:44

Re: Allocated Run Time

23 Apr 2024, 05:50

Put this at the top of your script in the auto-execute section:

Code: Select all

SetTimer, EndScript, % -1000 * 60 * 60

...and this somewhere below the auto-execute section:

Code: Select all

EndScript:
ExitApp

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: No registered users and 183 guests