Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Music Streaming Script/Permissions

Sensual Casanova
Spoiled Brat
Join date: 28 Feb 2004
Posts: 4,807
10-01-2004 08:17
Does anyone know where I can find/buy a script that allows others to change the URL of streaming music on to my land?
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
10-01-2004 10:06
CODE

//Writen By Strife Onizuka
list stations = [
"trigger","station name","http://station/location",
"trigger2", "station name 2", "http://station2"
];

list commands;
list names;

state 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)
{
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));
}
}
}
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey
Cross Lament
Loose-brained Vixen
Join date: 20 Mar 2004
Posts: 1,115
10-01-2004 10:29
Darn it Strife, you're too darn fast! :D
_____________________
- Making everyone's day just a little more surreal -

Teeple Linden: "OK, where did the tentacled thing go while I was playing with my face?"
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
10-01-2004 10:42
ehhh i'm at work and the network blocks UDP so i can't play so i end up working on the wiki and posting on the forum (as reading the news gets my blood pressure up).

I do tech support at a school so there are quiet spells.

Consequently could someone compile the script to make sure it runs? :D

and I enjoy doing pro bono scripting to pass the time. ~_~ i should get the mac version of SciTe.
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey
Samhain Broom
Registered User
Join date: 1 Aug 2004
Posts: 298
10-01-2004 11:15
Does SciTE do any compiling? Do tell! (or is it just that you want something better to edit with than your Mac version of Notepad)
_____________________
rm -rf /bin/ladden #beware of geeks bearing grifts
Sensual Casanova
Spoiled Brat
Join date: 28 Feb 2004
Posts: 4,807
10-01-2004 11:15
wow, ty :) Except I am an idiot... how do I add stations? and how do I add the people allowed to use it?
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
10-01-2004 11:25
ok here is how you add stations.

CODE

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:

CODE

default
{
touch_start(integer a)
{
for(--a;a+1;--a)
llSay(0,llDetectedName(a)+" = "+(string)llDetectedKey(a));
}
}



example user list
CODE

list users =["00000000-0000-0000-000000000000"]


CODE

//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));
}
}
}
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey
Sensual Casanova
Spoiled Brat
Join date: 28 Feb 2004
Posts: 4,807
10-01-2004 11:35
Sorry I didnt make myself clear the first time... ty so much :)
Sensual Casanova
Spoiled Brat
Join date: 28 Feb 2004
Posts: 4,807
10-01-2004 11:40
Feel free to slap me but I am getting a syntax error?
Sensual Casanova
Spoiled Brat
Join date: 28 Feb 2004
Posts: 4,807
10-01-2004 11:42
oo I changed the "state default" to "default" and it compiled.. is that ok? lol
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
10-01-2004 11:54
i just updated the post above and gave better instuctions (and fixed the state default thing too)

(some work popped up that needed attending to, so the edit was left on the screen for a few min)
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey
Sensual Casanova
Spoiled Brat
Join date: 28 Feb 2004
Posts: 4,807
10-01-2004 12:27
Got it working, TY STRIFE!
Strife Onizuka
Moonchild
Join date: 3 Mar 2004
Posts: 5,887
10-01-2004 12:40
Pleasure to be of service.

A part of me subscribes to the school of though that says information should be free (but the tuition is killing me :p )

*has done good deed for the day; can go back to causing strife*
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey