Jump to content

Recommended Posts

Posted

I have been trying to use Valuater's time machine 2 script to have a program run early in the morning when no one is on the computer. The problem is that it doesn't run.

; Time Machine #2
$start = "1:30"

While 1

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

    If $start = $time Then
        Run("notepad.exe")
        ExitLoop
    EndIf

    Sleep(2000)

WEnd
Exit

I think the problem lays not within the code but within the settings on my computer. I have tried going to Display Properties and disabling the screensaver thinking that it could have caused the problem but no luck. I set system standby to never and turned off hibernation but that didn't help either.

Any help would be appreciated.

Thanks!

Posted

Try putting the$time statement out side the while.. dunno but i think that might screw it up

Then the $time wouldn't refresh and would stay at whatever time you started the script.

Posted

Is an error produced? Does the script stop running at that point in time? Have you tried a full path to notepad?

No error, script has been running for 24 hours or so now and nothing.

I have run it before no problem making the $start = @HOUR & ":" & @MIN + 1 but its just when I leave it running overnight that it doesn't work.

Posted

I have been trying to use Valuater's time machine 2 script to have a program run early in the morning when no one is on the computer. The problem is that it doesn't run.

; Time Machine #2
$start = "1:30"

While 1

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

    If $start = $time Then
        Run("notepad.exe")
        ExitLoop
    EndIf

    Sleep(2000)

WEnd
Exit

I think the problem lays not within the code but within the settings on my computer. I have tried going to Display Properties and disabling the screensaver thinking that it could have caused the problem but no luck. I set system standby to never and turned off hibernation but that didn't help either.

Any help would be appreciated.

Thanks!

@Hour returns in the range 00 to 23.

$start = "1:30" should be written as $start = "01:30" for the comparison to be true.

Posted

@Hour returns in the range 00 to 23.

$start = "1:30" should be written as $start = "01:30" for the comparison to be true.

Bingo!

Thanks for everyones help!

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
  • Recently Browsing   0 members

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