Timer Example

Expired

// Code for Step 20 Poster
 
// The timer event, which randomly changes the background colour of the poster, is called once every second. After 10 seconds (colour changes) the poster is reset to it's initial state.
 
integer count;
 
default
{
   state_entry()
   {
       llSetTimerEvent( 0 ); //disable timer
       llSetColor( <1 ,1,1> , ALL_SIDES          );
 
   }
 
   touch_start(integer total_number)
  {
 
       count = 0;      // zero count
       llSetTimerEvent( 1 ); //enable one second timer event
  }
 
  timer ()  // run this code every time the timer event is raised
  {
      count ++;     //increment count
      llSetColor(,ALL_SIDES); //set new random colour every second
      if(count > 10) // reset after 10 secs
      {
         llResetScript();
      }
  }
}
 
// End of code

 

llBase64ToString

Expired

default
{
    state_entry()
    {
        llSetText("llBase64ToString test.\nClick to convert a base64 string back to a readable string.", <1 ,1,1>, 1.0);
    }
 
    touch_start(integer total_number)
    {
        string input = "VG8gc3RvcCBsZWFybmluZyBpcyB0byBzdG9wIGJlaW5nLg==";
        llSay(0, "Input: " + input);
        llSay(0, "Output: " + llBase64ToString(input));
    }
}

 

llBase64ToInteger

Expired

default
{
    state_entry()
    {
        llSetText("llBase64ToInteger test.\nClick to convert a base64 string to an integer.", <1 ,1,1>, 1.0);
    }
 
    touch_start(integer total_number)
    {
        string base64 = "1F5S9Q==";
        llSay(0, "Input: " + base64);
        llSay(0, "Output: " + (string)llBase64ToInteger(base64));
    }
}

 

llStringToBase64

Expired

default
{
    state_entry()
    {
        llSetText("llStringToBase64 test.\nClick to convert a string to base64.", <1 ,1,1>, 1.0);
    }
 
    touch_start(integer total_number)
    {
        string input = "You and your silly pies! o:";
        llSay(0, "Input: " + input);
        llSay(0, "Output: " + llStringToBase64(input));
    }
}