Jump to content

Data processing Notecard with dropped Link-message information causing script failures


You are about to reply to a thread that has been inactive for 61 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

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();
              
    }         
}

 

 

 

 

 

Edited by VirtualKitten
Link to post
Share on other sites
58 minutes ago, VirtualKitten said:

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

you're sending 148 linked messages as a stream, I wonder if you're overrunning the receivers? That's 148 events to be queued up for the scripts in the linkset

"The event queue can hold 64 events."

"Avoid sending link_messages to a target faster than they can be handled. Doing so risks filling the event queue and subsequent messages being silently discarded."


 

 

  • Confused 1
Link to post
Share on other sites

@Profaitchikenz Haiku well thank you but its not sending 148 messages at a time as it is defendant on the slowness of the note cad reader which prevents this speed. Its not slamming this receiver it ques them in groups of four or more  currently four as the link-message is not processing data in a list properly either . I have no clue why it does not do as described adding lists but it inserts the four in one line of the list .In regard to Link-message Que I believe as my data has a throttle it is sending 37 messages  148/4 = 37 if my math's is correct which it should cope with  I reduced this to 3 above which should be 50 messages  148/3 which is 50  as the link message was not processing the list and adding the whole line not parsed into the list line  so it is below your capacity limit as code is regulated by throttle here :

 

 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=[];
                   
        }
Edited by VirtualKitten
added correct reply name
Link to post
Share on other sites

Data is represented in a notecard as

Name= Hello.msu
#Author=
#MenuName=
#Performer=  
#FileLength= 10.0
#LastFileLength= 10.0
#KeyLength= 15.0
#Genre=  New Age
#source= Piano Covers
#Licence= 
#CoverPicture= [KEY HIDDEN]

 

[MONO ACTUALKEY HIDDEN],[LEFT ACTUALKEY HIDDEN],[RIGHT ACTUALKEY HIDDEN],[Number representing BPM]

[MONO ACTUALKEY HIDDEN],[LEFT ACTUALKEY HIDDEN],[RIGHT ACTUALKEY HIDDEN],[Number representing BPM]

[MONO ACTUALKEY HIDDEN],[LEFT ACTUALKEY HIDDEN],[RIGHT ACTUALKEY HIDDEN],[Number representing BPM]

[MONO ACTUALKEY HIDDEN],[LEFT ACTUALKEY HIDDEN],[RIGHT ACTUALKEY HIDDEN],[Number representing BPM]

[MONO ACTUALKEY HIDDEN],[LEFT ACTUALKEY HIDDEN],[RIGHT ACTUALKEY HIDDEN],[Number representing BPM]

[MONO ACTUALKEY HIDDEN],[LEFT ACTUALKEY HIDDEN],[RIGHT ACTUALKEY HIDDEN],[Number representing BPM]

[MONO ACTUALKEY HIDDEN],[LEFT ACTUALKEY HIDDEN],[RIGHT ACTUALKEY HIDDEN],[Number representing BPM]

[MONO ACTUALKEY HIDDEN],[LEFT ACTUALKEY HIDDEN],[RIGHT ACTUALKEY HIDDEN],[Number representing BPM]

[MONO ACTUALKEY HIDDEN],[LEFT ACTUALKEY HIDDEN],[RIGHT ACTUALKEY HIDDEN],[Number representing BPM]

[MONO ACTUALKEY HIDDEN],[LEFT ACTUALKEY HIDDEN],[RIGHT ACTUALKEY HIDDEN],[Number representing BPM]

[MONO ACTUALKEY HIDDEN],[LEFT ACTUALKEY HIDDEN],[RIGHT ACTUALKEY HIDDEN],[Number representing BPM]

[MONO ACTUALKEY HIDDEN],[LEFT ACTUALKEY HIDDEN],[RIGHT ACTUALKEY HIDDEN],[Number representing BPM]

[MONO ACTUALKEY HIDDEN],[LEFT ACTUALKEY HIDDEN],[RIGHT ACTUALKEY HIDDEN],[Number representing BPM]

[MONO ACTUALKEY HIDDEN],[LEFT ACTUALKEY HIDDEN],[RIGHT ACTUALKEY HIDDEN],[Number representing BPM]

[MONO ACTUALKEY HIDDEN],[LEFT ACTUALKEY HIDDEN],[RIGHT ACTUALKEY HIDDEN],[Number representing BPM]

 

