Jump to content

Search the Community

Showing results for tags 'link_message'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • People Forum
    • Your Avatar
    • Make Friends
    • Lifestyles and Relationships
    • Role Play
    • General Discussion Forum
    • Forums Feedback
    • Missed Connections
    • Second Life Education and Nonprofits
  • Places and Events Forum
    • Favorite Destinations
    • Upcoming Events and Activities
    • Games in Second Life
  • Official Contests, Events & Challenges
    • Challenges
    • Contests
  • Creation Forum
    • Fashion
    • Art, Music and Photography
    • Animation Forum
    • Bakes on Mesh
    • Environmental Enhancement Project
    • Machinima Forum
    • Building and Texturing Forum
    • Mesh
    • LSL Scripting
    • LSL Library
    • Experience Tools Forum
  • Technology Forum
    • Second Life Server
    • Second Life Viewer
    • Second Life Web
    • General Second Life Tech Discussion
    • Mobile
  • Commerce Forum
    • Merchants
    • Inworld Employment
    • Wanted
  • Land Forum
    • General Discussion
    • Mainland
    • Linden Homes
    • Regions for Sale: Full Private Island
    • Region for Rent: Full Private Island
    • Regions for Sale: Homesteads
    • Region Rentals: Homestead
    • Parcels for Sale: Mainland
    • Parcels for Rent: Mainland
    • Wanted: Full Private Island
    • Wanted: Homesteads
    • Wanted: Mainland
  • International Forum
    • Deutsches Forum
    • Foro en español
    • Forum in italiano
    • Forum français
    • 日本語フォーラム
    • 한국어 포럼
    • Fórum em português
    • Forum polskie
    • المنتدى العربي
    • Türkçe Forum
    • Форум по-русски
  • Adult Content Forum
    • Highlight Upcoming Events
    • General Discussion
    • General Announcements
  • Answers
    • Abuse and Griefing
    • Account
    • Avatar
    • Creation
    • Inventory
    • Getting Started
    • Controls
    • Land
    • Linden Dollars (L$)
    • Shopping
    • Technical
    • Viewers
    • Everything Else
    • International Answers

Blogs

  • Commerce
  • Featured News
  • Inworld
  • Tools and Technology
  • Tips and Tricks
  • Land
  • Community News

Categories

  • English
  • Deutsch
  • Français
  • Español
  • Português
  • 日本語
  • Italiano
  • Pусский
  • Türkçe

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


About Me


Member Title

