// Read out a complete notecard from the object's inventory.
string gName = "Radio 49 Stations"; // name of a notecard in the object's inventory
integer gLine = 0; // current line number
key gQueryID; // id used to identify dataserver queries
string gURL;
string gStaID;
string gStaName;
string gLastURL;
string getStaID(string sta_info)
{
return llList2String(llParseString2List(sta_info,[","],[]),0);
}
string getStaURL(string sta_info)
{
return llList2String(llParseString2List(sta_info,[","],[]),1);
}
string getStaName(string sta_info)
{
return llList2String(llParseString2List(sta_info,[","],[]),2);
}
default {
state_entry() {
llListen(49, "", NULL_KEY, ""
;//gName = llGetInventoryName(INVENTORY_NOTECARD, 0); // select the first notecard in the object's inventory
gQueryID = llGetNotecardLine(gName, gLine); // request first line
}
listen(integer channel, string name, key id, string message) {
if (message == "off"
{llSetParcelMusicURL(""
;llSay(0, "Channel 49 Radio OFF"
;}
else if (message == "on"
{llSetParcelMusicURL(gURL);
llSay(0, "Channel 49 Radio ON"
;}
else if (message == "list"
{llSay(0,"Channel Listing:"
;dataserver(key query_id, string data) {
if (query_id == gQueryID) {
if (data != EOF) { // not at the end of the notecard
gStaID = getStaID(data);
gURL = getStaURL(data);
gStaName = getStaName(data);
llSay(0, "Channel "+gStaID+": "+gStaName);
++gLine; // increase line count
gQueryID = llGetNotecardLine(gName, gLine); // request next line
}
}
}
}
else if (message == "help"
(continues from here ...... )Any help appreciated