Jump to content

JacobMcKinght

Resident
  • Posts

    3
  • Joined

  • Last visited

Reputation

0 Neutral

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. iff only the lsl gods would allow llGetParcelMusicURl lol.. guys i would be happy to compensate anyone who could help me add this last piece in like seriously its all i need for it to be complete lol
  2. Thanks for replying peter.. i have moded a little bit but most was written by someone else i found along the way. the 2nd script is one of 3 other scripts but those are for the display board.. my problem is is i need to know how the linked messages look as i do not fully understand with these already prwritten and so complex i have this ready to rock and roll but just need to add that last bit in to sell it to be automatic... if there is anyway you or someone could show me how it should look and where to plug it in i would be greatful ty
  3. I am in no way a script guru but am learning quickly and all is starting to make a lil since now after a few weeks of studying up on code and exampples and plug and play and compiling errors lol but I have a problem. I have two scripts and i need one to draw something off another. Now, i know of 2 ways (llSay & llListen, and llLinked message) however i have not dealt with the latter very much. so my problem is this: Script 1 - Radio Tuner- changes station through menu allows station presets. Script 2 - Retrieves stream info. (Stream url, song, artist) Manually have to enter in Parcel Music url into script. The Problem is I need script 2 to to be able to retrieve the url from Script 1 when the stream is changed. I am sure i probably know how to but for whatever reason cant think of how to atm lol has caused me a headache for 2 days and i now am seeking help. i will paste the following scripts below. Script 1:Radio Tuner string _notecard = "URL"; integer chatChannel = 77; list _radioURLs; list _radioStations; list theStations; integer _linenum = 0; integer curStationOffset = 0; integer stationChunk = 6; integer curStationEnd = 5; integer totalStations = 0; integer dialogActive = 0; integer curIdx = -1; string dispStationStr = ""; string NEXT_MSG = "Next >>"; string PREV_MSG = "<< Prev"; string LIST_MSG = "List"; string CUR_SET = "c"; string ALL_SET = "a"; list cmdNextChunk; list cmdPrevChunk; list cmdLsCur; list cmdLsAll; list cmdSearch; //----------------------- reset_radio() { llListen(77, "", "", ""); curStationOffset = 0; curStationEnd = 5; _linenum = 0; dialogActive = 0; _radioURLs = []; _radioStations = []; totalStations = 0; curIdx = -1; dispStationStr = ""; llGetNotecardLine(_notecard, _linenum); } add_station(string line) { list words = llParseString2List(line, [" ", " ", "="], []); if (llGetListLength(words) < 2) { return; } string url = llList2String(words, llGetListLength(words) - 1); string station = ""; integer i; for (i=0; i<llGetListLength(words) - 1; i++) { if (llStringLength(station) > 0) { station += " "; } station += llList2String(words, i); } _radioURLs += [url]; _radioStations += [station]; } curStations() { theStations = [PREV_MSG, LIST_MSG, NEXT_MSG]; integer i; dispStationStr = ""; // llWhisper(0, "offset: " + (string)curStationOffset); // llWhisper(0, "end: " + (string)curStationEnd); for (i = curStationOffset; i <= curStationEnd; i++) { if (curIdx == i) { dispStationStr += "*"; } else { dispStationStr += " "; } dispStationStr += (string) (i + 1) + ") "; dispStationStr += llList2String(_radioStations, i); dispStationStr += ""; theStations += (string)(i + 1); } } doNextSet() { curStationOffset += stationChunk; curStationEnd = curStationOffset + (stationChunk - 1); if (curStationOffset >= totalStations) { curStationOffset = 0; curStationEnd = curStationOffset + (stationChunk - 1); } if (curStationEnd >= totalStations) { curStationEnd = totalStations - 1; } } doPrevSet() { if (curStationOffset > 1 && ((curStationOffset - stationChunk) < 1)) { curStationOffset = 0; } else { curStationOffset -= stationChunk; } curStationEnd = curStationOffset + (stationChunk - 1); if (curStationEnd >= totalStations) { curStationEnd = totalStations - 1; } if (curStationOffset < 0) { curStationEnd = totalStations - 1; curStationOffset = totalStations - (stationChunk - 1); } } doListStations(string mode) { integer i; integer startPos; integer endPos; if (mode == "a") { startPos = 0; endPos = totalStations - 1; } else { startPos = curStationOffset; endPos = curStationEnd; } for (i = startPos; i <= endPos; i++) { string newURL = llList2String(_radioURLs, i); string newDesc = llList2String(_radioStations, i); llSay(0, (string)(i + 1) + ": " + newDesc + " = " + newURL); } } doSearch(list theTerms) { integer i; string thePhrase = llToLower(llDumpList2String(theTerms, " ")); llSay(0, "the term is " + thePhrase); for (i = 0; i < totalStations; i++) { string curString = llList2String(_radioStations, i); if (llSubStringIndex(llToLower(curString), thePhrase) != -1) { string newURL = llList2String(_radioURLs, i); llSay(0, (string)(i + 1) + ": " + curString + " = " + newURL); } } } //----------------------- default { on_rez(integer start_param) { reset_radio(); } state_entry() { reset_radio(); cmdNextChunk = [">>", "next", "Next", NEXT_MSG]; cmdPrevChunk = ["<<", "prev", "Prev", PREV_MSG]; cmdLsCur = ["ls", "list", LIST_MSG]; cmdLsAll = ["la", "listall"]; cmdSearch = ["s", "search"]; } changed(integer change) { if (change & CHANGED_INVENTORY) { reset_radio(); } } dataserver(key query_id, string data) { if (data != EOF) { add_station(data); _linenum++; if (_linenum % 3 == 0) { llSay(0, "Processing Server Info... Please Wait."); llSay(0, "Proccessing Finished... System Library Updated."); } llGetNotecardLine(_notecard, _linenum); return; } llListen(93, "", NULL_KEY, ""); totalStations = llGetListLength(_radioURLs); dialogActive = 1; } touch_start(integer touchNumber) { if(llDetectedLinkNumber(0) != llGetLinkNumber()) return; curStations(); key toucher = llDetectedKey(0); if (!llSameGroup(toucher)) { return; } llDialog(llDetectedKey(0), dispStationStr, theStations, 93); } listen(integer channel, string name, key id, string message) { if (dialogActive == 0) { llWhisper(0, " ... still loading stations ..."); return; } if (message == "") { message = "cur"; } list words = llParseString2List(message, [" ", " ", "="], []); list testFind = llList2List(words, 0, 0); if (llListFindList(cmdNextChunk, testFind) != -1) { doNextSet(); curStations(); if (channel == chatChannel) { doListStations(CUR_SET); } else { llDialog(id, dispStationStr,theStations, 93); } return; } else if (llListFindList(cmdPrevChunk, testFind) != -1) { doPrevSet(); curStations(); if (channel == chatChannel) { doListStations(CUR_SET); } else { llDialog(id, dispStationStr, theStations, 93); } return; } else if (llListFindList(cmdSearch, testFind) != -1) { doSearch(llList2List(words, 1, -1)); return; } else if (llListFindList(cmdLsAll, testFind) != -1) { doListStations(ALL_SET); return; } else if (llListFindList(cmdLsCur, testFind) != -1) { doListStations(CUR_SET); return; } else if ((integer)message > 0 && (integer)message < 256) { curIdx = (integer)message - 1; string newURL = llList2String(_radioURLs, curIdx); string newDesc = llList2String(_radioStations, curIdx); llSay(0, "Updating Parcel Info.... Stream Changed to " + message + ":"); llSay(0, newDesc + " = " + newURL); llSetParcelMusicURL(newURL); } } } Script 2: Stream Info string url = "http://uplink.duplexfx.com:8030/"; float checkTime = 15.0; list messages = [ "! JTD ! Shoutcast Tip System", // line 1 is larger -- use for your club name "Stream", // small text -- heading for next line "~~STREAM_TITLE~~", // medium text 40 characters "Artist", // small text -- heading for next line "~~CURRENT_SONG_ARTIST~~", // medium text 40 characters "Title", // small text -- heading for next line "~~CURRENT_SONG_TITLE~~" // medium text 40 characters ]; string say = "Now Playing: ~~CURRENT_SONG_TITLE~~ by ~~CURRENT_SONG_ARTIST"; vector background = <0,.8,.7>; vector foreground = <1,1,1>; string fontTexture = "XyzzyText Font Trajan"; // // // // Stream integer STREAM_STATUS_URL = 22100; integer STREAM_STATUS_TIME = 22101; integer STREAM_STATUS_STOP = 22102; integer STREAM_STATUS_DATA = 22103; integer STREAM_STATUS_ERROR = 22104; // Text integer DISPLAY_STRING = 204000; integer DISPLAY_EXTENDED = 204001; integer REMAP_INDICES = 204002; integer RESET_INDICES = 204003; integer SET_FADE_OPTIONS = 204004; integer SET_FONT_TEXTURE = 204005; integer SET_LINE_COLOR = 204006; integer SET_COLOR = 204007; integer RESCAN_LINKSET = 204008; list statusData; dumpData() { integer n = llGetListLength(statusData); llOwnerSay((string)n); string s = "\n"; while(--n >= 0) { s += llList2String(statusData,n-1) + "=" + llList2String(statusData,n) + "\n"; n--; if (llStringLength(s) > 512) { llOwnerSay(s); s = "\n"; } } llOwnerSay(s); } string getItem(string name) { integer i = llListFindList(statusData,[ "=="+llToUpper(name) ]); if (i >= 0) return llList2String(statusData,i+1); return(""); } list priorMessages; string priorSay; string fixMessage(string s) { list split = llParseStringKeepNulls(s,[ "~~" ],[]); integer n = llGetListLength(split); string s2; while(--n >= 0) { if (n & 1) { s2 = getItem(llList2String(split,n)) + s2; } else { s2 = llList2String(split,n) + s2; } } return s2; } updateMessages() { integer n = llGetListLength(messages); integer i; for (i = 0; i < n; i++) { string m = llList2String(priorMessages,i); string r = fixMessage(llList2String(messages,i)); //llOwnerSay((string)i+":"+r); if (r != m) { priorMessages = llListReplaceList(priorMessages,[ r ],i,i); llMessageLinked(LINK_THIS,DISPLAY_STRING,r,(string)i); //llOwnerSay((string)i+":"+r); } } if (say != "") { string s = fixMessage(say); if (s != priorSay) { llSay(0,s); priorSay = s; } } } integer retries = 0; default { state_entry() { priorMessages =[]; priorSay = ""; llSetColor(background,ALL_SIDES); llMessageLinked(LINK_THIS,SET_FONT_TEXTURE,"",(key)fontTexture); llMessageLinked(LINK_THIS,SET_COLOR,(string)background,""); integer n = llGetListLength(messages); while(--n >= 0) { llMessageLinked(LINK_THIS,SET_LINE_COLOR,(string)foreground,(string)n); llMessageLinked(LINK_THIS,DISPLAY_STRING,"",(string)n); } llMessageLinked(LINK_SET,STREAM_STATUS_TIME,(string)checkTime,NULL_KEY); llMessageLinked(LINK_SET,STREAM_STATUS_URL,url,NULL_KEY); } link_message(integer sender, integer num, string message, key id) { if (num == STREAM_STATUS_DATA) { retries = 0; statusData = llParseStringKeepNulls(message,[ "~||~" ], []); //dumpData(); // Uncomment this if you're curious to what status items you have available updateMessages(); } if (num == STREAM_STATUS_ERROR) { retries++; if (retries > 2) llSay(0,"ERROR on stream:"+url+":"+message); if (retries < 10) llMessageLinked(LINK_SET,STREAM_STATUS_URL,url,NULL_KEY); if (retries >= 10) llSay(0,"Stream Status stopped due to errors"); } } touch_start(integer num) { if (llDetectedGroup(0) || llDetectedKey(0) == llGetOwner()) { llSay(0,"Initiating Shut Down Sequence..."); llSay(0,"System Status OK... Powering Down."); state stop; } } } state stop { state_entry() { llMessageLinked(LINK_SET,STREAM_STATUS_STOP,"",NULL_KEY); } touch_start(integer num) { llSay(0,"System Initialized - Powering On."); state default; } } Any and all help would be greatly appreciated... Thank You :)
×
×
  • Create New...