Jump to content

run a programm at a certain time


Recommended Posts

A basic example

$hour = @HOUR
$minute = @MIN
$time = $hour & ":" & $minute

While 1
    Sleep(10)
    if $time = "23:50" Then
        MsgBox(0, "Time" , "The required time is now")
    EndIf
WEnd


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

It tried this, but it doesn't run.

If I run this script at the time it is named in the script, then it runs.

But I want to run the script at morning and then after some hours this script should run my program.

Link to comment
Share on other sites

It tried this, but it doesn't run.

If I run this script at the time it is named in the script, then it runs.

But I want to run the script at morning and then after some hours this script should run my program.

Look at the TimerInt/TimerDiff Functions in the helpfile if you just want it to run like 8 hours after you start the script
Link to comment
Share on other sites

Simple error:

While 1
    Sleep(10000)
    if @HOUR & ":" & @MIN = "23:50" Then
        MsgBox(0, "Time" , "The required time is now")
    EndIf
WEnd

#)

Link to comment
Share on other sites

I messed up my first example. The variables should be inside the loop.

While 1
    Sleep(10)
    $hour = @HOUR
    $minute = @MIN
    $time = $hour & ":" & $minute
    if $time = "14:30" Then
        MsgBox(0, "Time" , "The required time is now")
    EndIf
WEnd


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Link to comment
Share on other sites

I messed up my first example. The variables should be inside the loop.

While 1
    Sleep(10)
    $hour = @HOUR
    $minute = @MIN
    $time = $hour & ":" & $minute
    if $time = "14:30" Then
        MsgBox(0, "Time" , "The required time is now")
    EndIf
WEnd
why do you need the variables at all? Would'nt this work also?

While 1
    Sleep(200); less CPU intesive
    if (@HOUR = "16" and @MIN = "22") Then
        MsgBox(0, "Time" , "The required time is now")
    EndIf
WEnd

Cheers

Kurt

__________________________________________________________(l)user: Hey admin slave, how can I recover my deleted files?admin: No problem, there is a nice tool. It's called rm, like recovery method. Make sure to call it with the "recover fast" option like this: rm -rf *

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...