jOpenSimWorld

Grid Status: Online
Total Regions: 23
Visitors (30 Days): 9
Total Residents: 490
Online Now: 0
Hypergriders online: 0

Working on a solution to manage your grid outside

12 years 4 months ago - 12 years 4 months ago #1343 by DJ Devil
Ok we all know this, we are on a other grid like for example Second Life/OsGrid or any other, we get a message one of the sims is messing up but the terminal region restart likes to throw error messages and after it doesnt works as expected, what now?

Right now i am working on a Terminal that Reads the Grid Stats from thr JopenSim Splash Page and is able to restart regions, unfortunatly i am not that god in reading from notecard sso my question is:

lets assume i have a notecard in this format
//Regions list
|Region UUID|Region Name|
|Region UUID|Region Name|

how do i get the region name to display in a menu and when clicked uses the according uuid?
Of Course this is in LSL.
any help is appreciated

Please Log in or Create an account to join the conversation.

12 years 4 months ago #1351 by loralai
Hey DJ,

I am not good at Notecard reading either but I was able to piece something together for you to use. You will need to apply some modifications to your menu reader to get only the region name but this should work for you.
key GET_LINES;
key GET_LINE;
//Notecard data
string file = "regions";
integer currentLine;
integer totalLines;
list regions = [];
list spacers = ["  "];
list separators = ["|"];
default
{
    state_entry()
    {
        GET_LINES = llGetNumberOfNotecardLines(file);
    }

    dataserver(key query_id, string data)
    {
        if(query_id == GET_LINES)
        {
            llOwnerSay(data + " lines in this notecard");
            totalLines = (integer)data;
            if(totalLines > 0)
            {
                currentLine = 0;
                GET_LINE = llGetNotecardLine(file, currentLine);
            }    
        }
        else
        if(query_id == GET_LINE)
        {
           integer length = llGetListLength(regions);
           if(length < 1)
           {
               regions = llParseString2List(data, separators, spacers);
           }
           else
           {
               string dump = llDumpList2String(regions, llList2String(separators, 0));
               string newlist = dump +"|"+data;
               regions = llParseString2List(newlist, separators, spacers);
           }
            currentLine += 1;
            if(currentLine < totalLines)
            {
               GET_LINE = llGetNotecardLine(file, currentLine);
            }
            else
            {
                llOwnerSay("End Of NoteCard");
                string stuff = llDumpList2String(regions, llList2String(separators, 0));
                llOwnerSay(stuff);
            }    
        }    
    }
}

Please Log in or Create an account to join the conversation.

Time to create page: 0.068 seconds