littleberry 0 Posted March 30, 2004 How would you implement this notion? Suppose you want a certain script to begin processing at 3:00 pm, but you need to be able to start the script anytiime before that, you need your first statement to be one that will pause and wake up at 3:00 pm - is there a command for that? Littleberry Share this post Link to post Share on other sites
Somerset 3,041 Posted March 30, 2004 $i = 0 While $i = 0 if $a = 15 then exitloop sleep(50000) $a = @HOUR WEnd the code to execute down here. Spoiler Share this post Link to post Share on other sites
scriptkitty 1 Posted March 30, 2004 (edited) Just use the time funtions: Hotkeyset("{pause}","bypass"); hit pause to start before $x=1 While @HOUR<>15 and $x=1 sleep(10) wend ; at 3:00pm this will start func bypass() $x=0 endfunc edit... you can also have it start anytime after it with: Hotkeyset("{pause}","bypass"); hit pause to start before $x=1 While @HOUR<15 and $x=1 sleep(10) wend ; at 3:00pm this will start func bypass() $x=0 endfunc Edited March 30, 2004 by scriptkitty AutoIt3, the MACGYVER Pocket Knife for computers. Share this post Link to post Share on other sites
littleberry 0 Posted March 30, 2004 Many thanks! Now that I see how to get the current time (using the @ sign), I wrote this short "difference" code that worked - avoids looping. $h1 = 15 ; start hour $m1 = 30 ; start minute $s1 = 00 ; start second $tots = $s1 + (60 * ($m1 + (60 * $h1))) ; total seconds after midnight to start $curs = @SEC + (60 * (@MIN + (60 * @HOUR))) ; elapsed seconds since midnight $delta = $tots - $curs ; number of seconds to wait before starting starting Sleep( $delta * 1000 ) ; sleep until 3:30 pm (I hope ...) MouseClick("left") I just checked it out and it works. What I need is a way to pass the desired hours, minutes, and seconds to the script when I run it - I'll see if I can read the help file as to how to do that. Thanks, this forum has some very helpful folks, Littleberry Share this post Link to post Share on other sites