ZenMondo's Prim Use Meter

From ZenMondo Wormser, 9 Months ago, written in Linden Scripting, viewed 202 times.
URL http://flynnos.org/flynnbin/view/804bde1f Embed
Download Paste or View Raw
  1. //UUID of the Avatar You want the Prim Count of
  2. key avatar_key = "e48c9e28-20bf-4003-8c0c-b01fb78e2734";
  3.  
  4. //Number of Prims allowed
  5. integer prim_limit = 20;
  6.  
  7. key name_query;
  8.  
  9. string user_name;
  10.  
  11. {
  12.     state_entry()
  13.     {
  14.         name_query = llRequestAgentData(avatar_key, DATA_NAME);
  15.         llSetText("Setting Up, Ready in 15 seconds.", <0,1,1>, 1.0);
  16.         llSetTimerEvent(13);
  17.     }
  18.  
  19.     dataserver(key queryid, string data)
  20.     {
  21.        
  22.         if(queryid == name_query)
  23.         {
  24.             user_name = data;
  25.             //llSay(0, data + " " + user_name);
  26.         }
  27.     }
  28.    
  29.     timer()
  30.     {
  31.         llSetTimerEvent(0);
  32.         list prim_owners = llGetParcelPrimOwners(llGetPos());
  33.        
  34.         integer owner_pos = llListFindList(prim_owners, [avatar_key]);
  35.  
  36.         if(owner_pos != -1)
  37.         {
  38.             integer prim_count = llList2Integer(prim_owners, ++owner_pos);
  39.  
  40.             if(prim_count > prim_limit)
  41.             {
  42.                 integer over = prim_count - prim_limit;
  43.                
  44.                 llSetText(user_name +" is using\n" + (string) prim_count + " out of " + (string) prim_limit + " prims.\nReduce prim usage by " + (string) over + " prims.", <1,0,0>, 1.0);
  45.             }
  46.            
  47.             else
  48.             {
  49.                 integer under = prim_limit - prim_count;
  50.                
  51.                 llSetText(user_name +" is using\n" + (string) prim_count + " out of " + (string) prim_limit + " prims.\nYou may rez up to " + (string) under + " additional prims.", <0,1,0>, 1.0);
  52.             }
  53.         }
  54.        
  55.         else
  56.         {
  57.             llSetText(user_name + " is not using any prims.\n You may rez " + (string) prim_limit + " prims.", <0,1,0>, 1.0);
  58.         }
  59.  
  60.         llSetTimerEvent(300);
  61.     }
  62.    
  63.          
  64. }
  65.  

Reply to "ZenMondo's Prim Use Meter"

Here you can reply to the paste above

captcha