Sign in to follow this  
Followers 0
Preforx

Automatic Script Stop?

4 posts in this topic

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

Share this post


Link to post
Share on other sites



Sorry dont know how to Edit in this Board. Find no function for this.

Question for This: Or is it Possible to stop it at an specific time, like at 12am ?

Share this post


Link to post
Share on other sites

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


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

$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

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