Say Region Frames Per Second

From Second Life Wiki
Revision as of 20:04, 14 March 2007 by Heymariou Mystakidou (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

float fps; string frames; string region; float home=FALSE; default {

   state_entry()
   {
       llListen(0,"",llGetOwner(),"region fps");
   }
   listen(integer c,string n,key i,string m)
   {
       if(m=="region fps")
       {
           fps=llGetRegionFPS();
           frames=(string)(fps);
           region=llGetRegionName();
           llSay(0,region+" fps is:"+frames);
           if(fps > 27)
           {
               llSay(0,region+" is running smoothly");
           }
           if(fps > 22 && fps < 15 )
           {
               llSay(0,region+" is running slowly");
           }
           if(fps < 15)
           {
               llSay(0,"CAUTION:"+region+" is in danger of crashing");
           }
           llResetScript();
       }    
   }

}