<br />
<b>Warning</b>:  Parameter 1 to Language::getMagic() expected to be a reference, value given in <b>/var/www/sda/2/c/digigrids/wiki/includes/StubObject.php</b> on line <b>58</b><br />
<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://digigrids.free.fr/wiki/skins//common/feed.css?207"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title>OSSL Script Library/OpenSim Radio - Historique des versions</title>
		<link>http://digigrids.free.fr/wiki/index.php?title=OSSL_Script_Library/OpenSim_Radio&amp;action=history</link>
		<description>Historique pour cette page sur le wiki</description>
		<language>fr</language>
		<generator>MediaWiki 1.15.1</generator>
		<lastBuildDate>Mon, 24 Aug 2026 03:25:51 GMT</lastBuildDate>
		<item>
			<title>Djphil&amp;nbsp;:&amp;#32;Page créée avec « A basic parcel radio, using OSSL functions to read a notecard, cointaining a list of stations.  * Open access, so anyone can change stations.  * Very basic, and much could be… »</title>
			<link>http://digigrids.free.fr/wiki/index.php?title=OSSL_Script_Library/OpenSim_Radio&amp;diff=4545&amp;oldid=prev</link>
			<description>&lt;p&gt;Page créée avec « A basic parcel radio, using OSSL functions to read a notecard, cointaining a list of stations.  * Open access, so anyone can change stations.  * Very basic, and much could be… »&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Nouvelle page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;A basic parcel radio, using OSSL functions to read a notecard, cointaining a list of stations.&lt;br /&gt;
&lt;br /&gt;
* Open access, so anyone can change stations. &lt;br /&gt;
* Very basic, and much could be added or improved.&lt;br /&gt;
* Demonstrates the use of OSSL functions to read a notecard.&lt;br /&gt;
&lt;br /&gt;
'''Updates'''&lt;br /&gt;
* 0.12 - Selected station choice is now saved in the object description, and will be re-applied to the land/parcel upon script stert.&lt;br /&gt;
* 0.11 - Improved menu system&lt;br /&gt;
* 0.10 - Initial version&lt;br /&gt;
&lt;br /&gt;
=== Notecard ===&lt;br /&gt;
Name the notecard &amp;quot;stations&amp;quot; and place it in your prim.&lt;br /&gt;
Here are some example stations, copy and pase these exatly into your notecard:&lt;br /&gt;
&lt;br /&gt;
 Public Domain Jazz=http://82.197.167.138:80&lt;br /&gt;
 Digital Gunfire=http://radio1-uk.digitalgunfire.com:8000&lt;br /&gt;
 Salsa and Latin=http://205.188.215.231:8010&lt;br /&gt;
 Retro=http://scfire-ntc-aa03.stream.aol.com:80/stream/1013&lt;br /&gt;
