Jump to content

Urgent help needed... Script needs to break every six hours.


Recommended Posts

I need the script to take a break every six hours for half an hour.... This is how I tried to do it.

Please forgive the crappy variable naming and etc.

While 1

$dif = Timerdiff($begin)
$qwe = 21600000 * $number


If $dif > $qwe Then
    sleep(1800000)
    $number = $number + 1
EndIf

<my function goes here>

sleep(50000)

Wend
Link to comment
Share on other sites

I need the script to take a break every six hours for half an hour.... This is how I tried to do it.

Please forgive the crappy variable naming and etc.

While 1

$dif = Timerdiff($begin)
$qwe = 21600000 * $number


If $dif > $qwe Then
    sleep(1800000)
    $number = $number + 1
EndIf

<my function goes here>

sleep(50000)

Wend

after 6 hours of running...

$qwe = 21600000 * $number (21600000 = 6 hours)

then the program sleeps for 1800000 or 30 minutes

* so

the only reason it sleeps at all if after $dif > 6 hours

( other than the 5 seconds )

8)

NEWHeader1.png

Link to comment
Share on other sites

I need the script to take a break every six hours for half an hour.... This is how I tried to do it.

Please forgive the crappy variable naming and etc.

While 1

$dif = Timerdiff($begin)
$qwe = 21600000 * $number
If $dif > $qwe Then
    sleep(1800000)
    $number = $number + 1
EndIf

<my function goes here>

sleep(50000)

Wend
Repeats _MyFunction() forever, taking a 30min break every 6hr:

$iTimer6 = TimerInit()
While 1
     _MyFunction() ; <my function goes here>
     If TimerDiff($Timer6) >= 1000 * 60 * 60 * 6 Then ; If 6 hours have passed...
          Sleep(1000 * 60 * 30) ; 30min delay
          $Timer6 = TimerInit() ; Restart 6 hour timer
     EndIf
Wend

:whistle:

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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...