Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Discussion: Simple clock

Wednesday Grimm
Ex Libris
Join date: 9 Jan 2003
Posts: 934
06-10-2003 19:45
CODE

// Simple Clock
// Wednesday Grimm
// June 10, 2003
//
// A very simple clock.

integer SECONDS_PER_HOUR = 3600;
integer SECONDS_PER_MINUTE = 60;

integer second()
{
return (integer)llGetWallclock() % SECONDS_PER_MINUTE;
}
integer minute()
{
return ((integer)llGetWallclock()%SECONDS_PER_HOUR) / SECONDS_PER_MINUTE;
}
integer hour()
{
return (integer)llGetWallclock() / (integer)SECONDS_PER_HOUR;
}
default
{
state_entry()
{
// update the clock every second, it would be silly to
// do it more frequently
llSetTimerEvent(1.0);
}

timer()
{
vector colour = <1.0, 1.0, 0.0>; // a nice yellow

// Build the time string
llSetText(
(string)hour() + ":" +
(string)minute() + ":" +
(string)second(),
colour,
1.0);
}
}
_____________________
Sarcasm meter:
0 |-----------------------*-| 10
Rating: Awww Jeeze!
Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
Original Thread
04-25-2005 08:57
/15/c5/3037/1.html
_____________________
i've got nothing. ;)
Dragon Steele
Artist/conservationist
Join date: 3 Jan 2005
Posts: 183
06-16-2005 19:57
Is this a floating text clock or do i need to build child prims?
_____________________
Boycot the spam farms and the ads on them. Ban the spamers from your land. Look for the clocktower network for a blacklist to put on you land that is grid wide.
Jeffrey Gomez
Cubed™
Join date: 11 Jun 2004
Posts: 3,522
06-16-2005 20:12
Looks like a simple text clock to me.
_____________________
---