Reset All Scripts

From ZenMondo Wormser, 1 Year ago, written in Linden Scripting, viewed 319 times.
URL http://flynnos.org/flynnbin/view/24d8b2ee Embed
Download Paste or View Raw
  1. //////////////
  2. // Reset All Scripts by ZenMondo Wormser
  3. //
  4. // Drop in an object to reset all scripts
  5. // This script deletes itself when done
  6. ////////////
  7.  
  8.  
  9. {
  10.     state_entry()
  11.     {
  12.         integer counter = 0;
  13.         integer inventory_num = llGetInventoryNumber(INVENTORY_SCRIPT);
  14.        
  15.         list inventory_list;
  16.        
  17.         while(counter < inventory_num)
  18.         {
  19.             inventory_list = (inventory_list=[]) + inventory_list + llGetInventoryName(INVENTORY_SCRIPT, counter);
  20.             counter ++;
  21.         }
  22.        
  23.         list scriptname = [llGetScriptName()];
  24.        
  25.         integer index = llListFindList(inventory_list, scriptname);
  26.        
  27.         inventory_list = llDeleteSubList(inventory_list, index, index);
  28.        
  29.         counter = 0;
  30.        
  31.         inventory_num --;
  32.        
  33.         while(counter < inventory_num)
  34.         {
  35.             llResetOtherScript(llList2String(inventory_list, counter));
  36.             counter ++;  
  37.         }
  38.        
  39.     }
  40.  
  41.    
  42. }
  43.  

Reply to "Reset All Scripts"

Here you can reply to the paste above

captcha