76b517a3700ecbc6562f7a9fce45a77f585614f4
[feisty_meow.git] / huffware / huffotronic_scripts / Minute_Hand_v0.4.txt
1 
2 // huffware script: minute hand, modified by fred huffhines.
3 // 
4 // noticed this in arcadia asylum's great hobo cuckoo clock.
5 // this script is licensed by Beezle Warburton:
6 //    "I released those 'into the wild' years ago,do what you like,
7 //     I just ask that people don't resell the scripts by themselves."
8 //
9 // fred's changes licensed by:
10 //   this script is licensed by the GPL v3 which is documented at: http://www.gnu.org/licenses/gpl.html
11 //   do not use it in objects without fully realizing you are implicitly accepting that license.
12 //
13
14 integer time;
15 integer hours;
16 integer minutes;
17
18 float anglehours;
19 float angleminutes;
20
21 default
22 {
23     state_entry() { if (llSubStringIndex(llGetObjectName(),  "huffotronic") < 0) state real_default; }
24     on_rez(integer parm) { state rerun; }
25 }
26 state rerun { state_entry() { state default; } }
27
28 state real_default
29 {
30     state_entry() {
31         // we want to calculate once a minute.
32         llSetTimerEvent(60.0);
33     }
34
35     timer() {
36         time = (integer)llGetGMTclock(); // seconds since midnight
37         minutes = (time % 3600) / 60;        
38         angleminutes = -(TWO_PI * (float)minutes / 60);
39         llRotateTexture(angleminutes, ALL_SIDES);
40     }
41 }