Freeview TV by Crystalshard Foo

Expired

Needed this script and found that is lacked instructions, thanks to Cosmo Topper over at the OpenSim Forum, I included his instructions to help get the TV going. First the script:

 

//FreeView 1.2 WebGuide (revision 3) - By CrystalShard Foo
//Multifunctional Picture viewer and Video control script with webguide support
//This script is distributed for free and must stay that way. 

//              *** DO NOT SELL THIS SCRIPT UNDER ANY CIRCUMSTANCE. ***

//Help for using this script can be obtained at: http://www.slguide.com/help

//Feel free to modify this script and post your improvement. Leave the credits intact but feel free to add your name at its bottom.
 
//Whats new:
//- Now using FULL_BRIGHT instead of PRIM_MATERIAL_LIGHT for the screen display
//- Added an ownership-change code to handle cases where FreeView gets deeded to group post Video Init.
//- Renamed WebGuide to TV-Guide to reflect what this thing does better.
//- Added a 'Fix Scale' button to Picture mode to help against user texture-scale changes.
//- Additional minor help-tips and code improvements

//Enjoy!


//Constants
integer PICTURE_ROTATION_TIMER = 30;   //In whole seconds

integer DISPLAY_ON_SIDE = ALL_SIDES; //Change this to change where the image will be displayed

key VIDEO_DEFAULT = "71b8ff26-087d-5f44-285b-d38df2e11a81";  //Test pattern - Used as default video texture when one is missing in parcel media
key BLANK = "5748decc-f629-461c-9a36-a35a221fe21f"; //Blank texture - Used when there are no textures to display in Picture mode
string NOTECARD = "bookmarks";  //Used to host URL bookmarks for video streams

integer VIDEO_BRIGHT = TRUE;    //FULL_BRIGHT status for Video
integer PICTURE_BRIGHT = TRUE;  //FULL_BRIGHT status for Picture

integer REMOTE_CHANNEL = 9238742;

integer mode = 0;           //Freeview mode.
                            //Mode 0 - Power off
                            //Mode 1 - Picture viewer
                            //Mode 2 - Video

integer listenHandle = -1;      //Dialog menu listen handler
integer listenUrl = -1;         //listen handler for channel 1 for when a URL is being added
integer listenTimer = -1;       //Timer variable for removing all listeners after 2 minutes of listener inactivity
integer listenRemote = -1;      //listen handler for the remote during initial setup
integer encryption = 0;
integer numberofnotecardlines = 0;  //Stores the current number of detected notecard lines.
integer notecardline = 0;       //Current notecard line

integer loop_image = FALSE;     //Are we looping pictures with a timer? (picture mode)
integer current_texture = 0;    //Current texture number in inventory being displayed (picture mode)
integer chan;                   //llDialog listen channel
integer notecardcheck = 0;
key video_texture;              //Currently used video display texture for parcel media stream

string moviename;
string tempmoviename;
key notecardkey = NULL_KEY;
key tempuser;                   //Temp key storge variable
string tempurl;                 //Temp string storge variable

integer isGroup = TRUE;
key groupcheck = NULL_KEY;
key last_owner;
key XML_channel;

pictures()      //Change mode to Picture Viewer
{
    //Initilize variables
    
    //Change prim to Light material while coloring face 0 black to prevent light-lag generation.
    llSetPrimitiveParams([PRIM_BUMP_SHINY, DISPLAY_ON_SIDE, PRIM_SHINY_NONE, PRIM_BUMP_NONE, PRIM_COLOR, DISPLAY_ON_SIDE, <1 ,1,1>, 1.0, PRIM_MATERIAL, PRIM_MATERIAL_PLASTIC, PRIM_FULLBRIGHT, DISPLAY_ON_SIDE, PICTURE_BRIGHT]);

    integer check = llGetInventoryNumber(INVENTORY_TEXTURE);
     
    if(check == 0)
    {
        report("No pictures found.");
        llSetTexture(BLANK,DISPLAY_ON_SIDE);
        return;
    }
    else    
        if(current_texture > check)
            //Set to first texture if available
            current_texture = 0;
            
    display_texture(current_texture);
}

video()         //Change mode to Video
{
    //Change prim to Light material while coloring face 0 black to prevent light-lag generation.
    llSetPrimitiveParams([PRIM_BUMP_SHINY, DISPLAY_ON_SIDE, PRIM_SHINY_NONE, PRIM_BUMP_NONE, PRIM_COLOR, DISPLAY_ON_SIDE, <1 ,1,1>, 1.0, PRIM_MATERIAL, PRIM_MATERIAL_PLASTIC, PRIM_FULLBRIGHT, DISPLAY_ON_SIDE, VIDEO_BRIGHT, PRIM_TEXTURE, DISPLAY_ON_SIDE, "62dc73ca-265f-7ca0-0453-e2a6aa60bb6f", llGetTextureScale(DISPLAY_ON_SIDE), llGetTextureOffset(DISPLAY_ON_SIDE), llGetTextureRot(DISPLAY_ON_SIDE)]);
    
    report("Video mode"+moviename+": Stopped");
    if(finditem(NOTECARD) != -1)
        tempuser = llGetNumberOfNotecardLines(NOTECARD);
    video_texture = llList2Key(llParcelMediaQuery([PARCEL_MEDIA_COMMAND_TEXTURE]),0);
    if(video_texture == NULL_KEY)
    {
        video_texture = VIDEO_DEFAULT;
        llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_TEXTURE,VIDEO_DEFAULT]);
        llSay(0,"No parcel media texture found. Setting texture to default: "+(string)VIDEO_DEFAULT);
        if(llGetLandOwnerAt(llGetPos()) != llGetOwner())
            llSay(0,"Error: Cannot modify parcel media settings. "+llGetObjectName()+" is not owned by parcel owner.");
    }
    
    llSetTexture(video_texture,DISPLAY_ON_SIDE);
}

off()
{
    report("Click to power on.");
    llSetPrimitiveParams([PRIM_BUMP_SHINY, DISPLAY_ON_SIDE, PRIM_SHINY_LOW, PRIM_BUMP_NONE, PRIM_COLOR, DISPLAY_ON_SIDE, <0.1,0.1,0.1>, 1.0,PRIM_MATERIAL, PRIM_MATERIAL_PLASTIC, PRIM_FULLBRIGHT, DISPLAY_ON_SIDE, FALSE, PRIM_TEXTURE, DISPLAY_ON_SIDE, BLANK, llGetTextureScale(DISPLAY_ON_SIDE), llGetTextureOffset(DISPLAY_ON_SIDE), llGetTextureRot(DISPLAY_ON_SIDE)]);
}

integer finditem(string name)   //Finds and returns an item's inventory number
{
    integer i;
    for(i=0;i 0)
        header = "("+(string)(current_texture+1)+"/"+(string)check+") "+llGetInventoryName(INVENTORY_TEXTURE,current_texture);
    else
        header = "No pictures found.";
    llDialog(id,"** Monitor Control **\n Picture Viewer mode\n- Image browser\n- "+header,["Back","Next","Menu"],chan);
    extendtimer();
}

report(string str)
{
    llSetObjectDesc(str);
}

extendtimer()       //Add another 2 minute to the Listen Removal timer (use when a Listen event is triggered)
{
    if(listenHandle == -1)
        listenHandle = llListen(chan,"","","");
    listenTimer = (integer)llGetTime() + 120;
    if(loop_image == FALSE)
        llSetTimerEvent(45);
}

config(key id)      //Configuration menu
{
    extendtimer();
    llDialog(id,"Current media URL:\n"+llList2String(llParcelMediaQuery([PARCEL_MEDIA_COMMAND_URL]),0)+"\nTip: If the picture is abit off, try 'Align ON'",["Set URL","Align ON","Align OFF","Menu","Set Remote"],chan);
}

tell_remote(string str)
{
    llShout(REMOTE_CHANNEL,llXorBase64Strings(llStringToBase64((string)encryption + str), llStringToBase64((string)encryption)));
}

menu(key id)        //Dialog menus for all 3 modes
{
    list buttons = [];
    string title = "** Monitor control **";
    
    extendtimer();

    if(mode != 0)
    {
        if(mode == 1)       //Pictures menu
        {
            title+="\n  Picture Viewer mode";
            buttons+=["Browse"];
            if(loop_image == FALSE)
                buttons+=["Loop"];
            else
                buttons+=["Unloop"];
            buttons+=["Video","Power off","Help","Fix scale"];
        }
        else                //Video menu
        {
            title+="\n Video display mode\n"+moviename+"\nTip:\nClick 'TV Guide' to view the Online bookmarks.";
            buttons+=["Pictures","Configure","Power off","Loop","Unload","Help","Play","Stop","Pause","TV Guide","Bookmarks","Set URL"];
        }
    }
    else
        buttons += ["Pictures","Video","Help"];
    
    llDialog(id,title,buttons,chan);
}

display_texture(integer check)  //Display texture and set name in description (picture mode)
{                               //"Check" holds the number of textures in contents. The function uses "current_texture" to display.
    string name = llGetInventoryName(INVENTORY_TEXTURE,current_texture);
    llSetTexture(name,DISPLAY_ON_SIDE);
    report("Showing picture: "+name+" ("+(string)(current_texture+1)+"/"+(string)check+")");
}
    

next()  //Change to next texture (picture mode)
{       //This function is used twice - by the menu and timer. Therefor, it is a dedicated function.
    current_texture++;
    integer check = llGetInventoryNumber(INVENTORY_TEXTURE);
    if(check == 0)
    {
        llSetTexture(BLANK,DISPLAY_ON_SIDE);
        current_texture = 0;
        report("No pictures found.");
        return;
    }
    if(check == current_texture)
        current_texture = 0;
    
    display_texture(check);
    return;
}

