andsim

Untitled

Jul 3rd, 2011
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. integer H;
  2. integer M;
  3. string AP;
  4. integer T;
  5. integer S;
  6. list ROTATION = [<0.00000, 0.00000, 0.00000, 1.00000>, <0.00000, 0.00000, -0.05234, 0.99863>, <0.00000, 0.00000, -0.10453, 0.99452>, <0.00000, 0.00000, -0.15643, 0.98769>, <0.00000, 0.00000, -0.20791, 0.97815>, <0.00000, 0.00000, -0.25882, 0.96593>, <0.00000, 0.00000, -0.30902, 0.95106>,  <0.00000, 0.00000, -0.35837, 0.93358>, <0.00000, 0.00000, -0.40674, 0.91355>, <0.00000, 0.00000, -0.45399, 0.89101>, <0.00000, 0.00000, -0.50000, 0.86603>, <0.00000, 0.00000, -0.54464, 0.83867>, <0.00000, 0.00000, -0.58779, 0.80902>, <0.00000, 0.00000, -0.62932, 0.77715>, <0.00000, 0.00000, -0.66913, 0.74314>, <0.00000, 0.00000, -0.70711, 0.70711>, <0.00000, 0.00000, -0.74314, 0.66913>, <0.00000, 0.00000, -0.77715, 0.62932>, <0.00000, 0.00000, -0.80902, 0.58779>, <0.00000, 0.00000, -0.83867, 0.54464>, <0.00000, 0.00000, -0.86603, 0.50000>, <0.00000, 0.00000, -0.89101, 0.45399>, <0.00000, 0.00000, -0.91355, 0.40674>, <0.00000, 0.00000, -0.93358, 0.35837>, <0.00000, 0.00000, -0.95106, 0.30902>, <0.00000, 0.00000, -0.96593, 0.25882>, <0.00000, 0.00000, -0.97815, 0.20791>, <0.00000, 0.00000, -0.98769, 0.15643>, <0.00000, 0.00000, -0.99452, 0.10453>, <0.00000, 0.00000, -0.99863, 0.05234>, <0.00000, 0.00000, -1.00000, 0.00000>, <0.00000, 0.00000, 0.99863, 0.05234>, <0.00000, 0.00000, 0.99452, 0.10453>, <0.00000, 0.00000, 0.98769, 0.15643>, <0.00000, 0.00000, 0.97815, 0.20791>, <0.00000, 0.00000, 0.96593, 0.25882>, <0.00000, 0.00000, 0.95106, 0.30902>, <0.00000, 0.00000, 0.93358, 0.35837>, <0.00000, 0.00000, 0.91355, 0.40674>, <0.00000, 0.00000, 0.89101, 0.45399>,  <0.00000, 0.00000, 0.86603, 0.50000>, <0.00000, 0.00000, 0.83867, 0.54464>, <0.00000, 0.00000, 0.80902, 0.58779>, <0.00000, 0.00000, 0.77715, 0.62932>, <0.00000, 0.00000, 0.74314, 0.66913>, <0.00000, 0.00000, 0.70711, 0.70711>, <0.00000, 0.00000, 0.66913, 0.74314>, <0.00000, 0.00000, 0.62932, 0.77715>, <0.00000, 0.00000, 0.58779, 0.80902>, <0.00000, 0.00000, 0.54464, 0.83867>, <0.00000, 0.00000, 0.50000, 0.86603>, <0.00000, 0.00000, 0.45399, 0.89101>, <0.00000, 0.00000, 0.40674, 0.91355>, <0.00000, 0.00000, 0.35837, 0.93358>, <0.00000, 0.00000, 0.30902, 0.95106>, <0.00000, 0.00000, 0.25882, 0.96593>, <0.00000, 0.00000, 0.20791, 0.97815>, <0.00000, 0.00000, 0.15643, 0.98769>, <0.00000, 0.00000, 0.10453, 0.99452>, <0.00000, 0.00000, 0.05234, 0.99863>];
  7.  
  8. default
  9. {
  10.    on_rez(integer start_param)
  11. {
  12.     // Restarts the script every time the object is rezzed
  13.     llResetScript();
  14. }
  15.       state_entry()
  16.     {
  17.      
  18.             llSetTimerEvent(1);
  19.     }
  20.     timer()
  21.     {
  22.         integer T = (integer)llGetWallclock();
  23.         if (T > 43200)
  24.         {
  25.             T = T - 43200;
  26.             AP = "PM";
  27.             H = T / 3600;
  28.             integer Y = H * 3600;
  29.             M = (T - Y) / 60;
  30.             integer X = M * 60;
  31.             S = (T - Y - X);
  32.             llSetLocalRot(llList2Rot(ROTATION, S));      
  33.         }
  34.         else
  35.         {
  36.             AP = "AM";
  37.             H = T / 3600;
  38.             integer Y = H * 3600;
  39.             M = (T - Y) / 60;
  40.             integer X = M * 60;
  41.             S = (T - Y - X);
  42.             llSetLocalRot(llList2Rot(ROTATION, S));    
  43.         }
  44.     }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment