It also allows you to have a user list.
This requires two parts one is the mixer the other is a repeter which should be by the mixer (usefull for group lands if its a group land make sure the prim thats the reciever not the mixer is group owned.)
This also contacts my server and grabs the shoutcast info for the station your on and displays it on a hover text on the mixer.
-The Mixer-
Script name: sc
CODE
//Writen By Dimentox Travanti
//Please leave this Intact
//You may not SELL this script.
//You may have limited liscence to use the SC query.
//This script is covered by the Creative Commons Liscence
string stationcard = "Stations";
string userc = "users";
integer cline = 0;
integer tline = 0;
key qstation;
key qlines;
integer d = 3;
string http ="http://";
string col = ":";
string scip;
string scpt;
string stationname;
integer x=0;
integer y=0;
integer z=0;
list users;
integer uline = 0;
key uquery;
key whotouch;
integer handle;
string request;
qsc()
{
request = "http://www.dimentox.com/sc/sc2.php?scip=" + scip + "&scpt=" + scpt;
llHTTPRequest(request,[HTTP_METHOD,"GET"],"");
}
change_s()
{
z = cline + d;
x = 0;
if (x > tline)
{
cline = 0;
}
qstation = llGetNotecardLine(stationcard, cline);
}
default
{
state_entry()
{
llSetText("loading", <1,1,1>, 1.0);
handle = llListen(-12345, "", NULL_KEY, "");
qlines = llGetNumberOfNotecardLines(stationcard);
uquery = llGetNotecardLine(userc, uline);
change_s();
cline = 0;
llSetTimerEvent(30);
}
on_rez(integer blahh)
{
llResetScript();
}
touch_start(integer times)
{
whotouch = llDetectedKey(0);
//string search = llDetectedName(0);
integer index = llListFindList( users, [llDetectedName(0)]);
if ( index != -1)
{
llListenRemove(handle);
handle = llListen(-12345, "", llDetectedKey(0), "");
llDialog(llDetectedKey(0), "Current Station " + stationname , ["Previous" , "Next", "Reset"], -12345);
} else {
llInstantMessage(whotouch, "You are not a DJ you may not change stations");
}
}
listen(integer channel, string name, key id, string message)
{
if (message == "Previous")
{
if (cline >= d)
{
cline = cline - d;
cline = cline - d;
change_s();
} else
{
cline = 0;
change_s();
}
//change_s();
}
if (message == "Next")
{
change_s();
}
if (message == "Reset")
{
llResetScript();
}
}
dataserver(key queryid, string data) {
if (queryid == uquery) {
if (data != EOF) {
users = users + [data];
++uline;
uquery = llGetNotecardLine(userc, uline);
}
}
if (queryid == qlines)
{
tline = (integer)data;
}
if (queryid == qstation) {
if (data != EOF) {
if (x == 0)
{
stationname = data;
if (whotouch){
llInstantMessage(whotouch, "Station Set to " + stationname);
}
}
if (x == 1)
{
//llSay(0, "ip"+data);
scip = data;
}
if (x == 2)
{
// llSay(0, "port"+data);
scpt = data;
}
++cline;
++x;
if (cline < z ){
qstation = llGetNotecardLine(stationcard, cline);
} else {
string media = "http://" + scip + ":" + scpt + "/";
qsc();
//this is for the group land with a reciever(might want to change the chan)
llWhisper(123456, "music " + media);
//uncomment this for a single prim on not grp based land
//llSetParcelMusicURL(media);
}
}
}
}
timer()
{
llSetText("loading", <1,1,1>, 1.0);
//llHTTPRequest("http://www.dimentox.com/sc/sc.php",[HTTP_METHOD,"GET"],"");
qsc();
}
http_response(key id, integer status, list metadata, string body)
{
llSetText("Station: " + stationname + "\n" + body, <1,1,1>, 1.0);
}
}
Note cards for the Mixer
Notecard

line 1: Name
line2: url w/o http
line3: port
Has to be this way for the hover text query.
CODE
Lost Angel's Radio
stream.dimentox.com
8000
UltraDark #1
84.16.231.180
3026
UltraDark #2
85.214.63.31
3026
Doomed
somafm-sc.streamguys.com
8300
Temple SL
66.197.50.71
8130
Notecard: users
full name per line
CODE
Dimentox Travanti
Ashes Arizona
-----Reciever---
aka for grp lands or non grp lands
this changes the actual media on the land
(you might want a transparent textoure on this prim)
script: Media Controller
CODE
//Writen By Dimentox Travanti
//Please leave this Intact
//You may not SELL this script.
//You may have limited liscence to use the SC query.
//This script is covered by the Creative Commons Liscence
default
{
state_entry()
{
llListen(123456, "", NULL_KEY, "");
}
listen( integer channel, string name, key id, string message )
{
if (llGetSubString(message, 0,4) == "music")
{
string media = llGetSubString(message, 6, -1);
llSetParcelMusicURL(media);
}
}
}
You might wanna change the channels for the reciever and dialogs.