default
{
    state_entry()
    {
        chan = (integer)llFrand(1000) + 1000;   //Pick a random listen channel for the listener
        if(PICTURE_ROTATION_TIMER <= 0)         //Ensure the value is no less or equal 0
            PICTURE_ROTATION_TIMER = 1;
        llListenRemove(listenHandle);
        listenHandle = -1;
        last_owner = llGetOwner();
        groupcheck = llRequestAgentData(llGetOwner(),DATA_NAME);
        off();
        llOpenRemoteDataChannel();
    }
    
    on_rez(integer i)
    {
        llResetScript();
    }

    touch_start(integer total_number)
    {
        //-------------------------------------------------------------------------------
        //Listen only to owner or group member. Edit this code to change access controls.
        if(llDetectedKey(0) != llGetOwner() && llDetectedGroup(0) == FALSE)
            return;
        //-------------------------------------------------------------------------------

        if(llGetOwnerKey(llGetKey()) != last_owner)  //Sense if object has been deeded to group for Web Guide function
        {
            isGroup = TRUE;
            last_owner = llGetOwner();
            groupcheck = llRequestAgentData(llGetOwner(),DATA_NAME);
            
            if(mode == 2)
            {
                llSay(0,"Detected change in ownership. Attempting to obtain current parcel media texture...");
                video();
            }
        }

        menu(llDetectedKey(0));
    }
    
    changed(integer change)
    {
        if(change == CHANGED_INVENTORY) //If inventory change
            if(mode == 1)   //If picture mode
            {
                integer check = llGetInventoryNumber(INVENTORY_TEXTURE);
                if(check != 0)
                {
                    current_texture = 0;
                    display_texture(check);
                }
                else
                {
                    llSetTexture(BLANK,DISPLAY_ON_SIDE);
                    report("No pictures found.");
                }
            }
            else
                if(mode == 2)   //If video mode
                    if(finditem(NOTECARD) != -1)    //And bookmarks notecard present
                        if(notecardkey != llGetInventoryKey(NOTECARD))
                            tempuser = llGetNumberOfNotecardLines(NOTECARD);    //Reload number of lines
    }
    
    listen(integer channel, string name, key id, string message)
    {
        if(message == "Pictures")
        {
            if(mode == 2)
                llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_STOP]);
            pictures();
            mode = 1;
            menu(id);
            return;
        }
        if(message == "Video")
        {
            video();
            mode = 2;
            menu(id);
            return;
        }
        if(message == "Power off")
        {
            if(mode == 2)
                llParcelMediaCommandList([PARCEL_MEDIA_COMMAND_UNLOAD]);
            off();
            mode = 0;
            return;
        }
        if(message == "Help")
        {
            llSay(0,"Help documentation is available at: http://www.slguide.com/help");
            if(isGroup)
            {
                if(id == NULL_KEY)
                {
                    llSay(0,"FreeView cannot load help pages while set to group without the remote.");
                    llSay(0,"For further assistance, please consult: http://slguide.com/help");
                }
                else
                    tell_remote("HELP"+(string)id+(string)XML_channel);
            }
            else
                llLoadURL(id,"Help pages for FreeView","http://www.slguide.com?c="+(string)XML_channel+"&help=1");
        }
        if(mode == 1)
        {
            if(message == "Browse")
            {
                loop_image = FALSE;
                browse(id);
                return;
            }
            if(message == "Next")
            {
                extendtimer();
                next();
                browse(id);
            }
            if(message == "Back")
            {
                extendtimer();
                current_texture--;
                integer check = llGetInventoryNumber(INVENTORY_TEXTURE);
                if(check == 0)
                {
                    llSetTexture(BLANK,DISPLAY_ON_SIDE);
                    current_texture = 0;
                    report("No pictures found.");
                    return;
                }
                if(current_texture < 0)
                    current_texture = check - 1;
                
                display_texture(check);
                
                browse(id);
                return;
            }
            if(message == "Menu")
            {
                menu(id);
                return;
            }
            if(message == "Loop")
            {
                llSetTimerEvent(PICTURE_ROTATION_TIMER);
                loop_image = TRUE;
                llOwnerSay("Picture will change every "+(string)PICTURE_ROTATION_TIMER+" seconds.");
                return;
            }
            if(message == "Unloop")
            {
                loop_image = FALSE;
                llOwnerSay("Picture loop disabled.");
                return;
            }
            if(message == "Fix scale")
            {
                llSay(0,"Setting display texture to 1,1 repeats and 0,0 offset.");
                llScaleTexture(1, 1, DISPLAY_ON_SIDE);
                llOffsetTexture(0, 0, DISPLAY_ON_SIDE);
                return;
            }
        }
        if(mode == 2)
        {
            if(channel == REMOTE_CHANNEL)
            {
                if(encryption == 0)
                    encryption = (integer)message;
                llListenRemove(listenRemote);
                listenRemote = -1;
                llSay(0,"Remote configured ("+(string)id+")");
            }
                
            if(message == "TV Guide")
            {
                if(isGroup)
                {
                    if(!encryption)
                    {
                        llSay(0,"** Error - This FreeView object has been deeded to group. You must use a Remote control to open the TV Guide.");
                        llSay(0,"You can set up the remote control from the Video -> Configuration menu. Please refer to the notecard for further assistance.");
                        return;
                    }
                    tell_remote((string)id+(string)XML_channel+(string)llGetOwner());
                }
                else
                    llLoadURL(id, "Come to the Guide to Start Your Viewer Playing!", "http://slguide.com/index.php?v=" + (string)llGetKey() + "&c=" + (string)XML_channel + "&o=" + (string)llGetOwner() + "&");
                return;
            }

            string header = "Video mode"+moviename+": ";
            
            if(message == "<< Prev")
            {
                notecardline--;
                if(notecardline < 0)
                    notecardline = numberofnotecardlines - 1;
                tempuser = id;
                llGetNotecardLine(NOTECARD,notecardline);
                return;
            }
            if(message == "Next >>")
            {
                notecardline++;
                if(notecardline >= numberofnotecardlines)
                    notecardline = 0;
                tempuser = id;
                llGetNotecardLine(NOTECARD,notecardline);
                return;
            }
            if(message == "Use")
            {
                if(tempurl == "** No URL specified! **")
                    tempurl = "";
                seturl(tempurl,id);
                return;
            }
                    
            if(message == "Menu")
            {
                menu(id);
                return;
            }
            if(message == "Configure")
            {
                config(id);
                return;
            }
            if(message == "Bookmarks")
            {
                if(notecardcheck != -1)
                {
                    llDialog(id,"Error: No valid bookmark data found in notecard '"+NOTECARD+"'.",["Menu"],chan);
                    return;
                }
                if(finditem(NOTECARD) != -1)                
                {
                    tempuser = id;
                    if(numberofnotecardlines >","Menu"],chan);
    }
    
    remote_data(integer type, key channel, key message_id, string sender, integer ival, string sval)
    {
        if (type == REMOTE_DATA_CHANNEL)
        {
            XML_channel = channel;
        } 
        else if(type == REMOTE_DATA_REQUEST)
        {
            list media_info = llParseString2List(sval, ["|"], []);
            tempmoviename = llList2String(media_info,0);
            seturl(llList2String(media_info,1),NULL_KEY);
            llRemoteDataReply(channel, message_id, sval, 1);
        }
    }
    
    timer()
    {
        if(llGetTime() > listenTimer)       //If listener time expired...
        {
            llListenRemove(listenHandle);   //Remove listeneres.
            llListenRemove(listenUrl);
            llListenRemove(listenRemote);
            listenHandle = -1;
            listenUrl = -1;
            listenRemote = -1;
            listenTimer = -1;
            if(loop_image == FALSE || mode != 1) //If we're not looping pictures or are in picture mode at all
                llSetTimerEvent(0.0);   //Remove timer
        }
        
        if(loop_image == TRUE && mode == 1) //If we're looping pictures and and we're in picture mode...
            next(); //Next picture
    }
}

  Cosmos instructions:

    1. First in the About Land window Media tab choose a texture to use as Media Texture (as you would anyway). No need to add any URL here, the script will set those "on the fly" later.
    2. Create the prim to use as a monitor/screen, and drop the script in it's inventory (no need for any special texturing or anything here)
    3. Open the script and on line 24 replace ALL_SIDES with the number of the prim's face you want your media displayed on ( 1, 2, 3 or 4).

     

    integer DISPLAY_ON_SIDE = ALL_SIDES; //Change this to change where the image will be displayed

        4. If you'll be using it for a picture "auto slide-show" (Picture loop) you may wish to modify on line 22 the time for picture rotation

    integer PICTURE_ROTATION_TIMER = 60; //In whole seconds

        5.  If you want to restrict usage of the scripts configuration menu to just the owner or group members then change FALSE on line 288 to TRUE

    if(llDetectedKey(0) != llGetOwner() && llDetectedGroup(0) == FALSE)

     Otherwise everyone will be able to change what it displays.
    Be sure to Reset the script after any changes made.
    Ready to choose your media.

    Use it with Video

    • Touch your prim (hmm that sounds kinky) and a menu will appear to choose the mode, select Video.
    • Select Set URL and it will inform you to chat a media url in channel 1, select OK and then do just that in local chat like below

            /1 http://www.archive.org/download/VJ_Mission_Boundary_Issues/VJ_Mission_Boundary_Issues_512kb.mp4

    give it a few seconds
    Your media should be loaded on the face you selected on step 3 above - If a permission request appears select Allow - If you can't see it but you hear the sound you might need to rotate around the prim to locate the correct face.
    Everytime you use the above method (Set URL) the script is actually setting the media url you type to current parcel media, and it's ok for setting up a single video.

    Note: while video is being displayed the left click doesn't activate the menu, use right click and select Touch for it.

    You can store multiple videos in a list and use the menu to navigate through them, by creating a note-card named bookmarks and copying it in the prims inventory along with the script. It must be in the following format:
    title or description|media URL like below:

    Sun Flight by Gerald McDermott|http://www.archive.org/download/sun_flight/sun_flight_512kb.mp4
    Animation Remix|http://www.archive.org/download/Animation_Remix/AnimationRemixx_512kb.mp4

     Now from the menu (after selecting Video) you can use the Bookmarks button to navigate through the media on your list and choose Use to set as "active" (parcel media).

    Video button particulars
    Play, Stop function as expected. The Pause button works fine, but to resume playback I found I had to use the viewer's Play streaming media button - choosing Play from the menu restarts the video.
    The loop button loops the currently set parcel media and I found that it works best if clicked when desired video is already set, but stopped.

    Use it with Pictures/Images

    Not much to say here, pretty straightforward, just add your images in the prims inventory (along script) click and choose Pictures from the menu.
    Then you can Browse manualy through them or set an auto "slide show" with Loop.
    Whatever you set for the pictures (single or looping) will be what others will see too - in contrast to the video setup that is partially dependent on the user's viewer streaming media preferences.

    Additional Info

    As left clicking on the face of the prim that is currently playing video doesn't brink up the menu (right click > Touch does) I tested clicking on other faces and they work fine, so if right clicking is not ideal to you, making these faces visibly available to a user might be another approach (Tapering came to mind, although somewhat crude).

    You may add on line 159 additional file-type extensions (I have added to my copy mp4 and mv4)

    if(ext == "mov" || ext == "avi" || ext == "mpg" || ext == "mpeg" || ext == "mp4" || ext == "m4v" || ext == "smil")

     Another proposed security mod (by Ai Austin) was to allow only specific avatars menu control, by adding right after line 288 the code below with the avatar names you wish

    if(llDetectedName(0) != "Avatar Name" && llDetectedName(0) != "Another Avatar")

     The Help and TVGuide buttons do not lead to their supposed url targets for a good couple of years now (to the best of my knowledge).
    TVGuide page used to be a categorized list of available streaming media urls, coded so that clicking on one could set it as parcel media straight into FreeView - unfortunately it got spammed to death.
    The set Remote button (Video > Configuration) was needed only for the TVGuide funcionality mentioned above, specifically on group-deeded parcels, used in conjunction with a second prim containing the script below to enable group-deeded objects to use llLoadURL.
    I haven't tested this part myself, and since the site isn't working seems somewhat irrelevent, but for completion's sake I thought I'd include it here.

     

    //This script allow Group-Deeded FreeView to work on group deeded land.
    
    //DO NOT PUT IN THE SAME OBJECT AS THE FREEVIEW VIEWER
    
    //DO NOT DEED THIS OBJECT TO GROUP
    
    integer CHANNEL = 9238742;
    integer code = 0;
    
    default
    {
        state_entry()
        {
            llSetText("~FreeView Remote for Group land~\nConfigure me!\nClick the FreeView TV: Video -> Configure -> Set Remote",<1 ,1,1>,1);
            llListen(CHANNEL,"","","");
            llRequestAgentData(llGetLandOwnerAt(llGetPos()),DATA_NAME);
        }
       
        on_rez(integer i)
        {
            llResetScript();
        }
    
        listen(integer channel, string name, key id, string message)
        {
            if(message == "SETUP" && code == 0)
            {
                llSetText("",<1 ,1,1>,1);
                code = (integer)llFrand(2100000);
                code+=1;
                llSay(CHANNEL,(string)code);
                llSleep(2);
                llSay(0,"Done! Please keep me somewhere near your FreeView object. Additionaly, you can modify my shape and texture if you wish.");
            }
            message = llBase64ToString(llXorBase64Strings(message, llStringToBase64((string)code)));
            integer length = llStringLength((string)code);
            if(llGetSubString(message,0,length - 1) != (string)code)
                return;
    
            message = llGetSubString(message,length,-1);
    
            if(llGetSubString(message,0,3) == "HELP")
            {
                llLoadURL((key)llGetSubString(message,4,39),"The FreeView help pages.","http://www.slguide.com/index.php?c="+llGetSubString(message,40,-1)+"&help=1");
            }
            else
            {
                if(llStringLength(message) == 108)
                    llLoadURL((key)llGetSubString(message,0,35), "Come to the Guide to Start Your Viewer Playing!", "http://www.slguide.com/index.php?v=" + (string)llGetKey() + "&c=" + llGetSubString(message,36,71) + "&o=" + llGetSubString(message,72,-1) + "&");
            }
        }
       
        dataserver(key queryid, string data)
        {
            if(data!="" && data != NULL_KEY)
            {
                llSetText("This land is not deeded to group.\nFeel free to delete me.",<1 ,1,1>,1);
                llSay(0,"You do not need to use this Remote because this land is not owned by group. (It is owned by: "+data+").");
            }
        }
    }

     

     

    Color and Texture Objects Via the SL Sun Cycles

    Expired

    From Lucinda Bulloch: You can copy and paste the parts you want or all of it it does work.

    //i wrote this code as part of code to grow plants, it is used to make the plants face the sun and color them from a list of colors
    //and adjust the food value of the plant but can easly be used for textures or all manner of thing like a sundial
    //Modular script will be releasing the plant code later in the year - but i found this fun to write and would like to share it with you
    //you can make the list as long as you like and they can all be of diff lengths - it uses float to calc the list pos so memory is the only limit
    
    float nightdivider = -0.45; // this is the lowest level Z will fall to - sl has seasons so this changes - you can work out a function for these
    float daydivider = 0.89;    // this is the highest level Z will reach - these dividers find the correct position in the texture list
    
    integer lampoff = TRUE;
    
    list morningcolors = ;
    list afternooncolors = ;
    list eveningcolors = ;
    list nightcolors = ;
    
    list morningtextures = ;
    list afternoontextures = ;
    list eveningtextures = ;
    list nighttextures = ;
    
    integer LINK_NUMBER = LINK_SET; //if for a linked prim put its number here
    integer FACE = ALL_SIDES;       //if for a face put its number here
    
    dotexture(list textures , integer sunposdiv)
    {
    
    //use the next line to test - things like the right texture names - comment out when done    
    llSay(0,llList2String(textures,sunposdiv));
    //this next line prints the texture to all faces
    //llSetTexture(llList2String(textures,sunposdiv),FACE);
    //this next line prints the texture to all faces of a linked prim
    //llSetLinkTexture(LINK_NUMBER,llList2String(textures,sunposdiv),FACE);
    //this next line use setprimparams to print the texture to all faces
    //llSetPrimitiveParams();
    //this next line use setprimparams to print the texture to all faces of a linked prim
    //llSetLinkPrimitiveParams(LINK_NUMBER,);
    
    }
    
    docolors(list textures , integer sunposdiv)
    {
    
    //for colors list with color vectors ie
    llSetColor(llList2Vector(textures,sunposdiv),FACE);
    //this prints to a linked prim
    //llSetLinkColor(LINK_NUMBER,llList2Vector(textures,sunposdiv),FACE);      
    }
    
    default
    {
        state_entry()
        {
         llSetTimerEvent(5);
        }
    
        timer()
        {
         llSetTimerEvent(0);
        
         //this gets the sun pos     
         vector sunpos = llGetSunDirection();
        
         //this bit sorts what color to use - colors can be used to tint - use this part for colors only
         if((sunpos.z <0) && (sunpos.x < 0)) docolors(eveningcolors,llFloor((sunpos.z/nightdivider)*(float)llGetListLength(eveningcolors)));
         else if(sunpos.z < 0) docolors(nightcolors,llGetListLength(nightcolors)-llCeil((sunpos.z/nightdivider)*(float)llGetListLength(nightcolors)));
         else if(sunpos.x > 0) docolors(morningcolors,llFloor((sunpos.z/daydivider)*(float)llGetListLength(morningcolors)));
         else docolors(afternooncolors,llGetListLength(afternooncolors)-llCeil((sunpos.z/daydivider)*(float)llGetListLength(afternooncolors)));
        
         //this bit sorts what texture to use - use only this part for textures only
         if((sunpos.z <0) && (sunpos.x < 0)) dotexture(eveningtextures,llFloor((sunpos.z/nightdivider)*(float)llGetListLength(eveningtextures)));
         else if(sunpos.z < 0) dotexture(nighttextures,llGetListLength(nighttextures)-llCeil((sunpos.z/nightdivider)*(float)llGetListLength(nighttextures)));
         else if(sunpos.x > 0) dotexture(morningtextures,llFloor((sunpos.z/daydivider)*(float)llGetListLength(morningtextures)));
         else dotexture(afternoontextures,llGetListLength(afternoontextures)-llCeil((sunpos.z/daydivider)*(float)llGetListLength(afternoontextures)));
        
         //if you wish to make it shine in the evening only - street lamp or a magic plant
         //format of the prim light =
         if((sunpos.z <0) && (sunpos.x < 0) && (lampoff)){lampoff = FALSE; llSetPrimitiveParams();}
         else if((sunpos.z < 0) && (sunpos.x > 0) && (!lampoff)) {lampoff = TRUE;llSetPrimitiveParams();}
        
         llSetTimerEvent(60);
        }
    }

     

    Simple Drop Mailbox

    Expired

    From Lucinda Bulloch via SL Scripting Library:

    This is a simple basic script to collect notes and give them on touch to a person on the list

    list names = ;
    default
    {
        state_entry()
        {
         llAllowInventoryDrop(TRUE);
        }
    
        changed(integer change) {
        if ((change & (CHANGED_ALLOWED_DROP | CHANGED_INVENTORY)) )
         {
          llInstantMessage(llGetOwner(), "note card added to "+llGetObjectName()+" inventory"); // tellowner a note has been droped in the prim
         }
      }
    touch_start(integer num)
      {
       if(llListFindList(names, ) != -1)
        {
         integer x;
         for(x=0; x
    

     

    Group/Rank Item Giver

    Expired

    Written by Mulligan Silversmith:

    This is the group Giver Script:

     

    //Make sure to set the objects Group to same as below.. It's under General Object Options!
    
    string item = "Object"; // The item you would like to give out
    string group_name = "Linden Lab"; // The group you would like to give the item to
    default
    {
        on_rez ( integer start )
        {
            llResetScript(); // Resets the script on rez
        }
    
        touch_start(integer total_number)
        {
            integer group = llSameGroup(llDetectedKey(0)); // checks to see if the person clicking on the object has the same active group as the object, returns TRUE or FALSE
            if ( group == TRUE )
            {
                llGiveInventory(llDetectedKey(0), item); // gives the item to the person who clicked on the object
                llSay(0, "Thank You");
            }
            else if ( group == FALSE )
            {
                llSay(0, "Only members of the group " + group_name + " may receive the inclosed item. If you are a member of the group " + group_name + " please put on your gourp tag try again.");
                // Tell who ever click on it that they don't have their tag on or they are not apart of group!
            }
        }
    }

     

    From Silversmith:

    Rank Giver: With this script make sure add the player name in list! Remember to add the old account name of player and not new display one. Also you could change it so it checks if player in the group and on list but I figured that take more time to send out items. Cause they are already on list O.o

    string item = "Object"; // The item you would like to give out
    list Names = ["Mulligan Silversmith","Mulligan Linden","Mulligan Pimp"]; // The names of people you want give items too
    /*
    For the name you need type it how it is on their profile with Caps and lower Cases
    */
    default
    {
        on_rez ( integer start )
        {
            llResetScript(); // Resets the script on rez
        }
    
        touch_start(integer total_number)
        {
            integer who; // Who is touching me!
            integer Index;
            Index = llListFindList(Names, [llDetectedName(who)]);
                if (Index > -1)
                {
                    llGiveInventory(llDetectedKey(0), item); // gives the item to the person who clicked on the object
                    llSay(0, "Thank You");
                }
                else
                    llInstantMessage(llDetectedKey(who), "Sorry, your name is not on the list."); // Let them know their name not on the list!
            }
    }