Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Discussion: Simple slideshow style radio tuner

Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
11-25-2005 23:21
CODE

// Osgeld Barmy's Incoherent Scripting
// free to mod,copy, and if a reasonable amount of work has been done, sell.
// media url's are public domain via shoutcast.com

// NOTE !!! in order for any set media script to work you must own the land it is on or have the land owner set it out for you, and script it where you have access to the controls.

// Data

// MP3 stream url's
list station_url = ["http://205.188.215.230:8002", // list_pos 0
"http://212.48.126.102:7086", // list_pos 1
"http://205.188.215.225:8004"]; // list_pos 2
// Station names
list station_txt = ["Club 977 top 40", // list_pos 0
"Kay FM 80's", // list_pos 1
"DI TRANCE CHANNEL"]; // list_pos 2

integer list_total; //how many entrys (stations) are in list station_url
integer list_pos; //floating position (0 or 1 or 2 or ect)

// User Defined Functions, this isnt neccacary at the moment, but...
return_data() // just the name i gave it
{
//Set hover text based on list_pos && station_txt (in a random color, fluff)
llSetText((llList2String(station_txt,list_pos)),<llFrand(1-0),llFrand(1-0),llFrand(1-0)>,1);
//More Fluff, it says the station_text on the same info as the set text
llSay(0,llList2String(station_txt,list_pos));
//The Meat n Potatoes, set the lands music acc to list_pos && station_url info
llSetParcelMusicURL((llList2String(station_url, list_pos)) );
}


default
{
state_entry() // when the script is started or restarted ...
{
// counts the url list so you dont have to define it apon change :)
list_total = llGetListLength(station_url);
}
touch_start(integer total_number) // when someone touches it
{
// fire return data, integers already set and data instantly loaded out of memory
return_data();
// whatever list_pos is add one more
++list_pos;
// if list_pos is greater than or equal to list_count... looping the list
if (list_pos >= list_total) list_pos = 0;
}
}


no comment version
CODE

list station_url = [];

list station_txt = [];

integer list_total;
integer list_pos;
return_data()
{
llSetText((llList2String(station_txt,list_pos)),<llFrand(1-0),llFrand(1-0),llFrand(1-0)>,1);
llSay(0,llList2String(station_txt,list_pos));
llSetParcelMusicURL((llList2String(station_url, list_pos)) );
}


default
{
state_entry()
{
list_total = llGetListLength(station_url);
}
touch_start(integer total_number)
{
return_data();
++list_pos;
if (list_pos >= list_total) list_pos = 0;
}
}
Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
Original Thread
11-27-2005 21:19
/15/8b/73800/1.html
_____________________
i've got nothing. ;)
HarleyMC Homewood
Registered User
Join date: 31 Mar 2007
Posts: 15
08-01-2009 00:45
syntax errors all through it it might be a useful start for someone good at scripting
Anti Antonelli
Deranged Toymaker
Join date: 25 Apr 2006
Posts: 1,091
08-01-2009 06:11
From: HarleyMC Homewood
syntax errors all through it it might be a useful start for someone good at scripting

Compiles fine for me, and why on earth are you digging up 4 year old threads so you can criticize scripts anyway?
_____________________
Designer of sensual, tasteful couple's animations - for residents who take their leisure time seriously. ;)

http://slurl.com/secondlife/Brownlee/203/110/109/

Rolig Loon
Not as dumb as I look
Join date: 22 Mar 2007
Posts: 2,482
08-01-2009 07:49
From: HarleyMC Homewood
syntax errors all through it it might be a useful start for someone good at scripting

Really? Osgeld is good at scripting. Both versions compile well for me. What seems to be the problem?
_____________________
It's hard to tell gender from names around here but if you care, Rolig = she. And I exist only in SL, so don't ask.... ;)

Look for my work in XStreetSL at