Jump to content

Setting duration to run the script


Recommended Posts

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

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...