Don't click here unless you want to be banned.

LSL Wiki : LibrarySettingsNotecard

HomePage :: PageIndex :: RecentChanges :: RecentlyCommented :: UserSettings :: You are crawl338.us.archive.org
// SampleSettingsReader.lsl
// Written by Konigmann Lippmann
// Thanks to Apotheus Silverman for his MultiItem Vendor...
// It seems like everything I write is based on it in one way or another.


// Default values
integer iShowHoverText = TRUE;
string sHoverTextValue = "No Settings?";
vector vColor = <1.0,0.0,0.0>;


// Globals
integer iNotecardIndex;
integer iNotecardCount;
integer iNoteCardLine;
key kCurrentDataRequest;
string sSettingsNotecard;


integer StringLeftICompare( string sLeftMatch, string sLongString )
{
    integer iLength;

    iLength = llStringLength( sLeftMatch ) - 1;
    if( llToLower(llGetSubString( sLongString, 0, iLength ) ) == llToLower(sLeftMatch) )
        return( TRUE );
    return( FALSE );
}


string GetValue( string sString )
{
    integer iStart;
    string sValue = "";
    string sbValue = "";

    iStart = llSubStringIndex( sString, "=" ) + 1;
    if( iStart )
    {
        sValue = llGetSubString( sString, iStart, llStringLength(sString) - 1 );
        if( sValue )
        {
            sbValue = llToLower( sValue );
            if( sbValue == "true" )
                sValue = "1";
            if( sbValue == "false" )
                sValue = "0";
            return( sValue );
        }
    }
    return( NULL_KEY );
}


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

    state_entry()
    {
        integer iii;
    
        llSetText( "Initializing...", <0,0.5,0>, 1.0 );

        iNotecardCount = llGetInventoryNumber( INVENTORY_NOTECARD );
        iNotecardIndex = 0;
        if( iNotecardCount > iNotecardIndex )
        {
            sSettingsNotecard = llGetInventoryName( INVENTORY_NOTECARD, iNotecardIndex );
            iNoteCardLine = 0;
            kCurrentDataRequest = llGetNotecardLine( sSettingsNotecard, iNoteCardLine );
            iNotecardIndex++;
        }
        if( iNotecardIndex == 0 )
        {
            llWhisper( 0, "Using Default Values." );
            state run_object;
        }
    }

    dataserver( key kQuery, string sData )
    {
        list lSetting;

        kCurrentDataRequest = "";
        if( sData != EOF )
        {
            // you can string several of these tests for whatever values you may want.

            if( StringLeftICompare( "ShowHoverText=", sData ) )
                iShowHoverText = (integer)GetValue( sData );

            else if( StringLeftICompare( "HoverTextValue=", sData ) )
                sHoverTextValue = (string)GetValue( sData );

            else if( StringLeftICompare( "Color=", sData ) )
                vColor = (vector)GetValue( sData );

            kCurrentDataRequest = llGetNotecardLine( sSettingsNotecard, ++iNoteCardLine );
        }
        else
        {
            iNotecardIndex++;
            if( iNotecardIndex < llGetInventoryNumber( INVENTORY_NOTECARD ) )
            {
                sSettingsNotecard = llGetInventoryName( INVENTORY_NOTECARD, iNotecardIndex );

                iNoteCardLine = 0;
                llGetNotecardLine( sSettingsNotecard, iNoteCardLine );
            }
            else
            {
                state run_object;
            }
        }
    }
}


// This is where your actual code would go
state run_object
{
    state_entry()
    {
        if( TRUE == iShowHoverText )
            llSetText( sHoverTextValue, vColor, 1.0 );
        else
            llSetText( "", <0,0,0>, 0.0 );
    }
}

Here is a sample notecard

ShowHoverText=True
HoverTextValue=It has worked!
Color=<1.0,1.0,1.0>


Jasa SEO Murah Jasa SEO Jasa Google Adwords Jasa Adwords Google Adwords Sepatu Safety Sepatu Futsal Cheapes Hostgator Coupon Link Booking Televisori offerte Notebook Offerte Govr Edo Ziedo Portatile Apple RDAnet Lorks Karikatur Bisnis Modal Kecil Bisnis UKM Berita Terbaru Iklan Baris Jasa SEO Murah SEO Indonesia Konsultan SEO SEO Belajar SEO Penumbuh Rambut Kursus SEO Jam Tangan Casio Grosir Baju Bisnis Online Kerupuk Kulit Social Bookmark Kumpulan Puisi WBC Wonogiri Penumbuh Rambut Jam Tangan Murah Jam Tangan Murah Jam Tangan Casio Penumbuh Rambut Kerupuk Kulit Alat Kantor Laku.com Belanja Online Grosir Eceran Murah dan Aman Jasa SEO Model Jilbab Fine Tableware Permanent Hair Removal island investment development professional makeup artist bali private villa sewa mobil jakarta murah Jual rumah Jakarta Contact Lens Technology
There are 4 comments on this page. [Display comments/form]