Re: Repeating events
On 12/2/03 2:40 PM, "Bill Vlahos" <[EMAIL PROTECTED]> wrote: >> Couldn't you just check the time once a minute or so? >> >> on checkTime >> if the time = "5:00 AM" or the time = "2:30 PM" then doMyStuff >> send "checkTime" to me in 60 seconds >> end checkTime > These are all great suggestions. This one will fit the bill perfectly > and is very simple. Great. You could also do: if the time is in "5:00 AM,2:30 PM" then doMyStuff It occurred to me that if you want to be absolutely safe in catching the correct time, you might want to send every 50 seconds or so to allow a little overlap between minutes. Regards, Scott Rossi Creative Director Tactile Media, Multimedia & Design - E: [EMAIL PROTECTED] W: http://www.tactilemedia.com ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Repeating events
These are all great suggestions. This one will fit the bill perfectly and is very simple. Thanks, Bill Vlahos On Dec 1, 2003, at 10:39 PM, Scott Rossi wrote: On 12/1/03 10:03 PM, "Bill Vlahos" <[EMAIL PROTECTED]> wrote: I have a script that I want to run every day at 5:00 AM and 2:30 PM and am having the hardest time figuring out how to work simply and reliably. ... Is there a simple way to track multiple repeating events without going bonkers keeping track of multiple send in times? I think I must be trying too hard on this but I can't think of a simple way to do it. Couldn't you just check the time once a minute or so? on checkTime if the time = "5:00 AM" or the time = "2:30 PM" then doMyStuff send "checkTime" to me in 60 seconds end checkTime Regards, Scott Rossi Creative Director Tactile Media, Multimedia & Design - E: [EMAIL PROTECTED] W: http://www.tactilemedia.com ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Repeating events
Hi Bill, You have already received some good advice here, but having done quite a lot of this sort of thing, here is some extra advice: - store the script run times in 24 hour format - that makes it much easier to handle the transition to the following day. - have a routine that is called on startup or openStack that sets the next script run time and sends the message. If this makes sure to cancel any pending messages to your script, it can be run whenever you might be doubtful about the message. - after the script has run, call this routine again to set the following one, making sure that it doesn't set it for it's own minute again. - ALWAYS check for left-over messages so that you aren't getting multiple sends to the same script. I have a set of standard message sending scripts I use: cancelMessageName -- cancels all messages with the specified name cancelMessageID -- cancels all messages with the specified id setupNextCall -- cancels messages then sends a new one sendMessageAt -- sends a message at a particular time If you are interested, let me know and I can send you them off-list. Cheers, Sarah [EMAIL PROTECTED] http://www.troz.net/Rev/ On 2 Dec 2003, at 4:05 pm, Bill Vlahos wrote: I have a script that I want to run every day at 5:00 AM and 2:30 PM and am having the hardest time figuring out how to work simply and reliably. The following script will figure out how many seconds from some arbitrary time to the next 5:00 AM. Normally the script will run automatically but it will be possible that the user might run it manually at any time. convert the short time to dateItems add 1 to item 3 of it -- tomorrow put 5 into item 4 of it -- 5 AM put 0 into item 5 of it -- :00 seconds convert it to seconds put it into vNextTime convert the time to seconds -- current time put it into vNow put vNextTime - vNow into vTimeOffset -- number of seconds until the next 5:00 AM This works OK for one repeating time per day but I want more than one (at this point it is two but it would be good to make a general case for any number of times the script is to be run). Is there a simple way to track multiple repeating events without going bonkers keeping track of multiple send in times? I think I must be trying too hard on this but I can't think of a simple way to do it. Bill ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
RE: Repeating events
I suggest triggering your next event setup at the end of executing the last one (also at startup to get things going) Try this (untested): on triggerEvent local tTime,tLine,tEventTimes doEvent -- script you want to run put the seconds into tTime convert tTime to dateItems -- uEventTimes is a list of times (5:00 AM = 5,0) put the uEventTimes of the target into tEventTimes if item 4 of tTime >= item 1 of line -1 tEventTimes and \ item 5 of tTime >= item 2 of line -1 of tEventTimes then add 1 to item 3 of tTime put line -1 of tEventTimes into item 4 to 5 of tTime else repeat for each line tLine in tEventTimes if item 4 of tTime >= item 1 of tLine and \ item 5 of tTime >= item 2 of tLine then put tLine into item 4 to 5 of tTime end if end repeat end if convert tTime to seconds send triggerEvent to the target in (tTime - the long seconds) seconds end triggerEvent Tou could have this script in a library stack and have as many objects as you like triggering events all over the place ;-) Cheers Monte ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Repeating events
On Monday, December 1, 2003, at 11:03 PM, Bill Vlahos wrote: Is there a simple way to track multiple repeating events without going bonkers keeping track of multiple send in times? I think I must be trying too hard on this but I can't think of a simple way to do it. Every half minute check the time against your list of things to do that have not been checked off (or removed). The task to do in the middle of the night is to re-initialize your list. Dar Scott ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution
Re: Repeating events
On 12/1/03 10:03 PM, "Bill Vlahos" <[EMAIL PROTECTED]> wrote: > I have a script that I want to run every day at 5:00 AM and 2:30 PM and > am having the hardest time figuring out how to work simply and > reliably. > ... > Is there a simple way to track multiple repeating events without going > bonkers keeping track of multiple send in times? I think I must be > trying too hard on this but I can't think of a simple way to do it. Couldn't you just check the time once a minute or so? on checkTime if the time = "5:00 AM" or the time = "2:30 PM" then doMyStuff send "checkTime" to me in 60 seconds end checkTime Regards, Scott Rossi Creative Director Tactile Media, Multimedia & Design - E: [EMAIL PROTECTED] W: http://www.tactilemedia.com ___ use-revolution mailing list [EMAIL PROTECTED] http://lists.runrev.com/mailman/listinfo/use-revolution