Dica Rápida…

2007 Setembro 10
by Naryu Yue

Para quem fala inglês e já se frustrou tentando achar alguma coisa útil no portal de LSL da Linden Labs…

… Seus problemas acabaram!!!

Feita por quem já tinha esbarrado no precário conteúdo do portal oficial, a LSL Wiki Net é o melhor lugar para procurar explicações para as funções do LSL. Não espere achar tudo pronto lá, mas diferentemente da oficial a maioria das funções tem exemplos em códigos, o que facilita muito o entendimento delas.

Se sentir-se apto para a tarefa, você ainda pode inscrever-se como colaborador de conteúdo, ou mentor online! Eu me inscrevi como mentora, então a comunidade scripter brasileira já tem a quem procurar se precisar de ajuda!

Para quem quiser saber como encontrar ajuda com scripts in-world: (eu estou nessa lista!)
É só arrastar o script abaixo para algum objeto, e você deverá ver uma lista dos mentores online.

//  Scan for online Scripting Mentors on the main grid.
//  Just drop this script into something
//  by Keknehv Psaltery -- 03/08/06
//  Updated by Results Tiki for two lists -- 07/25/07

// multiple lists are now required because there are too many names for one list
list mentorsOne = [ "AyAn4m1 Flan"      ,"27cd74cb-b591-4913-901c-882325fe63d3",
                    "Catherine Omega"   ,"3e1f44f6-5c4e-afc3-d8d0-361eea82ddb6",
                    "Christopher Omega" ,"3e8a269d-6669-07df-a09d-c38664cbc89d",
                    "CJ Kasei"               ,"aa697b5d-2418-4adb-9eb6-450353aaeb11",
                    "Darkside Eldrich"  ,"8f0ffade-de00-43b5-97fc-544bf07cea40",
                    "Deneria Sholokhov" ,"95d793ff-7a64-4f6d-a224-e48ab26ee32a",
                    "Earle Swenson"     ,"1b7b2686-8fab-46f8-a834-cb9ceb596ce5",
                    "Eloise Pasteur"    ,"5b5585b3-8ae6-4cc8-896b-818e6cfa5ea0",
                    "Electron Electricteeth"   ,"f672e4d8-adf3-4e30-b42b-466a503e42b5",
                    "Escort DeFarge"    ,"61ca7d87-2316-4c98-b3dc-c7e29e4666b7",
                    "Folco Boffin"      ,"f9180a7b-a1a6-4329-a46a-6dd487c0774c",
                    "Fox Diller"        ,"6b21aa6e-7c87-45d5-8deb-da9b6079b837",
                    "Gene Poole"        ,"8a654241-d2bc-429f-8bd4-9ee59892fa03",
                    "Jeffrey Gomez"     ,"529d65f4-fdd9-4b4a-a6ff-08ea62f54936",
                    "Keknehv Psaltery"  ,"f1f2d29a-210b-4b00-96d7-ab16c962a40f",
                    "Kithylin Perth"    ,"d286dfd7-12b6-403b-8b77-3cc316aa89dc",
                    "Kokiri Saarinen"   ,"3acaa17a-f818-49df-b31d-f395d550f14c",
                    "Lance Mirabeau"    ,"0b44e869-7618-4623-a261-81f316af8763",
                    "Leandro Molinaro"  ,"8eb1c12c-4411-4bad-9bad-636047bbcd4b",
                    "LordJason Kiesler" ,"b3e6a03e-5827-4257-aa23-6df63ebd77ff",
                    "Lucca Kitty"       ,"e86bf246-a8e7-47cb-9678-ffc6e9c78dd4",
                    "Marc Eisenberg"    ,"a44770e5-de4f-4ced-a511-1e3002375e4b"];
list mentorsTwo = [ "Max Case"          ,"6d869ee0-e19e-4afa-8431-b85705198a0c",
                    "Naryu Yue"          ,"c0485d19-3464-41a6-80ba-b9221804f643",
                    "Nonnux White"      ,"7499fac7-40b8-4a52-bf89-be1018efdc4c",
                    "Raemus Patel"      ,"aea7eb76-7be0-496b-be09-e84f44b94320",
                    "Results Tiki"      ,"57b5e818-7915-4a9a-9b49-7e355aece930",
                    "Rini Rampal"       ,"fbfcafec-0711-42bb-ac14-e87a4de5f1a1",
                    "Rodrick Harrington","34f88fb4-1c15-4341-833c-b2667c7dcd38",
                    "RyeDin Meiji"      ,"acef5ef9-6420-46a5-a394-62f675061c20",
                    "Si Arcadia"        ,"a55ce1ea-eabb-4011-aa78-9bb547e45828",
                    "Stephen Psaltery"  ,"4b091519-3cc1-4ac8-a1d6-f1039c7f74c6",
                    "Sirlor Stonecutter","2b17e3bf-d1d5-4835-bb51-d50c9f1f9252",
                    "Stone Mason"       ,"e8ac4315-5625-41cb-ae28-444fc3846ab8",
                    "Strife Onizuka"    ,"4275d408-da94-4f68-8353-090fb2dfc020",
                    "Trimda Hedges"     ,"0cd7918d-dd20-46cc-a168-d5669ca197e8",
                    "Velox Severine"    ,"cf2301ee-4b44-4bfe-8f29-8cfe85fd94ef",
                    "Vicero Lambert"    ,"744efd47-086e-4d52-bce8-38f6584c3df7",
                    "Wufuzz Carnot"     ,"cf807cce-ad6f-42c2-93da-fcbe4db35651",
                    "Yohan Althouse"    ,"872a8c40-eed8-496f-9705-6441a7a99070",
                    "Zarf Vantongerloo" ,"734300d5-8fbd-465d-9c1a-1948ca8f933e"];

