Difference between revisions of "LlSetParcelMusicURL"

From Second Life Wiki
Jump to navigation Jump to search
m (Replaced old <LSL> block with <source lang="lsl2">)
 
(4 intermediate revisions by 3 users not shown)
Line 3: Line 3:
|func=llSetParcelMusicURL
|func=llSetParcelMusicURL
|p1_type=string|p1_name=url
|p1_type=string|p1_name=url
|func_footnote=The object owner must also be the land owner. If the land is deeded to a group the will need to be deeded to the same group for this function to function.
|func_footnote=The object owner must also be the land owner. If the land is deeded to a group the object will need to be deeded to the same group for this function to work.
|func_desc=Sets the streaming audio URL for the parcel object is on
|func_desc=Sets the [[Streaming Music|streaming audio]] URL for the parcel object is on
|return_text
|return_text
|spec
|spec
|caveats
|caveats
|constants
|constants
|examples
|examples=
<source lang="lsl2">// This script changes the music URL based on time of day.
 
integer night = FALSE;
string nighturl = "http://205.188.215.228:8006";
string dayurl = "http://208.122.59.30:7156";
 
default
{
    state_entry()
    {
        llSetTimerEvent(10);
    }
   
    timer()
    {
        vector pos = llGetSunDirection();
       
        if ((pos.z < -.75) != night)
        {
            night = !night;
            if (night)
            {
                llSetParcelMusicURL(nighturl);
            }
            else
            {
                llSetParcelMusicURL(dayurl); 
            }
        }
    }
}</source>
|helpers
|helpers
|also_functions
|also_functions=
{{LSL DefineRow||[[llGetParcelMusicURL]]|Gets the music stream URL for the parcel object is on}}
|also_tests
|also_tests
|also_events
|also_events
Line 18: Line 50:
|cat1=Parcel
|cat1=Parcel
|cat2=Sound
|cat2=Sound
|cat3
|cat3=Media
|cat4
|cat4
}}
}}

Latest revision as of 14:21, 22 January 2015

Summary

Function: llSetParcelMusicURL( string url );
2.0 Forced Delay
10.0 Energy

Sets the streaming audio URL for the parcel object is on

• string url

The object owner must also be the land owner. If the land is deeded to a group the object will need to be deeded to the same group for this function to work.

Caveats

  • This function causes the script to sleep for 2.0 seconds.

Examples

// This script changes the music URL based on time of day.

integer night = FALSE;
string nighturl = "http://205.188.215.228:8006";
string dayurl = "http://208.122.59.30:7156";

default
{
    state_entry()
    {
        llSetTimerEvent(10);
    }
    
    timer()
    {
        vector pos = llGetSunDirection();
        
        if ((pos.z < -.75) != night)
        {
            night = !night;
            if (night)
            {
                llSetParcelMusicURL(nighturl);
            }
            else
            {
                llSetParcelMusicURL(dayurl);   
            }
        } 
    }
}

See Also

Functions

•  llGetParcelMusicURL Gets the music stream URL for the parcel object is on

Deep Notes

Signature

function void llSetParcelMusicURL( string url );