User:Kerik Rau/Simple Slide Show

From Second Life Wiki
< User:Kerik Rau
Revision as of 14:29, 16 January 2009 by Kerik Rau (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Dumb slide show: simply rez a cube, throw in the script and textures and instant slide show. Ya, boring isn't it?

<lsl> integer Face = 2; float Delay = 25.0;

list Textures; integer TextureNum;

BuildDB() {

   Textures = [];
   integer NumTextures = llGetInventoryNumber(INVENTORY_TEXTURE);
   
   while(NumTextures--)
       Textures += llGetInventoryName(INVENTORY_TEXTURE, NumTextures);
       
   llOwnerSay("Loaded Textures: " + llDumpList2String(Textures, ", "));

}

default {

   state_entry()
   {
       BuildDB();
       llSetTimerEvent(Delay);
   }
   
   changed(integer change)
   {
       if(change & CHANGED_INVENTORY)
           BuildDB();   
   }
   
   timer()
   {
       llSetTexture(llList2String(Textures, TextureNum), Face);
       
       if(++TextureNum >= llGetListLength(Textures))
           TextureNum = 0;
   }

} </lsl>