Found 2 results

  1. Hi Everyone I am truly stuck and it seems like LSL is misbeaving. I have been writing an update on my piano to read notecard information through a data server script which provides this to a command script to play . I am not getting information passed through to link_message handler and it seems to be dropped by the server and the list addition of a list to an existing list does not add the information to the list . The information seems to be corrupted with keys which was assigned seperate list number going into a single list array line and not being populated in the list correctly from the addition of this second list. i am sending no more than 37x4 linked_messages as a stream from data server which does not seem able t harvest the data when ts dropped by server can you help or provide information as to what can be done to prevent this dropped information ii have inserrted llSpeep upto 5 seconds on each lllMessageLinked( reponse but this had no effect and does not respolve issues of adding list to gether failures. [Command] Reciever link message parts link_message(integer sender_num, integer num, string list_argument, key id) { list r = llParseString2List(list_argument, ["|"], [""]); list scrub = llParseString2List(llList2String(r,3),["/t"],[""]); if(num==-90) return; if(llList2String(r,0) == "A") {_active=1; return; } if( (65536-llGetUsedMemory())<kill_mem ) { doMemoryErr(); return;} if(llList2String(r,0) == "DSC"||llList2String(r,0) == "DSL") { if(llList2String(r,1) =="M") _sdm += scrub; else if(llList2String(r,1) =="L") _sdm_l += scrub; else if(llList2String(r,1) =="R") _sdm_r += scrub; else if(llList2String(r,1) =="B") _bpm += scrub; return; } else if(llList2String(r,0) == "DSS") { if( llGetListLength(_sdm)<2) { llOwnerSay("ERR 000010 - An Error occured reading library data. Please reset the Piano. Please ensure your note card contains at least two keys to sound files."); return;} SoundOne(); return; } [Dataserver code] //Datahandling string owner_display_name; string owner_name_query; list SEQ_LIB=[]; // %%% MAIN DATA. integer _debug=0; integer i; list cmd; // %%% all cmd configured list arg1; // %%% value for each cmd configured list arg2; // %%% a configurable parameter list arg3; // %%% a configurable parameter float set_text_alpha = 1; integer ConfigRequired = FALSE; // whether to fail if no config cards string ConfigNotecardSuffix = ".msu"; // string identifying config notecards float ConfigTimeout = 60.0; integer ConfigLineIndex; // line number in notecard we're reading key ConfigRequestID; // request we're waiting for list ConfigCards; // list of names of config notecards string ConfigCardName; // name of card being read integer ConfigCardIndex; // index of next card to read integer kill_mem = 500; // memory size must be available. string Commander_Name = "Commander"; integer limit = 900; integer data_read =0; list _dump=[]; list _dump_l=[]; list _dump_r = []; list _dump_bpm = []; integer k=0; integer sound_running_syncro =0; // Say something if debug is enabled debug(string str) { if (_debug) { llOwnerSay(llGetScriptName() + ": " + str); } } doMemoryErr (){ llOwnerSay("Error loading music cards *.msu. There is less than recomended " +(string)kill_mem +" (bytes) left of script memory. Aborting "); } Say2(string ieos) { llSetText(ieos+ "\n.", <0,1,0>, set_text_alpha); } config_init() { cmd = []; // data arg1 = []; arg2 = []; arg3 = []; } // print the configuration, handy for debugging. config_dump() { say("cmds: " + llList2CSV(cmd)); // %%% say("arg1: " + llList2CSV(arg1)); // %%% say("arg2: " + llList2CSV( arg2)); // %%% say("arg3: " + llList2CSV(arg1)); // %%% } config_parse(string str, string cardName, integer lineNum) { list scrub=[]; str = llStringTrim(str, STRING_TRIM_HEAD); // delete leading spaces // lines beginning with slash are comments -- ignore them if (llGetSubString(str,0,0) == "/") { return; } list ldata = llParseStringKeepNulls(str, ["="], [""]); if(!data_read) { cmd += llList2String(ldata,0); arg1 += llList2String(ldata,1); } else { scrub = llParseString2List(str,[","],[""]); _dump += llList2String(scrub,0); if(llGetListLength(_dump)>3) { // llSay(0,"Got second read: "+(string)llList2CSV(_dump)); llMessageLinked(LINK_THIS,0,"DSC|M|"+(string)(k++)+"|"+llDumpList2String(_dump,"\t"),llGetKey()) ; _dump=[]; } _dump_l += llList2String(scrub,1); if(llGetListLength(_dump_l)>3) { llMessageLinked(LINK_THIS,0,"DSC|L|"+(string)(k++)+"|"+llDumpList2String(_dump_l,"\t"),llGetKey()) ; _dump_l=[]; } _dump_r += llList2String(scrub,3); if(llGetListLength(_dump_r)>5) { llMessageLinked(LINK_THIS,0,"DSC|R|"+(string)(k++)+"|"+llDumpList2String(_dump_r,"\t"),llGetKey()) ; _dump_r=[]; } _dump_bpm += llList2String(scrub,3); if(llGetListLength(_dump_bpm)>10) { llMessageLinked(LINK_THIS,0,"DSC|B|"+(string)(k++)+"|"+llDumpList2String(_dump_bpm,"\t"),llGetKey()) ; _dump_bpm=[]; } /* llSay(0,"data0:"+(string)str); llSay(0,"scrub data:"+(string)llList2String(scrub,0)); llSay(0,"scrub data:"+(string)llList2String(scrub,1)); llSay(0,"scrub data:"+(string)llList2String(scrub,2)); llSay(0,"_dump data:"+(string)_dump); llSay(0,"_dump_l data:"+(string)_dump_l); llSay(0,"_dump_r data:"+(string)_dump_r); */ } } doM(){ llOwnerSay("Error loading music cards *.msu. There is less than recomended " +(string)kill_mem +" (bytes) left of script memory. Aborting "); } // Post-process single card config, if necessary config_done_single() { // Prcess MP3 Key end data in cmd /* llSay(0,"L _dump data:"+(string)_dump); llSay(0,"L _dump_l data:"+(string)_dump_l); llSay(0,"L _dump_r data:"+(string)_dump_r);*/ llMessageLinked(LINK_THIS,0,"DSL|M|"+(string)(k++)+"|"+llDumpList2String(_dump,"\t"),llGetKey()) ; llMessageLinked(LINK_THIS,0,"DSL|L|"+(string)(k++)+"|"+llDumpList2String(_dump_l,"\t"),llGetKey()) ; llMessageLinked(LINK_THIS,0,"DSL|R|"+(string)(k++)+"|"+llDumpList2String(_dump_r,"\t"),llGetKey()) ; llMessageLinked(LINK_THIS,0,"DSL|B|"+(string)(k++)+"|"+llDumpList2String(_dump_bpm,"\t"),llGetKey()) ; llMessageLinked(LINK_THIS,0,"DSS|",llGetKey()); say("Preparing to play."); } // Post-process any config, if necessary config_done() { if (_debug) { config_dump(); } if( !llGetScriptState(Commander_Name)){llSetScriptState(Commander_Name,TRUE);llSleep(0.1);} say("Config done"); } // ==== Utilities ==== // Say something, in this case to owner (%%% modify to whisper or whatever) say(string str) { llSetText(str+ "\n.", <0,1,0>, set_text_alpha); } // Get the next notecard name, and // return TRUE if there is one integer next_card() { if (ConfigCardIndex >= llGetListLength(ConfigCards)) { ConfigCards = []; return (FALSE); } ConfigLineIndex = 0; ConfigCardName = llList2String(ConfigCards, ConfigCardIndex); ConfigCardIndex++; ConfigRequestID = llGetNotecardLine(ConfigCardName, ConfigLineIndex); say("Reading " + ConfigCardName); return (TRUE); } default { state_entry() { SEQ_LIB=[]; if( llGetScriptState(Commander_Name)){llSetScriptState(Commander_Name,FALSE);llSleep(0.1);} state s_config; } } // This state is only used to get into s_config, because going from // s_config to s_config won't redo it's state_entry. But we might // not want to redo anything we might have put in default state entry. state s_reconfig { state_entry() { if( llGetScriptState(Commander_Name)){llSetScriptState(Commander_Name,FALSE);llSleep(0.1);} llSleep(0.1); state s_config; } } // Read card config // Singe notecard version - read all cards with the given extension state s_config_single { state_entry() { // if( llGetScriptState(Commander_Name)){llSetScriptState(Commander_Name,FALSE);llSleep(0.1);} llSleep(0.1); config_init(); ConfigCards = []; _dump=[]; _dump_l=[]; _dump_r = []; _dump_bpm = []; k=0; data_read = 1; if(ConfigCardName==NULL_KEY) return; ConfigLineIndex =0; say("Reading " + ConfigCardName); ConfigRequestID = llGetNotecardLine(ConfigCardName, ++ConfigLineIndex); sound_running_syncro=0; } dataserver(key query_id, string data) { if (query_id == ConfigRequestID) { // llSay(0,"line:"+(string)ConfigLineIndex); if(ConfigLineIndex<24)// Pass header { ConfigRequestID = llGetNotecardLine(ConfigCardName, ++ConfigLineIndex); llSetTimerEvent(ConfigTimeout); } else if (data == EOF) { // Read header only of 8 lines. // Finish card if( (65536-llGetUsedMemory())>kill_mem ) { config_done_single(); config_init(); } else { doMemoryErr();} if (! next_card()) { config_done(); state s_active; } } else { config_parse(data, ConfigCardName, ConfigLineIndex); ConfigRequestID = llGetNotecardLine(ConfigCardName, ++ConfigLineIndex); llSetTimerEvent(ConfigTimeout); } } } } // Read card config // Multiple notecard version - read all cards with the given extension state s_config { state_entry() { if( llGetScriptState(Commander_Name)){llSetScriptState(Commander_Name,FALSE);llSleep(0.1);} llSleep(0.1); config_init(); data_read=0; string item; ConfigCards = []; integer n = llGetInventoryNumber(INVENTORY_NOTECARD); while (n-- > 0) { item = llGetInventoryName(INVENTORY_NOTECARD, n); // Note: for simplicity, read cards with the "suffix" anywhere in the name if (llSubStringIndex(item, ConfigNotecardSuffix) != -1) { ConfigCards += [item]; } } ConfigCardIndex = 0; if (next_card()) { llSetTimerEvent(ConfigTimeout); } else if (ConfigRequired) { say("Configuration notecard missing."); state s_configRetry; } else { state s_active; } } dataserver(key query_id, string data) { if (query_id == ConfigRequestID) { if (data == EOF ||ConfigLineIndex==9) { // Read header only of 8 lines. // Finish card if( (65536-llGetUsedMemory())>kill_mem ) { SEQ_LIB += (ConfigCardName+"/t"+ llDumpList2String(cmd,"|")+"/t"+llDumpList2String(arg1,"|")); config_init(); } else { doMemoryErr();} if (! next_card()) { config_done(); state s_active; } } else { config_parse(data, ConfigCardName, ConfigLineIndex); ConfigRequestID = llGetNotecardLine(ConfigCardName, ++ConfigLineIndex); llSetTimerEvent(ConfigTimeout); } } } timer() { say("Dataserver time out: touch to retry"); state s_configRetry; } on_rez(integer num) { state s_reconfig; } changed(integer change) { if (change & CHANGED_OWNER) { if( llGetScriptState(Commander_Name)){llSetScriptState(Commander_Name,FALSE);llSleep(0.1);}llResetScript(); } if (change & CHANGED_INVENTORY) { state s_reconfig; } } state_exit() { llSetTimerEvent(0); } } state s_configRetry { touch_start(integer tot) { if (llDetectedKey(0) == llGetOwner()) { state s_config; } } changed(integer change) { if (change & CHANGED_OWNER) {if( llGetScriptState(Commander_Name)){llSetScriptState(Commander_Name,FALSE);llSleep(0.1);} llResetScript(); } if (change & CHANGED_INVENTORY) { state s_reconfig; } } } // State to go into if notecard is required but missing. // You can delete this and the code above that refers to it, // or just set ConfigurationRequired to FALSE. state s_unconfigured { state_entry() { if( llGetScriptState(Commander_Name)){llSetScriptState(Commander_Name,FALSE);llSleep(0.1);} llSetText("Configuration missing", <1.0,1.0,1.0>, 1.0); } changed(integer change) { if (change & CHANGED_OWNER) {llSetScriptState(Commander_Name,FALSE); llResetScript(); } if (change & CHANGED_INVENTORY) { state s_reconfig; } } state_exit() { llSetText("", <1.0,1.0,1.0>, 1.0); } } // The fun starts here! Up and running. state s_active { // Every state should usually have this, or something like it. state_entry() { if( !llGetScriptState(Commander_Name)){llSetScriptState(Commander_Name,TRUE);llSleep(0.1);} for(i=0;i<llGetListLength(SEQ_LIB);) { _dump += llList2String(llParseString2List( llList2String(llParseString2List( llList2String(SEQ_LIB,i), ["/t"], []),2), ["|"], []),0); // Arg list Name [0]. i++; } llMessageLinked(LINK_SET,0,"L|"+llDumpList2String(_dump,"/t"),llGetKey()); // remember tab if sending message. llMessageLinked(llGetLinkNumber(),0,"A|",llGetKey()); llSetText("Piano score", <1.0,1.0,1.0>, 1.0); } changed(integer change) { if (change & CHANGED_OWNER) {if( llGetScriptState(Commander_Name)){llSetScriptState(Commander_Name,FALSE);llSleep(0.1);} llResetScript(); } if (change & CHANGED_INVENTORY) { state s_reconfig; } } link_message(integer sender_num, integer num, string list_argument, key id) { list r = llParseString2List(list_argument, ["|"], []); list _dump=[]; if(num == 0) return; if(llList2String(r,0) == "L") {// Lists songs for(i=0;i<llGetListLength(SEQ_LIB);) { _dump += llList2String(llParseString2List( llList2String(llParseString2List( llList2String(SEQ_LIB,i), ["/t"], []),2), ["|"], []),0); // Arg list Name [0]. i++; } llMessageLinked(LINK_SET,0,"L|"+llDumpList2String(_dump,"/t"),llGetKey()); // remember tab if sending message. } else if(llList2String(r,0) == "H") {// Get Song header _dump= llList2ListStrided( llParseString2List(llList2String(llParseString2List(llList2String(SEQ_LIB,llList2Integer(r,1)),["/t"], []),2),["|"],[]),0,8,1); //Just the Header Get line in ARG1[num] llMessageLinked(LINK_SET,0,"H|"+llDumpList2String(_dump,"/t"),llGetKey()); } else if(llList2String(r,0) == "M") {// Get Song Mono ConfigCardName= llList2String(r,2); ConfigCardName = llGetSubString(ConfigCardName,1,llStringLength(ConfigCardName)); // remove '#' state s_config_single; } else if (llList2String(r,0) == "RESET")llResetScript(); } }
  2. #LearningLSL Suppose : (Both scripts are in single prim) 1. user is in llDialog() menu where she pressed "enter number" button. 2. User entered a number in text box llTextbox(). 3. Got the messag through listen() and I have to convert as well as check if the given string is integer. To do so, my function is placed in another script within same object. 4. I send message through llMessageLinked containing the entered string and I will send an integer too (that is 1); 5.if the second script's link_message() will recived integer 1 with that message then it will call the function toInteger(message); 6. toInteger() will return 0 if the given string contains anything except numbers, else it will return the converted integer num. It send result through llMessageLinked() back to main script. 7. the link_message() event of main script recieve that integer sent by toInteger(). ----------------------------------------- Now how I should proceed further to get this integer back to where I sent it first time through llMessageLinked() in another script to get converted(referring to step 4) . If it is not integer then I wanna pop up llDialog() again which say "Enter Again". my all llDialog() menus are in one script and all functions are in another. (Ps : Firstly, thanks for patient reading. Secondly, I am just learning so please don't suggested how to do it within same script or use a predefined function to check or convert etc etc...)
×
×
  • Create New...