Jump to content

Recommended Posts

Posted

hi

i try to make a script that will run something between some hours ( between 22:00 and 8:00 )

i try something like this:

CODE
$ora = @HOUR

if 22< $ora <08 Then

run ("something")

else

MsgBox (1, "ora", "not now")

EndIf

but don`t work

some ideeas?

Posted

Hi,

Why not run the script with scheduled task?

Otherwise you can create a loop, but you will have 100% cpu usage! So this is not such great idea...

dim $iTimehascome

$iTimehascome = 0

do
    if @HOUR >= 4 Then
        ; your code goes here
        $iTimehascome = 1
    EndIf
Until $iTimehascome = 1
Posted (edited)

Otherwise you can create a loop, but you will have 100% cpu usage! So this is not such great idea...

Sure, if you don't have a Sleep() in a loop the script's CPU-usage will be close to 100%...

Edit : tags..

Edited by Helge
Posted

thanx

now i thing i have another problem

if i change the computer hour .. .. its no good

so i must take the exact hour from another machine , or via internet.

can i make this?

Posted

Sure, if you don't have a Sleep() in a loop the script's CPU-usage will be close to 100%...

Edit : tags..

You are right, this solves the problem :whistle:

Posted

Well you can get the time from the internet

i know. but how?

i must save a webpage locally, fileopen that file and search the string with hour, grab the time into a variable and so on? o or is a more simple method?

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