Using timer and counter functionality

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
eddu
Posts: 8
Joined: Fri May 12, 2006 7:27 pm

Using timer and counter functionality

Post by eddu » Fri May 26, 2006 7:07 pm

LS;
I looked around for some info on how to apply timer and counter functionality. The goal is simple, building a alarm clock for cooking.
Can anyone get me going?

Regards;
Ed

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Fri May 26, 2006 8:56 pm

Here is one possibility:

on mouseUp
if the hilite of me is false then
set the hilite of me to true
send "ringTheBell" to me in 5 seconds
else
set the hilite of me to false
end if
end mouseUp

on ringTheBell
if the hilite of me is true then
beep
send "ringTheBell" to me in 1 seconds
end if
end ringTheBell


Put this script into a button and set the autoHilite of that button to false.

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

eddu
Posts: 8
Joined: Fri May 12, 2006 7:27 pm

Post by eddu » Sun May 28, 2006 6:24 pm

Maybe my question was not quite clear. What I try to find out is typical time-functionality. I can use some help on this item.

Regards;
Ed
[/i]

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Sun May 28, 2006 6:41 pm

Ed,

What is "typical time-functionality"? The script I wrote you is a perfect alarm clock, although you might want to play a different sound. What else are you looking for?

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

eddu
Posts: 8
Joined: Fri May 12, 2006 7:27 pm

Post by eddu » Mon May 29, 2006 4:21 pm

Mark;

I gave your idea a closer look. I'm shure it works!

Ed

Post Reply

Return to “Talking LiveCode”