Repeating events

Monte Goulding monte at sweattechnologies.com
Tue Dec 2 01:50:25 EST 2003


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



More information about the use-livecode mailing list