key dataKey;
integer currentMentor;
integer lengthOne; // for convenience.
integer numberMentors;
float startTime;

list onlineMentors;
float percentDone;

beginScan()
{
    onlineMentors = [];
    currentMentor = 0; // zero based
    lengthOne = llGetListLength( mentorsOne ) / 2;      // strided
    numberMentors = lengthOne + llGetListLength(mentorsTwo) / 2;
    startTime = llGetTime();
    dataKey = llRequestAgentData( (key)llList2String(mentorsOne, currentMentor*2 +1), // +1 for key
                                    DATA_ONLINE );
}

default
{
    on_rez( integer sparam )
    {
        llResetScript();
    }

    state_entry()
    {
        beginScan();
    }

    touch_start( integer num )
    {
        beginScan();
    }

    dataserver( key query, string data )
    {
        if ( query == dataKey )
        {
            //if (currentMentor < lengthOne)
            //    llSay(0, "number "+ (string)currentMentor +" data "+ (string)data +" mentor "+
            //          llList2String(mentorsOne, currentMentor*2)); // strided
            //else
            //    llSay(0, "number "+ (string)currentMentor +" data "+ (string)data +" mentor "+
            //          llList2String(mentorsTwo,(currentMentor - lengthOne)* 2));

            if ( (integer)data )    //Are they online?
            {
                if (currentMentor < lengthOne)
                    onlineMentors += [llList2String(mentorsOne, currentMentor*2)]; // strided
                else
                    onlineMentors += [llList2String(mentorsTwo,(currentMentor - lengthOne)* 2)];
            }

            ++currentMentor;

            percentDone = (float)currentMentor / numberMentors;

            //This next line is ugly. Beware!

            string remainingSeconds = llGetSubString((string)((llGetTime()-startTime)/(percentDone)*(1-percentDone)),0,3);
            llSetText( "Scanning for online scripting mentorsn Currently " +
                        (string)currentMentor +"/"+ (string)numberMentors + " -- " +
                        llGetSubString((string)(percentDone*100),0,3) +
                        " percent completen" + remainingSeconds +
                        " seconds remainingn Online:n " + llDumpList2String( onlineMentors , "n" )
                        , <1.01-percentDone,percentDone,0.0>, percentDone + .4);

            if ( currentMentor < numberMentors )
            {
                if (currentMentor < lengthOne)
                    dataKey = llRequestAgentData( (key)llList2String(mentorsOne,currentMentor*2 + 1),
                                                DATA_ONLINE ); // key from strided
                else
                    dataKey = llRequestAgentData( (key)llList2String(mentorsTwo,
                                                                    (currentMentor - lengthOne) * 2 + 1),
                                                DATA_ONLINE );
            }
            else
            {
                llSetText( "Scan Time: " + llGetSubString((string)((llGetTime()-startTime)),0,3) +
                            " secondsnScripting Mentors Online:n" + llDumpList2String( onlineMentors , "n" )
                            ,<0.2,1.0,0.2>,1 );
                integer nOnline = llGetListLength( onlineMentors );

                if (( nOnline > 1 ) && (nOnline != 2))  // most common case
                    llOwnerSay("There are " + (string)nOnline + " scripting mentors online: "+
                                llDumpList2String(
                                    llList2List(onlineMentors,0,nOnline - 2), ", " )
                                + ", and " + llList2String( onlineMentors, nOnline - 1) );
                else if ( nOnline == 1 )
                    llOwnerSay("Only one scripting mentor is online, "
                                + llList2String(onlineMentors, 0 ));
                else if (nOnline == 2)
                    llOwnerSay("There are " + (string)nOnline + " scripting mentors online: "+
                                llDumpList2String(
                                    llList2List(onlineMentors,0,nOnline - 2), ", " )
                                + " and " + llList2String( onlineMentors, nOnline - 1) );
                else
                    llOwnerSay("Uh-oh, no scripting mentors are online! Try again later.");
            }
        }
    }
}
Não ha comentários

Deixe uma resposta

Note: You can use basic XHTML in your comments. Your email address will never be published.

Assine o feed destes comentários via RSS