Change font size
It is currently Tue Jul 17, 2018 11:27 pm

Forum rules


{L_IMAGE}



Post a new topicPost a reply Page 1 of 1   [ 1 post ]
Author Message
 Post subject: Changing Picture Frame
PostPosted: Sat Sep 13, 2008 3:17 am 
Site Admin
User avatar

Joined: Sat Feb 02, 2008 5:27 pm
Posts: 843
Below is the notecard instructions and then followed by the source code. This is freeware, not supported, please have fun with it! =)

======== HiroTV ========
- easy, low-lag picture display script.
Freeware by Hiro Pendragon
----------------------------------------

Table of Contents:
1. Setup
2. Commands
3. Frequently Asked Questions
-----------------

1. SETUP

Step 1: Drop the HiroTV script into any prim you'd like to display pictures on.
Step 2: Add pictures.
Step 3: say, "HiroTV:reset"

-------------------------

2. COMMANDS

NOTE: All commands are case sensitive

HiroTV:setname
--------
Changes the name your HiroTV responds to. This is useful if you have more than one up in a room.
For example -
HiroTV:setname:MyTV
changes the name to "MyTV". All commands now will begin with "MyTV" instead of "HiroTV".

GetHiroTVName
--------
If you've forgotten the name of your HiroTV, you can use this command and any HiroTV in range that you
own will tell you its name.

HiroTV:setcolor
--------
Changes the color of the floating text, using 0-255 values for Red, Green, and Blue.
Example -
HiroTV:setcolor:255,255,255
changes the floating text to white.
HiroTV:setcolor:255,0,255
changes the floating text to magenta
HiroTV:setcolor:-1
turns off the floating text. You can turn it on again by simply doing the setcolor command with what color you want.

HiroTV:settimer
--------
Changes how many seconds between change of picture
Example -
HiroTV:settimer:10
changes the time between display to 10 seconds

-----------------------

3. Frequently Asked Questions

Q: It won't let me add pictures!
A: Make sure you are: (a) adding them to the Content folder of the TV (b) Not trying to add the pictures while the picture changes.

Q: How do I make the pictures stop changing!
A: HiroTV:settimer:0

Q: I added pictures but why won't they display?
A: HiroTV:reset

Q: Can I modify HiroTV?
A: Yes, it's open source freeware. Please do not delete any comments from the code if you modify. Thanks!

Q: Can I resell HiroTV or modified HiroTV?
A: No, please keep this freeware.

Q: Does the creator offer help with this product?
A: No. Play at your own risk.

Have fun!

{L_CODE}:
key ownerkey;

string tvname = "Nebs Picture Frame v1.0";

integer numberitems = 0;
integer selected = 1;

integer storelisten = 0;

float r=1.0;
float g=1.0;
float b=1.0;

integer switchtime = 300;

updatetext()
{
    if(r==-1)
        llSetText("",<0,0,0>,100);
    else

           
    llSetTexture(llGetInventoryName(INVENTORY_TEXTURE,  (selected - 1)),ALL_SIDES);
}


Init()
{
        ownerkey = llGetOwner();
        numberitems = llGetInventoryNumber(INVENTORY_TEXTURE);
        updatetext();

        llListenRemove(storelisten);
        storelisten = llListen(0,"",ownerkey,"");
       
}

switchpic()
{
    selected++;
    if (selected > numberitems)
        selected = selected - numberitems;
    updatetext();

}


default
{
    state_entry()
    {
        Init();
        llSetTimerEvent(switchtime);
    } 

    changed(integer change)
    {
    llResetScript();   
    }
   
    on_rez(integer param)
    {
        Init();
        llResetScript();
        llSetTimerEvent(switchtime);

    }
       
    listen(integer channel, string name, key id, string msg)                   
    {
        list command = llParseString2List(msg,[":"],[]);   
        if(llList2String(command,0)==tvname)
        // ALL COMMANDS MUST START WITH THE TVNAME
        {
            string whichcommand=llList2String(command,1);
            if(whichcommand=="setname")
            {
                string newname=llList2String(command,2);
                if(newname!="")
                {
                    llSay(0,"Nebs Picture Frame '"+tvname+"' has been renamed: '"+newname+"'.");
                    tvname=newname;

                }
                else
                {
                    llSay(0,"Sorry, you must enter a name for your vendor. Please try again.");
                }
            }
           else if(whichcommand == "setcolor")
           {
               list colors = llParseString2List(llList2String(command,2),[","],[]);
               r = (float)(llList2String(colors,0));
               if(r != -1)
               {
                 r = r / 255;
                }
               g = ((float)(llList2String(colors,1))/255);
               b = ((float)(llList2String(colors,2))/255);
               updatetext();
           }
           else if(whichcommand == "settimer")
           {
               switchtime = (integer)llList2String(command,2);
               llInstantMessage(ownerkey,"Nebs Picture Frame will now switch every "+(string)switchtime+" seconds.");
               llSetTimerEvent(switchtime);
            }
            else if(whichcommand == "reset")
            {
                llResetScript();
            }
        }
        else
        if(llList2String(command,0)=="GetHiroTVName")
        {
            llSay(0,"My name is: "+tvname);
        }
    } // end listen
   
    touch( integer n)
    {
//        llSay(0,"changing");
        switchpic();
    }
   
    timer()
    {
        switchpic();   
    }

}



from : http://forums.secondlife.com/showthread ... ght=hirotv


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


Who is online

Users browsing this forum: No registered users and 1 guest


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