Jump to content

Automatic Script Stop?


Recommended Posts

Hello,

i have this Script:

HotKeySet("{PAUSE}", "Start")
HotKeySet("!{PAUSE}", "Quit")

TogglePause()

Func start()
HotKeySet("{PAUSE}")
HotKeySet("{PAUSE}", "TogglePause")
ToolTip('AntiAFK started.', 0, 0)
While 1
Send("I")
Sleep(Random(120000, 240000, 320000))
WEnd
EndFunc ;==>start

Func TogglePause()
ToolTip('AntiAFK Stopped.', 0, 0)
HotKeySet("{PAUSE}")
HotKeySet("{PAUSE}", "Start")
While 1
Sleep(100)
WEnd
EndFunc ;==>TogglePause

Func Quit()
Exit
EndFunc ;==>Quit

I Want that this Script End after X Minutes, after it has been Started. Is it possible? Searched and tryed, but nothing :)

Greetz

Preforx

Link to comment
Share on other sites

  • Developers

Have a look in the helpfile for the TimerInit() & TimerDiff() functions for checking the time passed and at the @hour, @min for testing for a particular time.

Jos

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

$min = 1 ; << The number of minutes to wait

AdlibEnable ("_Exit", $min * 60 * 1000)

While 1
   Sleep (1000) ; script execution in here
WEnd

Func _Exit ()
   Exit
EndFunc ; ==> _Exit

Mat

Edit: It posted whilst I was halfway through writing!! And I never realised too... Above post was garbage and was deleted.

Edited by Mat
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...