ok here is how you add stations.
list stations = [
"trigger","station name","http://station/location",
"trigger2", "station name 2", "http://station2"
];
that is where you add them.
the trigger comes first; thats what the script listens for.
Then comes the station name; thats what is said when the station is switched.
Finaly comes the station URL; the web link for the station (what you enter in the player).
so you put the three items in the list stations in the format ["trigger,"station name","URL"]
to add multiple stations you put a comma between the multiple trios of data.
["trigger","station name","URL","trigger2", "station name 2", "URL 2"]
i've put each station on it's own line in the example.
^_^' Didn't say you wanted person control too.
------------------------------
Here is a version with person control.
To add people to the list of users who can control the object just add there keys to list users. separate them with comas. Finally to get the keys of the users just have them click an object with this script:
default
{
touch_start(integer a)
{
for(--a;a+1;--a)
llSay(0,llDetectedName(a)+" = "+(string)llDetectedKey(a));
}
}
example user list
list users =["00000000-0000-0000-000000000000"]
//Writen By Strife Onizuka
list stations = [
"trigger","station name","URL",
"trigger2", "station name 2", "URL2"
];
list users = [];
list commands;
list names;
default
{
state_entry()
{
llListen(0,"","","");
commands=llList2ListStrided(stations,0,-1,3);
names = llList2ListStrided( ["",""] + stations, 1, -1, 3);
stations = llList2ListStrided( [""] + stations, 1, -1, 3);
}
listen(integer a, string b, key c, string d)
{
if(llGetOwner()!=c && -1 == llListFindList( users, [(string)c]))
return;
a=llListFindList(commands,[d]);
if(a+1)
{
b="Current Station: " + llList2String(names,a);
llSetText(b,<1,1,1>,1);
llSay(0,b);
llSetParcelMusicURL( llList2String( stations ,a));
}
}
}