It can also be seen from this screen capture below that the List2+=list is not working in fact populating list directly into line x of list2 whole as these should be single keys that are played on sound llPlaySound( as indicated by odd script warning , this is generated by some sort of failure in LSL? I do not know why it does this and can find no reason for this failure:

 

b3e3affb3ab066528f2fe5622c24c1d1.png

Edited by VirtualKitten
I forgot something
Link to post
Share on other sites

I've neither time nor strength to go thru that thing line by line but the overall design seems extremely inefficient. Using a 6-states state machine for reading notecards via the dataserver seems like deploying a rather large cannon to shoot a pretty small bird. From my experience which is considerable in either life, when software is too complex it usually doesn't work well.

  • Like 3
  • Confused 1
Link to post
Share on other sites

Well @Ela Talaj I think something is broken in LSL. Its a very good advanced script I cant claim i wrote ( here http://wiki.secondlife.com/wiki/AdvancedNotecardReader) I just tweaked for my purposes  it from a free public domain published advance script reading model published on wiki.  It worked for two days then quite coming up with useless rubbish so idk am none the wiser xD

 

~~~~~~~~~~~~~~ No point already writing something that is in public domain ~~~~~~~~~~~~~

Edited by VirtualKitten
Link to post
Share on other sites
13 minutes ago, VirtualKitten said:

Well @Ela Talaj I think something is broken in LSL. Its a very good advanced script I cant claim i wrote ( here http://wiki.secondlife.com/wiki/AdvancedNotecardReader) I just tweaked for my purposes  it from a free public domain published advance script reading model published on wiki.  It worked for two days then quite coming up with useless rubbish so idk am none the wiser xD

if it worked and we never touched the script and then it doesn't work with the exact same inputs then best to try it on other regions, more than one other is best

 

 

  • Confused 1
Link to post
Share on other sites

@mollymews I tried in two regions  our private region and a separate clean one specified by the excellent scripting site on LSL The exact same results seems like LSL to me, have you not read what its doing its bizarre!

Link to post
Share on other sites

 

@mollymews,  I informed you it is not adding list to list but inserting the whole part of the second list as a list item. its quite bizarre. The code i quoted below should not do this ! Further more according to @Profaitchikenz Haiku it is not overrunning the receiver which is throttled to four currently . See posts above 

[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; 
         } 

 

19 hours ago, VirtualKitten said:

It can also be seen from this screen capture below that the List2+=list is not working in fact populating list directly into line x of list2 whole as these should be single keys that are played on sound llPlaySound( as indicated by odd script warning , this is generated by some sort of failure in LSL? I do not know why it does this and can find no reason for this failure:

 

b3e3affb3ab066528f2fe5622c24c1d1.png

 

Edited by VirtualKitten
Link to post
Share on other sites
28 minutes ago, VirtualKitten said:

Further more according to @Profaitchikenz Haiku it is not overrunning the receiver which is throttled to four currently

I must disagree, I have said nothing of the kind, my position remains that (unless you have made a minor coding slip somewhere) it is the most likely scenario.

I myself would tackle this problem by scaling down the test harness and doing one, then two, then three items and shrieking out llOwnerSays frequently. As Ela Talaj has said, the script is not an easy one to examine to try and diagnose as a thought-experiment.

As Heisenberg (I think) once said regarding trying to model the universe in one's head "That which did not happen, did not happen. Un-performed tests generate no results"

  • Like 1
Link to post
Share on other sites
1 hour ago, VirtualKitten said:

@mollymews I tried in two regions  our private region and a separate clean one specified by the excellent scripting site on LSL The exact same results seems like LSL to me, have you not read what its doing its bizarre!

the script debug error message "could not find sound" means what it says. The sound asset could not be found by the asset server. This has nothing to do with the script and everything to do with the asset server

so the suggestion to test on more than one region

that the regions that you have tested on all produce the same error means what is said on all regions tested. That the sound asset could not be found

edit: the only time this debug error has anything to do with the script is when an invalid sound asset identifier is passed to the asset server by the script

Edited by Mollymews
Link to post
Share on other sites

Well it just doesn't work like the new 2,.93.2 Blender export to second life with rigging Its so verbose no information anywhere when you get message to many bones in log file xD

 

Its broken period and how can it be code if it worked two days before that is rediculous

Link to post
Share on other sites

I've been in a similar state many years ago, you really have to implement a version control system to get this under control. Each time you make a change to a script, save the version back to inventory with a digit string appended after it, (listener001, listener 002), so when you find it has apparently stopped working but you changed nothing, you can go back through the previous scripts and see which one still works and then use something like Context's compare files to see what exactly you changed in subsequent versions of that script.

I see one other problem here that I myself learned the hard way: it's fun tinkering around with other people's scripts but in the end, it's usually better to start afresh and write your own version rather than try to prod and poke somebody else's code to try and make it fit your particular requirement. Start small, test each bit as you experiment, keep previous versions and note what you changed and why...

  • Like 2
Link to post
Share on other sites
8 hours ago, VirtualKitten said:

Well @Ela Talaj I think something is broken in LSL. Its a very good advanced script I cant claim i wrote ( here http://wiki.secondlife.com/wiki/AdvancedNotecardReader) I just tweaked for my purposes  it from a free public domain published advance script reading model published on wiki.  It worked for two days then quite coming up with useless rubbish so idk am none the wiser xD

 

~~~~~~~~~~~~~~ No point already writing something that is in public domain ~~~~~~~~~~~~~

2007, your concept of good seem very subjective.

20 hours ago, Ela Talaj said:

I've neither time nor strength to go thru that thing line by line but the overall design seems extremely inefficient. Using a 6-states state machine for reading notecards via the dataserver seems like deploying a rather large cannon to shoot a pretty small bird. From my experience which is considerable in either life, when software is too complex it usually doesn't work well.

And that's one of the problems with the script library, it is horrifyingly outdated. LSL and our understanding of it considerably evolved since this script was written.

Hell, the mono compiler became the default in 2008.

Link to post
Share on other sites

To take seriously any suggestion of a new, previously undiscovered bug in LSL, it has to be demonstrated in its absolute minimal form -- usually just a few lines of code that reproduces the precise defect -- not a whole program that works differently now than it did before.

Here, for all this code, we don't even have the lines that actually play sound, so even if we were to wade in, we can't back through it to find the data structure passed into llPlaySound() or llTriggerSound() to examine how it's populated and guess how it's getting four UUIDs strung together with newlines between them as if it were a single sound key.

Link to post
Share on other sites

I think the sound issue can be disregarded for the moment as the stated problem is that the uuids in the link messages resulting from the notecard reads are not getting processed correctly.

Stage 1 therefore ought to be to give it a notecard and closely observe the results of processing that card before sending the details to the receiver.

Stage 2 is then to have a single receiver and send it first one, then 2, then 3, then 4 of these list items and observe what the receiver gets.

In looking back through the code for the receiver I see some rather odd things: two local lists are set up and populated, but then the code looks at the message number and says "Oh, you're -90, I didn't need to do that, bye" and exits. It should be checked first.

Likewise, only the first of the lists needs to be set up before then testing the first element, and if necessary setting an active flag and exiting, so once again the scrub list was populated for no good reason.

Of course neither of those two conditions may happen since this was all designed to be a general purpose system, but in that case why carry all that dead weight around?

Further on in the code a check is made against 65536 to see how much memory remains, so the script is at least mono-aware.

I'm with Ela Talaj on this, the notecard read method is monstrous and should be replaced with a nice simple series of calls to the dataserver for the number of lines followed by each line in turn, which doesn't even need a second state to do it.

Edited by Profaitchikenz Haiku
Link to post
Share on other sites
On 2/27/2021 at 9:40 AM, VirtualKitten said:

list scrub = llParseString2List(llList2String(r,3),["/t"],[""]);

Just stabbing blindly in the dark, but should that perhaps be a backslash-t sequence not a forward-slash-t, i.e kill any tabs? Or are you expecting to have sets of /t seperators in the notecards?

  • Like 1
  • Thanks 1
Link to post
Share on other sites

@Profaitchikenz Haiku Why would this be the case its a valid separator  no its not used in note card just in passing string as am already using  this | to separator and needed something else to use to distinguish. Why do you feel this might cause it to fail  and duplicate all entries into 1 line please? The testing does not get much further than on one file notecard to get to play so i need to get first part repopulating list properly first . I went through acres of testing with this with a friendly person  world they could not help or find an answer either  using debug on readers and on senders find the reason for the error other than the add to list the data that made it it in to link list was formatted correctly and we could not find a reason . We could not identify why the link-message was not arriving infact the use of llSay(0,... to print to the console 0 made the whole thing not work even half as well dropping more messages than it had before.

@Qie Niangao yes the play is in another file its not required as it works elsewhere from same list in previous project.

Link to post
Share on other sites
Posted (edited)

This is what I put in the command file the other testing is commented out in previous script to debug with a person who was testing at same time 

.It was supposed to get a M| , L| ,R| , |B line into it each time data was sent only M|  was received on its own showing that at line 52 of output  (see below) commented line count in data server it was alone and message dropped . If you looked at code you would see commented out debugging above . So all testing has been done  that can be done and this still does not function idk why

link_message(integer sender_num, integer num, string list_argument, key id)
 link_message(integer sender_num, integer num, string list_argument, key id)
    {
         list r = llParseString2List(list_argument, ["|"], [""]);
      
         llSay(0,"Eurika1:"+list_argument);
       
         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") { 
             // llSay(0,"Eurika2:"+list_argument);
               if(llList2String(r,1) =="M") { llSay(0,"Got "+llList2String(r,0)+"|M|"+llDumpList2String(llParseString2List(llList2String(r,3),["/t"],[""]),"|"));_sdm +=llParseString2List(llList2String(r,3),["/t"],[""]);
               } else if(llList2String(r,1) =="L") {
                   llSay(0,"Got "+llList2String(r,0)+" L:"+llDumpList2String(llParseString2List(llList2String(r,3),["/t"],[""]),"|")); _sdm_l+=llParseString2List(llList2String(r,3),["/t"],[""]);
               } else if(llList2String(r,1) =="R") {llSay(0,"Got "+llList2String(r,0)+"|R|"+llDumpList2String(llParseString2List(llList2String(r,3),["/t"],[""]),"|"));_sdm_r+=llParseString2List(llList2String(r,3),["\t"],[""]);
               } else if(llList2String(r,1) =="B") {llSay(0,"Got "+llList2String(r,0)+"|B|"+llDumpList2String(llParseString2List(llList2String(r,3),["/t"],[""]),"|"));_bpm+=llParseString2List(llList2String(r,3),["\t"],[""]);  
               }
            } 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; 
         } 

}

If you enable comment here it puts a line number out at each read in state :

state s_config_single
 dataserver(key query_id, string data) {
         if (query_id == ConfigRequestID) {
           // llSay(0,"line:"+(string)ConfigLineIndex);

Further more : in  this following procedure comments can be removed to enable testing

config_parse(string str, string cardName, integer lineNum)
       /* 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); */

 

 

Edited by VirtualKitten
to add code
Link to post
Share on other sites
2 hours ago, VirtualKitten said:

We could not identify why the link-message was not arriving infact the use of llSay(0,... to print to the console 0 made the whole thing not work even half as well dropping more messages than it had before.

To me, that speaks volumes. Too much queued up, adding anything more just causes even more bottlenecking.

Link to post
Share on other sites
4 hours ago, VirtualKitten said:

@Qie Niangao yes the play is in another file its not required as it works elsewhere from same list in previous project.

Obviously not "from same list" because here it's throwing an error that shows the sound UUID passed into llPlaySound is corrupted with four of them combined, separated by newlines. I'm not suspecting that llPlaySound() is buggy, nor the code immediately around the call, but the data structure that's assumed to contain a single sound UUID clearly does not contain that. I was hoping to figure out why.

1 hour ago, Profaitchikenz Haiku said:

To me, that speaks volumes. Too much queued up, adding anything more just causes even more bottlenecking.

Yeah. A reasonable test might be to sleep a second after every line read from the notecard just to make very sure the last element was processed before the next link_message event is queued. If that works, it's obvious what needs to be done. (And I agree the sound UUID concatenation problem is a different bug in the code and it's wise to work through them one at a time, as there may be many more in waiting.)

4 hours ago, VirtualKitten said:

its a valid separator

As specified in the "[Command] receiver" link_message parse, the separator is a two-character sequence, "/" followed by "t", whereas in the llMessageLinked construction of config_parse and config_done_single the delimiter is a single tab character ("\t"). If that parser gets messages from those particular llMessageLinked calls, they won't be parsed as tab-delimited. (That said, the two-character form appears to be used for both construction and parsing of SEQ_LIB.)

Link to post
Share on other sites
2 hours ago, Profaitchikenz Haiku said:

To me, that speaks volumes. Too much queued up, adding anything more just causes even more bottlenecking.

this is where I would start to debug. Going one step at a time. Start with:

Test 1:

ink_message(integer sender_num, integer num, string list_argument, key id)
{
   // do all the messages in the test data set arrive?
   // say what is received. If some messages are not arriving then the issue is with the transport
   llOwnerSay(llDumpList2String([num, list_argument], ","));
}

Test 2:

parse list_argument to list. OwnerSay memory consumed for every message in test suite data. If memory error then look at data set reductions for solution

 

and so on progressively thru the code

Link to post
Share on other sites

Another wild thought has just occurred to me. The script apparently worked for two days and then stopped working. Did by any chance the notecard that was being fed to the script change? Because although that Notecard reader script is voluminous, I'm sure it can't cope with everything that happens in the universe. It might now be reacting to some quite trivial change in the data that is being supplied to it?

Link to post
Share on other sites
2 hours ago, Qie Niangao said:

(That said, the two-character form appears to be used for both construction and parsing of SEQ_LIB.)

Yes, I finally worked out how to make Opera show me all of the contents of a code box and had a look for myself. I was hoping I'd got lucky.

 

Sometimes I wish everybody had been made to work on 80-character punch-cards or 64-character wide Forth code blocks, they'd know not to let their code march off to the right and get lost to view. A lot of our problems would go away if no script could have more than 16 lines of 64 characters each :)

  • Like 1
Link to post
Share on other sites
You are about to reply to a thread that has been inactive for 61 days.

Please take a moment to consider if this thread is worth bumping.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...