is there a way to run a set of code every minute without any user interaction when on a specific card?
like onMouseup but on5minuteinterval
script on timer?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
script on timer?
"Det bästa stället att hitta en hjälpande hand är i slutet av din egen arm" förutom här
-
- VIP Livecode Opensource Backer
- Posts: 858
- Joined: Wed Jun 24, 2009 1:17 pm
- Contact:
Re: script on timer?
There are lots of ways of doing this, such as, in the script of the card of your choice:
Code: Select all
local sKeepRepeating
on openCard
--set up the script variable to control whether the handler can be stopped later on
put true into sKeepRepeating
--make the first call to repeatingHandler
repeatingHandler
close openCard
on repeatingHandler
--if the script variable is true then proceed
--otherwise if it is false this handler runs through and is not called again
if sKeepRepeating then
--do some stuff
--if you wish to stop this handler being repeatedly called
--you can set sKeepRepeating to false here
--this is the 'recursion' bit - where the handler calls itself
send repeatingHandler to me in 5 seconds
end if
close repeatingHandler
"...this is not the code you are looking for..."
Re: script on timer?
Thank you so much
"Det bästa stället att hitta en hjälpande hand är i slutet av din egen arm" förutom här
-
- VIP Livecode Opensource Backer
- Posts: 858
- Joined: Wed Jun 24, 2009 1:17 pm
- Contact:
Re: script on timer?
A pleasure - and I'm sure others will chime in with other/better ways. What are you building?
"...this is not the code you are looking for..."