Join us in Outworldz at www.outworldz.com:9000 or follow us:

Search dozens of selected web sites for OpenSim and LSL script

New! Script Meta-Search will search thousands of scripts here and at other sites for LSL or Opensim scripts.
Loading

Want to add a script or a project? Upload it and a half million people will see it and your name here this year.

Home   Show All
Category: Contributor: Creator
Clock Rotation_Clock  

Rotation_Clock

made this to be a floor clock, so the script is set up to rotate on the z axis, change this for an upright clock.

Place these scripts in a root prim, which is at the center of the clock face.


Hour Hand:

Category: Clock
By : Fred Kinsei
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for Rotation_Clock
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Rotation_Clock_1.lsl
Get file # 2. Rotation_Clock_2.lsl
1 //Credit to the creator:
2 //Made by SL resident Fred Kinsei
3 integer hours;
4 integer min;
5 integer sec;
6 GetTimeNow()
7 {
8 integer timeNow;
9 timeNow = llRound(llGetWallclock());
10 hours = timeNow / 3600;
11 min = (timeNow % 3600) / 60;
12 sec = timeNow % 60;
13 if(hours > 12)
14 {
15 hours = hours - 12;
16 }
17 }
18
19 default
20 {
22 {
24 }
25 timer()
26 {
27 GetTimeNow();
28 //llSay(0, (string)hours);
29 rotation CHANGE = llEuler2Rot(-( < 0, 0, (((hours) * 30)+(0.5*min)) * DEG_TO_RAD > ));
30 llSetRot(CHANGE);
31 }
32 }

Rotation_Clock

Minute Hand:

Category: Clock
By : Fred Kinsei
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

1 //Credit to the creator:
2 //Made by SL resident Fred Kinsei
3 integer hours;
4 integer min;
5 integer sec;
6 GetTimeNow()
7 {
8 integer timeNow;
9 timeNow = llRound(llGetWallclock());
10 hours = timeNow / 3600;
11 min = (timeNow % 3600) / 60;
12 sec = timeNow % 60;
13 }
14
15 default
16 {
18 {
20 }
21 timer()
22 {
23 GetTimeNow();
24 //llSay(0, (string)min);
25 rotation CHANGE = llEuler2Rot(-(<0,0,((min-15) * 6) * DEG_TO_RAD>));
26 llSetRot(CHANGE);
27 }
28 }

Back to the Best Free Tools in Second Life and OpenSim.