Sign in to follow this  
Followers 0
julianser

Setting duration to run the script

2 posts in this topic

Hi Guys,

I am new at scripting and after searching around the forum I can't find what I needed.

I am trying to make a script which keys the {space} in a random delay of 1-4 secs for 15 mins, then stops for 45 mins then continues again in an endless loop.

But I am stuck in setting the duration for the bot to run for 15 mins and then sleep for 45 mins.

Appreciate it if anyone could help.

What I have is this:

Global $counter=0;globally declare $counter to the program, not just as a variable contained in a Function

While 1

HotKeySet("{INSERT}","Start")

HotKeySet("{END}","END")

WEnd

Func Start()

$counter=1

While $counter=1

$randum = Random(1000, 4000, 1)

Sleep($randum)

Send("{space}")

WEnd

EndFunc

Func End()

$counter=0

EndFunc

Share this post


Link to post
Share on other sites



Guest
This topic is now closed to further replies.
Sign in to follow this  
Followers 0