Jump to content

How can I read the saved data in the LIST variable from script?


Jerilyn Acajou
 Share

Recommended Posts

Hi ,

        I have a script that save text message as list,  as I know , list variable have no limit length until we run out of memory?  the point is I show all text message in the list with  
llSay(0, llDumpList2String(messageList,","));  

the message in local chat can be displayed only first 255 characters but not the rest.

I stuck with this problem since I want to read all message in my list without edit or reset the script. Because the message in the list is saved in the script memory and I can put it to my inventory and put back to the land and read it.

is there a way to open up script and read the saved data in the List variable (debug or something) without reset the script ( usually script will be reset after edit)  coz I don't wanna lose those message that saved in the List variable.

 

Thank 

Link to comment
Share on other sites

35 minutes ago, Jerilyn Acajou said:

Hi ,

        I have a script that save text message as list,  as I know , list variable have no limit length until we run out of memory?  the point is I show all text message in the list with  
llSay(0, llDumpList2String(messageList,","));  

the message in local chat can be displayed only first 255 characters but not the rest.

I stuck with this problem since I want to read all message in my list without edit or reset the script. Because the message in the list is saved in the script memory and I can put it to my inventory and put back to the land and read it.

is there a way to open up script and read the saved data in the List variable (debug or something) without reset the script ( usually script will be reset after edit)  coz I don't wanna lose those message that saved in the List variable.

 

Thank 

The 255 character limit is a limit on the public chat channel (in fact, all positive chat channels, negative have a limit of 1024) - so your script is reading the entire list, but the message is being clipped when printing to chat. (You can get around this by sending the list to chat in blocks)

Link to comment
Share on other sites

1 minute ago, Jenna Huntsman said:

The 255 character limit is a limit on the public chat channel (in fact, all positive chat channels, negative have a limit of 1024) - so your script is reading the entire list, but the message is being clipped when printing to chat. (You can get around this by sending the list to chat in blocks)

Thank Jenna,    the point is I have some important messages in the LIST,  and it will be deleted if I edit or reset script.  I know those messages still be there in that LIST Variable, but I just can't display them all without edit script.  

Is there anyway to view those the data in the script variable ?  Viewer advance mode? Script Debugger? or anything else. 

Link to comment
Share on other sites

It depends. You can send the list to chat in blocks (i.e. send entries 1 through 10 in one chat message, 11 - 20 in another, etc.), or, if the message is just variants of a sentence (e.g. (avatar) hits the deck at high speed, (avatar) faceplants at high speed) then you can get away with only storing the variable portion of the sentence (e.g. hits the deck or faceplants) and then adding the remainder of the sentence afterwards, and if you need to print that all at once, use a for loop in connection with llGetListLength

Link to comment
Share on other sites

Just now, Jenna Huntsman said:

It depends. You can send the list to chat in blocks (i.e. send entries 1 through 10 in one chat message, 11 - 20 in another, etc.), or, if the message is just variants of a sentence (e.g. (avatar) hits the deck at high speed, (avatar) faceplants at high speed) then you can get away with only storing the variable portion of the sentence (e.g. hits the deck or faceplants) and then adding the remainder of the sentence afterwards, and if you need to print that all at once, use a for loop in connection with llGetListLength

thank Jenna,  I understand , I can edit script to read and show the list one by one in local chat.  The point is if I edit and run the script, the data in that list will also be deleted forever.  it means that I have to find the way to read data in that list variable without reset the script.  This is the point. 
 

Remark: Script is in a box.  I can put back this box and the inventory  and rezz it later,  after rezzing,  I can click and the box show saved messages on local chat.  it's like data never lost and keep in the script.  but editing and resetting script will clear all data in the script. 

Link to comment
Share on other sites

4 minutes ago, Jerilyn Acajou said:

way to read data in that list variable without reset the script.

You can't. Unless the script prints the chat with a different method (i.e. the script also sends the list over a link message)  then that data will always be inaccessible (Only LL would be able to manually retrieve the variables stored within a running script, and even then I don't think I've ever heard of them doing so)

Link to comment
Share on other sites

sorry is no way to read script data other than with a method already coded in the script

if there is a way then it would be a debugger running on the server, which only Linden could access assuming there was one 

edit: What Jenna said

Edited by Mollymews
Link to comment
Share on other sites

9 hours ago, Jerilyn Acajou said:

Thank Jenna,    the point is I have some important messages in the LIST,  and it will be deleted if I edit or reset script.  I know those messages still be there in that LIST Variable, but I just can't display them all without edit script.  

The main issue you're hinting at is "permanent storage." which is severely limited with LSL. The easiest blocks of more-or-less-permanent storage to read and write are the name and description of the prims in a linkset, which are 63 and 127 bytes respectively. Next would be the PRIM_TEXT (floating letters on a prim) which have 254 bytes, but I've heard tell that it's not 100% reliable as permanent storage.

aside from those options and a few weird things that might store you a byte or two, your best bet is using an experience's Key-Value-Pair database (for which you need to be premium, or have a good premium friend) or having your own external server to communicate with.

Link to comment
Share on other sites

Reading any number of elements from a list can be done with a loop

(make sure that the elements are not longer than 255 characters before adding them to the list):


        list myList = ["255", "255", "255"];
        integer length = llGetListLength(myList);
        integer i=0;
        for(i; i<length; ++i)
        {
            llOwnerSay(llList2String(myList, i));
        }

llSay: anybody around you can see the text poured into chat.

llOwnerSay: only you can see the text.

if you want to read the elements line by line every touch shows the next line and starts over again if end of list is reached:

integer counter = 0;
list myList = ["251", "252", "253", "254"];
        
default
{
    touch_start(integer n)
    {
        integer length = llGetListLength(myList);
        llOwnerSay(llList2String(myList, counter));
        counter++;
        if(counter == length) 
        {
            counter = 0;
        }
    }

}

Link to comment
Share on other sites

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
 Share

×
×
  • Create New...