&lt;br /&gt;
More stations can be found at http://www.shoutcast.com&lt;br /&gt;
&lt;br /&gt;
=== OpenSimulator Radio ===&lt;br /&gt;
&amp;lt;lsl&amp;gt;&lt;br /&gt;
// ######################################&lt;br /&gt;
// Radio for OpenSim, by Fritigern Gothly&lt;br /&gt;
// Version 0.12 - Oct 08, 2011&lt;br /&gt;
//&lt;br /&gt;
// Add your name and date to these&lt;br /&gt;
// comments if you alter this script in&lt;br /&gt;
// any way.&lt;br /&gt;
// If you put this in your own build, &lt;br /&gt;
// make sure to mention BOTH me and you!&lt;br /&gt;
// ######################################&lt;br /&gt;
&lt;br /&gt;
integer dchannel; // Will be a random number.&lt;br /&gt;
key toucher;&lt;br /&gt;
string stationcard = &amp;quot;stations&amp;quot;; // Name for the notecard. Change this is you want to use a different name.&lt;br /&gt;
integer cardlines;&lt;br /&gt;
integer n;&lt;br /&gt;
integer i;&lt;br /&gt;
list names;&lt;br /&gt;
list uris;&lt;br /&gt;
list page;&lt;br /&gt;
integer pagenum;&lt;br /&gt;
&lt;br /&gt;
// ----------------------&lt;br /&gt;
// Needed user functions.&lt;br /&gt;
// ----------------------&lt;br /&gt;
&lt;br /&gt;
initialize()&lt;br /&gt;
{&lt;br /&gt;
    //Clear the values to prevent problems&lt;br /&gt;
    names =[];&lt;br /&gt;
    uris=[];&lt;br /&gt;
    page = [];&lt;br /&gt;
    pagenum=0;&lt;br /&gt;
    cardlines=0;&lt;br /&gt;
    // Now get all stations (again)&lt;br /&gt;
    cardlines = osGetNumberOfNotecardLines(stationcard);&lt;br /&gt;
    for(n=0;n&amp;lt;cardlines;++n)&lt;br /&gt;
    {&lt;br /&gt;
            // Use llStringTrim to get rid of additional spaces around the&lt;br /&gt;
            // string. Makes this script a little more forgiving.&lt;br /&gt;
        string line = llStringTrim(osGetNotecardLine(stationcard,n), STRING_TRIM);&lt;br /&gt;
        if(llGetSubString(line,0,0)==&amp;quot;#&amp;quot; || line == &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            // Skip comments and empty lines&lt;br /&gt;
        } else {&lt;br /&gt;
            integer seperator = llSubStringIndex(line, &amp;quot;=&amp;quot;);&lt;br /&gt;
            uris += [llStringTrim(llGetSubString(line,seperator+1,llStringLength(line)), STRING_TRIM)];&lt;br /&gt;
            &lt;br /&gt;
                // Make sure that the button names fit on the buttons. Names &lt;br /&gt;
                // can be up to 24 characters (but only a few will show),&lt;br /&gt;
                // Doing this will let you put really long station names in&lt;br /&gt;
                // the notecard without problems.&lt;br /&gt;
            string desc = llStringTrim(llGetSubString(line,0,seperator-1), STRING_TRIM);&lt;br /&gt;
            if(llStringLength(desc) &amp;gt;= 23) desc = llGetSubString(desc,0,23);&lt;br /&gt;
            names += [desc];&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
        // Get all entries from the list of station names and put them in a string&lt;br /&gt;
        // in groups of nine, and put them in a new list..&lt;br /&gt;
    string btn;&lt;br /&gt;
    for(n=0;n&amp;lt;llGetListLength(names);n=n+9)&lt;br /&gt;
    {&lt;br /&gt;
        for(i=n;i&amp;lt;(n+9);++i) // Get 9 buttons....&lt;br /&gt;
        {&lt;br /&gt;
            if(n&amp;gt;llGetListLength(names)) return;&lt;br /&gt;
            btn += llList2String(names,i)+&amp;quot;,&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
        page += [btn]; // ...And put them in a list again! (As a string, not as list items!)&lt;br /&gt;
        btn=&amp;quot;&amp;quot;;&lt;br /&gt;
    }&lt;br /&gt;
    llOwnerSay(&amp;quot;Notecard loaded. &amp;quot;+(string)llGetListLength(names)+&amp;quot; stations in &amp;quot;+llGetListLength(page)+&amp;quot; pages.&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
dialog(string buttons)&lt;br /&gt;
{&lt;br /&gt;
    list b = [&amp;quot;&amp;lt; Prev&amp;quot;,&amp;quot;Cancel&amp;quot;,&amp;quot;Next &amp;gt;&amp;quot;]+llParseString2List(buttons,&amp;quot;,&amp;quot;,&amp;quot;&amp;quot;);&lt;br /&gt;
    string txt = &amp;quot;\nShowing stations &amp;quot;+(string)((pagenum*9)+1)+&amp;quot; to &amp;quot;+(string)((pagenum*9)+llGetListLength(llParseString2List(buttons,&amp;quot;,&amp;quot;,&amp;quot;&amp;quot;)))+&lt;br /&gt;
                 &amp;quot; of &amp;quot;+(string)llGetListLength(names)+&amp;quot; loaded.\n&amp;quot;+&lt;br /&gt;
                 &amp;quot;\nPage &amp;quot;+(string)(pagenum+1)+&amp;quot; of &amp;quot;+(string)llGetListLength(page);&lt;br /&gt;
    llDialog(toucher, txt+&amp;quot;\nChoose a station:&amp;quot;, b, dchannel);&lt;br /&gt;
    b=[]; // Clear the list, and save some memory.&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
default&lt;br /&gt;
{&lt;br /&gt;
    state_entry()&lt;br /&gt;
    {&lt;br /&gt;
        dchannel = llFloor(llFrand(9999999)); // Choose a random channel.&lt;br /&gt;
        initialize();&lt;br /&gt;
        if(llGetObjectDesc() != (integer)llGetObjectDesc()||llGetObjectDesc() == &amp;quot;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            llSetText(&amp;quot;OpenSimulator Radio\nClick to choose a station&amp;quot;, &amp;lt;1,1,1&amp;gt;,1);&lt;br /&gt;
        } else {&lt;br /&gt;
            integer index = (integer)llGetObjectDesc();&lt;br /&gt;
            llSetText(llList2String(names,index)+&amp;quot;\n&amp;quot;+llList2String(uris,index),&amp;lt;1,1,0&amp;gt;,1);&lt;br /&gt;
            llSetParcelMusicURL(llList2String(uris,index)); // Sometimes the parcel's audio settings don't survive a restart or server upgrade. So we'll set it again, just to make sure.&lt;br /&gt;
        }&lt;br /&gt;
        // llOwnerSay(&amp;quot;Ready&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    touch_start(integer numdet)&lt;br /&gt;
    {&lt;br /&gt;
        toucher = llDetectedKey(0);&lt;br /&gt;
        llListen(dchannel, &amp;quot;&amp;quot;,&amp;quot;&amp;quot;,&amp;quot;&amp;quot;);&lt;br /&gt;
        dialog(llList2String(page,pagenum));&lt;br /&gt;
        &lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    listen(integer channel, string name, key id, string msg)&lt;br /&gt;
    {&lt;br /&gt;
        if(msg == &amp;quot;&amp;lt; Prev&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            --pagenum;&lt;br /&gt;
            if(pagenum&amp;lt;0) pagenum = llGetListLength(page)-1;&lt;br /&gt;
            dialog(llList2String(page,pagenum));&lt;br /&gt;
        } &lt;br /&gt;
        else if(msg == &amp;quot;Next &amp;gt;&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            ++pagenum;&lt;br /&gt;
            if(pagenum&amp;gt;=llGetListLength(page)) pagenum = 0;&lt;br /&gt;
            dialog(llList2String(page,pagenum));&lt;br /&gt;
        } &lt;br /&gt;
        else if(msg == &amp;quot;Cancel&amp;quot;)&lt;br /&gt;
        {&lt;br /&gt;
            pagenum = 0;&lt;br /&gt;
            return;&lt;br /&gt;
        } &lt;br /&gt;
        else {&lt;br /&gt;
                // If none of the predefined buttons were clicked, it must be a station name.&lt;br /&gt;
            integer index = llListFindList(names,msg);&lt;br /&gt;
            llSetParcelMusicURL(llList2String(uris,index));&lt;br /&gt;
            llSay(0,&amp;quot;Station changed to &amp;quot;+llList2String(names,index)+&amp;quot; (&amp;quot;+llList2String(uris,index)+&amp;quot;)&amp;quot;);&lt;br /&gt;
            llSetText(llList2String(names,index)+&amp;quot;\n&amp;quot;+llList2String(uris,index),&amp;lt;1,1,0&amp;gt;,1);&lt;br /&gt;
            llSetObjectDesc((string)index);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    changed(integer ischanged)&lt;br /&gt;
    {&lt;br /&gt;
            //If something changed in the inventory, go and read the list with stations again!&lt;br /&gt;
        if(ischanged &amp;amp; CHANGED_INVENTORY) initialize();&lt;br /&gt;
    }&lt;br /&gt;
}&amp;lt;/lsl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Scripts]]&lt;/div&gt;</description>
			<pubDate>Thu, 12 Apr 2012 04:52:18 GMT</pubDate>			<dc:creator>Djphil</dc:creator>			<comments>http://digigrids.free.fr/wiki/index.php?title=Discussion:OSSL_Script_Library/OpenSim_Radio</comments>		</item>
	</channel>
</rss>