Skip to content
lsl.devlsl.devLSL Dev

Big red button.lsl

// Global Variables
integer active = 0;
integer toAllChannel = -255;                    // general channel - linked message

default
{
    state_entry()
    {
        //on a reset or statup this registration button can be used
        active = 0;
        //set color to avaliable
        llSetColor( <255,0,0>, ALL_SIDES);
        llSetTexture( "busy_anim v5_9", ALL_SIDES);
        llSetTextureAnim( ANIM_ON, ALL_SIDES, 5, 5, 24, 1, 10 );
    }

    touch_start(integer total_number)
    {

           active = 1; 
           llMessageLinked(LINK_ALL_OTHERS, toAllChannel, "ActivateRegistration", NULL_KEY);
           //set color to busy
           llSetColor( <255,255,255>, ALL_SIDES);
           llSetTexture( "busy_anim v5_9", ALL_SIDES);
           llSetTextureAnim( ANIM_ON | LOOP , ALL_SIDES, 5, 5, 0, 23, 10 );
       
    }

///////////////////////////////////////////////////////
//  Link Message of default state                    //
///////////////////////////////////////////////////////   
    link_message(integer sender_number, integer number, string message, key id)
    {
        //if link message is on the correct channel
        if(number == toAllChannel)
        {
            if(llSubStringIndex( message, "ActivateRegistration") != -1)
            {
                llSetTexture( "alpha", ALL_SIDES);
            }
            if(llSubStringIndex( message, "RegistrationComplete") != -1)
            {
              if(active == 1)
              {
                llMessageLinked(LINK_ALL_OTHERS, toAllChannel, "ActivateTest", NULL_KEY);
              }
            }
            if(llSubStringIndex( message, "TestComplete") != -1)
            {
              if(active == 1)
              {
                llMessageLinked(LINK_ALL_OTHERS, toAllChannel, "ActivateReport", NULL_KEY);
            }
            }
            if(llSubStringIndex( message, "ReportComplete") != -1)
            {
                //set color to avaliable
                llSetColor( <255,0,0>, ALL_SIDES);
                llSetTexture( "busy_anim v5_9", ALL_SIDES);
                llSetTextureAnim( ANIM_ON, ALL_SIDES, 5, 5, 24, 1, 10 );
              
            }
            
                    
            if( message == "reset" )
            {
              llResetScript();    
            }
            
        }
        
    } //end of link message
    
}
Original wiki source

Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.

From the Second Life Wiki

Community documentation adapted from Big red button.lsl, by Linden Research, Inc. and contributing residents.View contributors and history.

Imported wiki revision:

Licensed under CC BY-SA 3.0. Last wiki edit: .Formatting and links have been adapted for this site; API metadata follows the LSL definitions.