PDA

View Full Version : Trigger script on clock



fuzytoes
12-04-2001, 01:47 PM
Hi! I need to trigger a script from the clock cause I do not want to use scheduler. Is this possible? I've read thru all questions here but noone asked this one and I cant seem to find anything about it in help either. Suggestion? SampleCode? The script can be active "on hold" and then at a specific timeframe start to execute. This I will use to trigger an URL for music! (Need to wake up in the mornings)! *Kidding* Actually it would be more FUN not to use scheduler. Possible?

Thanx In Advance:

Yes I'm a newbie! :o) /Fuzy

darkness
12-04-2001, 09:46 PM
yes and no. What you could do is figure out the ammount of time in the day and programs waits accordingly.

I know this sounds odd but there isn't a watchdog that I know of beyond the scheduler to fire off scripts. What you could then do is set the script to run for 24 hours and figure out from the time you start the script to execute portions after waiting for the system clock to pass so many milliseconds. The complicated part to this is that ALL wait command are based off millisecond increments so triggers will be pretty exact but it will run awefully long.

Can't really write you any code cause I don't know what your trying to do exactly.

Hope this gives you some direction though.

Michael McLaughlin/images/forums/icons/smile.gif
Systems Manager
Minnesota State University Mankato

cprasley
02-15-2002, 12:13 AM
Use a DO LOOP, the NOW() function to get the current time of day and the SLEEP() function to wait for time to elapse. Rather than doing math and sleeping for hours, it's probably better to sleep for relatively small intervals (such as 60 seconds at a time) and check the NOW() time every time you wake up.