User:Kerik Rau/Simple Slide Show

From Second Life Wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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>