User:Toy Wylie/Meeroos/Cycle Script

From Second Life Wiki
< User:Toy Wylie
Revision as of 03:17, 14 June 2011 by Toy Wylie (talk | contribs) (First script version)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

<lsl>float INTERVAL=30.0; integer HOUR_OFFSET=-4;

// 2 3 4 0 1 // Mischievous ———— rise peak fall ———– // Aggressive rise peak fall ———— ———— // Shy peak fall —–—— ———– rise // Friendly fall ———– ———— rise peak // Lazy ———— ———— rise peak fall

list seasons= [

   "Friendly",
   "Shy",
   "Aggressive",
   "Mischievous",
   "Lazy"

];

update() {

   string text="";
   integer time=llGetUnixTime()+(HOUR_OFFSET*3600);
   integer day=(time/(24*60*60)) % 5;
   integer hour=(time/(60*60)) % 24;
   text+="Rise: "+llList2String(seasons,day)+"\n";
   text+="Peak: "+llList2String(seasons,(day+4) % 5)+"\n";
   text+="Fall: "+llList2String(seasons,(day+3) % 5)+"\n";
   text+="2 Wait: "+llList2String(seasons,(day+2) % 5)+"\n";
   text+="1 Wait: "+llList2String(seasons,(day+1) % 5)+"\n";
   text+="Remaining: "+(string) (24-hour)+" hours";
   llSetText(text,<1.0,1.0,1.0>,1.0);

}

default {

   state_entry()
   {
       llSetTimerEvent(INTERVAL);
       update();
   }
   timer()
   {
       update();
   }

}</lsl>