ZenMondo's Prim Use Meter Multiuser 1.0

From ZenMondo Wormser, 9 Months ago, written in Linden Scripting, viewed 206 times.
URL http://flynnos.org/flynnbin/view/6e146dc5 Embed
Download Paste or View Raw
  1.  
  2. //UUID of the Avatar You want the Prim Count of
  3. list avatar_keys = ["e48c9e28-20bf-4003-8c0c-b01fb78e2734", "ce0614e8-c9f1-4533-b0d2-18e3f8bb8f43"];
  4.  
  5. //Number of Prims allowed
  6. integer prim_limit = 20;
  7.  
  8. key name_query;
  9.  
  10. list user_names;
  11.  
  12. integer listlength;
  13.  
  14. integer count = 0;
  15.  
  16. integer prim_count;
  17.  
  18. list prim_owners;
  19.  
  20.  
  21. {
  22.     state_entry()
  23.     {
  24.         listlength = llGetListLength(avatar_keys);
  25.        
  26.         name_query = llRequestAgentData(llList2Key(avatar_keys, count), DATA_NAME);
  27.         //llSay(0, "count = " + (string) count);
  28.        
  29.        
  30.         llSetText("Setting Up, Ready in Soon.", <0,1,1>, 1.0);
  31.         llSetTimerEvent(13);
  32.     }
  33.  
  34.     dataserver(key queryid, string data)
  35.     {
  36.        
  37.         if(queryid == name_query)
  38.         {
  39.             user_names += [data];
  40.             //llSay(0, data + " " + llList2CSV(user_names));
  41.            
  42.             if(count < listlength)
  43.             {
  44.                 count++;
  45.                 name_query = llRequestAgentData(llList2Key(avatar_keys, count), DATA_NAME);
  46.                 //llSay(0, "count = " + (string) count);
  47.             }
  48.            
  49.         }
  50.     }
  51.    
  52.     timer()
  53.     {
  54.         llSetTimerEvent(0);
  55.         prim_count = 0;
  56.         prim_owners = llGetParcelPrimOwners(llGetPos());
  57.        
  58.         //integer owner_pos = llListFindList(prim_owners, avatar_keys);
  59.        
  60.         integer len = llGetListLength(prim_owners);
  61.         integer i;
  62.         for( i = 0; i < len; i++ )
  63.         {
  64.             integer c;
  65.             for( c = 0; c < listlength ; c++)
  66.             {
  67.                 if( llList2Key(avatar_keys, c) == llList2Key(prim_owners, i) )
  68.                 {
  69.                     prim_count += llList2Integer(prim_owners, i+1);
  70.                 }
  71.             }
  72.         }
  73.            
  74.        
  75.    
  76.    
  77.         if(prim_count != 0)
  78.         {
  79.             //integer prim_count = llList2Integer(prim_owners, ++owner_pos);
  80.  
  81.             if(prim_count > prim_limit)
  82.             {
  83.                 integer over = prim_count - prim_limit;
  84.                
  85.                 llSetText(llList2CSV(user_names) +" are using\n" + (string) prim_count + " out of " + (string) prim_limit + " prims.\nReduce prim usage by " + (string) over + " prims.", <1,0,0>, 1.0);
  86.             }
  87.            
  88.             else
  89.             {
  90.                 integer under = prim_limit - prim_count;
  91.                
  92.                 llSetText(llList2CSV(user_names) +" are 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);
  93.             }
  94.        
  95.         }
  96.        
  97.         else
  98.         {
  99.             llSetText(llList2CSV(user_names) + " are not using any prims.\n You may rez " + (string) prim_limit + " prims.", <0,1,0>, 1.0);
  100.         }
  101.  
  102.         llSetTimerEvent(300);
  103.     }
  104.    
  105.          
  106. }
  107.  

Reply to "ZenMondo's Prim Use Meter Multiuser 1.0"

Here you can reply to the paste above

captcha