Change font size
It is currently Mon Nov 19, 2018 10:50 am

Forum rules


{L_IMAGE}



Post a new topicPost a reply Page 1 of 1   [ 3 posts ]
Author Message
 Post subject: Slide Show
PostPosted: Thu Feb 05, 2009 2:15 am 
Furious Typer
User avatar

Joined: Sun Aug 31, 2008 4:34 pm
Posts: 107
This version advances a Texture (image) on touch or set a time interval.
drop the textures in contents and arrange names by sort rules.
{L_CODE}:
integer number;
string name;
integer choice = 0;

default
{
    state_entry()
    {
        llSetTimerEvent(10.5); //How many seconds between texture change
        number = llGetInventoryNumber(INVENTORY_TEXTURE);
    }
    timer()
    {
        if (choice < number)
        {
            name = llGetInventoryName(INVENTORY_TEXTURE, choice);
            if (name != "")
            llSetTexture(name, ALL_SIDES);
            choice = choice + 1;
        }
        else
        {
            name = llGetInventoryName(INVENTORY_TEXTURE, choice);
            if (name != "")
            llSetTexture(name, ALL_SIDES);
            choice = 0;
        }
    }
    changed(integer change)
    {
        if (change & CHANGED_INVENTORY)
        {
            llResetScript();
        }
    }
}


Top
 Profile  
 
 Post subject: Slide Show- manual
PostPosted: Thu Feb 05, 2009 2:37 am 
Furious Typer
User avatar

Joined: Sun Aug 31, 2008 4:34 pm
Posts: 107
{L_CODE}:
integer numberTextures = 0;
integer currentTexture = 0;

default
{
    state_entry()
    {
        numberTextures = llGetInventoryNumber(INVENTORY_TEXTURE);
    }

    touch_start(integer who)
    {
        llSetTexture(llGetInventoryName(INVENTORY_TEXTURE, currentTexture), ALL_SIDES);
        if (currentTexture < numberTextures - 1)
            currentTexture++;
        else
            currentTexture = 0;
    }
   
    changed(integer what)
    {
        if (what & CHANGED_INVENTORY)
            llResetScript();
    }
}


Top
 Profile  
 
 Post subject: Slide Show Auto w touch
PostPosted: Thu Feb 05, 2009 5:08 am 
Furious Typer
User avatar

Joined: Sun Aug 31, 2008 4:34 pm
Posts: 107
{L_CODE}:
integer current = -1;
integer betweentime=20;
string gName = "config";
integer gLine = 0;
key gQueryID;
integer owneronly=0;
integer group=0;

settexture(string texture)
{
    llSetTexture(texture,0);
}

integer nextTexture()
{
    integer next = current + 1;
    if(next >= llGetInventoryNumber(INVENTORY_TEXTURE))
        return 0;
    return next;
}

switchtexture()
{
    llSetTimerEvent(betweentime);
    current = nextTexture();
    settexture(llGetInventoryName(INVENTORY_TEXTURE, current));
}

integer loadcard()
{
    if(llGetInventoryType(gName)==INVENTORY_NOTECARD)
    {
        gQueryID = llGetNotecardLine(gName, gLine);
        return 1;
    }
    else
        return 0;
}

default
{
    state_entry()
    {
        if(!loadcard())
            state running;
    }
    // To be safe reset script on rez   
    on_rez(integer param)
    {
        llResetScript();
    }
        dataserver(key query_id, string data) {
        if (query_id == gQueryID) {
            if (data != EOF) {
                list variables=llParseString2List(data,["="],[]);
                string command=llList2String(variables,0);
                if(llToUpper(command)=="TIMER")
                {
                    betweentime=llList2Integer(variables,1);
                }
                else if (llToUpper(command)=="OWNER")
                {
                    owneronly=llList2Integer(variables,1);
                }
                else if (llToUpper(command)=="GROUP")
                {
                    group=llList2Integer(variables,1);
                }
                ++gLine;
                gQueryID = llGetNotecardLine(gName, gLine);
            }
            else
                state running;
        }
    }
}

state running
{
    on_rez(integer param)
    {
        llResetScript();
    }
    touch_start(integer i)
    {
        if (owneronly==0 || llDetectedKey(0)==llGetOwner())
        {
            switchtexture();
        }
        else if((group==1) && llDetectedGroup(0))
        {
            switchtexture();
        }
    }
   
    timer()
    {
        switchtexture();
    }

    changed(integer change) { // something changed
        if (change & CHANGED_INVENTORY) {
            llResetScript();         
        }
    }
}


Top
 Profile  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 3 posts ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
610nm Style by Daniel St. Jules of Gamexe.net