Don't click here unless you want to be banned.

LSL Wiki : LibrarySelfUpgradingScriptAlt

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are crawl338.us.archive.org

Self Upgrading Script Alt


This is an alternative to the script created by MarkovBrodsky. Instead of having to physically update every child-prim, this will let you update the child-prims from a single source. You need to move a script to each child prim to begin with, but after that updating the child scripts is just a matter of calling a function.

NOTE: The SCRIPT_TO_UPDATE variable must name a script that exists in the inventory of the root prim.

1. Move the following script to each child-prim to begin with, or include the llSetRemoteScriptAccessPin(SCRIPT_PIN) call in the script to be updated and copy that script to each child-prim initially.

// Simple pin configuration for allowing other scripts 
    // to update the internal script 
    
   // Use an arbitrary PIN
   integer SCRIPT_PIN = 7589273495872;
    
   default {
      state_entry() {
         llSetRemoteScriptAccessPin(SCRIPT_PIN); 
      }
   }

2. Move the following script to the root prim. This script simply goes through each prim and updates the script.

// Simple update script to update the given script name 
   // to each of the child-prims in a linked set 
    
   integer SCRIPT_PIN = 7589273495872; 
   string SCRIPT_TO_UPDATE = "updated_script";
    
   UpdatePrims() {
      integer num_prims = llGetNumberOfPrims(); 
      integer i; 
      for (i = 2; i <= num_prims; i++) {
         key prim_key = llGetLinkKey (i); 
         llOwnerSay("Updating prim #" + (string)(i)); 
         llRemoteLoadScriptPin (prim_key, SCRIPT_TO_UPDATE, SCRIPT_PIN, TRUE, 0); 
      }
      llOwnerSay("Updated " + (string)(num_prims - 1) + " prims"); 
   }

   default {

      state_entry() { 
         llListen (9, "", llGetOwner(), "update"); 
      }

      listen(integer channel, string name, key id, string message)
      { 
         UpdatePrims(); 
      }

   }

3. Now, calling "/9 update" will update each prim in the link set. It's not going to be super-fast, because the llRemoteLoadScriptPin delays the script on each call, but it's a lot more convenient that having to drag updated scripts to each prim. You can delete the root prim script when you don't need it anymore.



Jasa SEO Jasa SEO Murah Sepatu Online Toko Sepatu Online Sepatu Sepatu Murah Sepatu Safety Sepatu Futsal Cheapes Hostgator Coupon Link Booking Televisori offerte Notebook Offerte Berita Terkini Internet Marketer Muda Internet Marketer Indonesia Portatile Apple RDAnet Lorks Karikatur Bisnis Modal Kecil Bisnis UKM Berita Terbaru Iklan Baris Jasa SEO Jasa SEO Murah SEO Indonesia Konsultan SEO SEO Belajar SEO Kursus SEO Kursus SEO Murah Jam Tangan Casio Jam Tangan Casio Jam Tangan Murah Jam Tangan Grosir Baju Terbaru Grosir Baju Baju Terbaru Grosir Baju Murah Bisnis Online Belajar SEO Kerupuk Kerupuk kulit Social Bookmark Dofollow Social Bookmark Kumpulan Puisi Kirim Puisi bola hantu Penumbuh Rambut Penumbuh Rambut timbangan WBC Wonogiri Jasa SEO Murah Jasa SEO Jam Tangan Murah
There is one comment on this page. [Display comments/form]