Difference between revisions of "User:Gordon Wendt/testbed"

From Second Life Wiki
Jump to navigation Jump to search
(warning banner)
Line 13: Line 13:
__TOC__
__TOC__


== Online/offline watcher ==
<lsl>
<lsl>
// key entries prefixed with "k" denote keys of target avatars
// key entries prefixed with "k" denote keys of target avatars
// string entries prefixed with "i" denote status of the avatar in numerical format
// string entries prefixed with "i" denote status of the avatar in numerical format
Line 55: Line 55:
string e4;
string e4;
string e5;
string e5;
integer time = 10; // update time


default
default
Line 80: Line 82:
         llSetText("",<1,0,0>,1.0);
         llSetText("",<1,0,0>,1.0);
          
          
        llSetTimerEvent(time);
    }
       
    timer()
    {
         q1 = llRequestAgentData(k1,DATA_ONLINE);
         q1 = llRequestAgentData(k1,DATA_ONLINE);
         q2 = llRequestAgentData(k2,DATA_ONLINE);
         q2 = llRequestAgentData(k2,DATA_ONLINE);
Line 95: Line 102:
             if (i1 == "0")
             if (i1 == "0")
             {
             {
                llOwnerSay("offline");
                 s1 = "Offline";   
                 s1 = "Offline";   
             }
             }
Line 104: Line 112:
         }
         }
          
          
                if ( q2 == queryid)
        if ( q2 == queryid)
         {
         {
             i2 = data;
             i2 = data;
Line 119: Line 127:
         }
         }
          
          
                if ( q3 == queryid)
        if ( q3 == queryid)
         {
         {
             i3 = data;
             i3 = data;
              
              
             if (i3 = "0")
             if (i3 == "0")
             {
             {
                 s3 == "Offline";   
                 s3 == "Offline";   
Line 134: Line 142:
         }
         }
          
          
                if ( q4 == queryid)
        if ( q4 == queryid)
         {
         {
             i4 = data;
             i4 = data;
Line 149: Line 157:
         }
         }
          
          
                if ( q5 == queryid)
        if ( q5 == queryid)
         {
         {
             i5 = data;
             i5 = data;

Revision as of 15:25, 8 June 2008


Emblem-important-yellow.png Warning
The scripts or code snippets on this page are non functional at best and can be extremely harmful at worst, use at your own risk and only if you understand their coding and/or function


<lsl>

// key entries prefixed with "k" denote keys of target avatars // string entries prefixed with "i" denote status of the avatar in numerical format // string entries prefixed with "s" denote status of the avatar in online/offline format // key entries prefixed with "q" denote query ids

// string entried prefexed with "e" denote display entries // string entries prefixed with "kn" denote names of target avs

key k1; string kn1; string i1; string s1; key k2; string kn2; string i2; string s2; key k3; string kn3; string i3; string s3; key k4; string kn4; string i4; string s4; key k5; string kn5; string i5; string s5;

key q1; key q2; key q3; key q4; key q5;

string e1; string e2; string e3; string e4; string e5;

integer time = 10; // update time

default {

   state_entry()
   {
       // for each k key entery the kn entry needs to be filled out with ther person's name
       
       k1 = "329c7663-df5d-40b7-ba60-ba396b9bac8b"; // Gordon Wendt
       kn1 = "Gordon Wendt";
       k2 = "4275d408-da94-4f68-8353-090fb2dfc020"; // Strife Onizuka
       kn2 = "Strife Onizuka";
       k3 = "02da98ac-3e2e-4e8f-bedc-d0e2a1c670b4"; // Prokofy Neva
       kn3 = "Prokofy Neva";
       k4 = "244195d6-c9b7-4fd6-9229-c3a8b2e60e81"; // M Linden         -- Can hide status
       kn4 = "M Linden";
       k5 = "a98f2541-04e3-46b2-b038-f82d8cf86f3f"; // Torley Linden    -- Can hide status
       kn4 = "Torley Linden";
       
       
       llSetText("",<1,0,0>,1.0);
       
       llSetTimerEvent(time);
   }
       
   timer()
   {
       q1 = llRequestAgentData(k1,DATA_ONLINE);
       q2 = llRequestAgentData(k2,DATA_ONLINE);
       q3 = llRequestAgentData(k3,DATA_ONLINE);
       q4 = llRequestAgentData(k4,DATA_ONLINE);
       q5 = llRequestAgentData(k5,DATA_ONLINE);
   }
   dataserver(key queryid, string data)
   {
       if ( q1 == queryid)
       {
           i1 = data;
           
           if (i1 == "0")
           {
               llOwnerSay("offline");
               s1 = "Offline";   
           }
           
           if (i1 == "1");
           {
               s1 = "Online";   
           }
       }
       
       if ( q2 == queryid)
       {
           i2 = data;
           
           if (i2 == "0")
           {
               s2 = "Offline";   
           }
           
           if (i2 == "1");
           {
               s2 = "Online";   
           }
       }
       
       if ( q3 == queryid)
       {
           i3 = data;
           
           if (i3 == "0")
           {
               s3 == "Offline";   
           }
           
           if (i3 == "1");
           {
               s3 = "Online";   
           }
       }
       
       if ( q4 == queryid)
       {
           i4 = data;
           
           if (i4 == "0")
           {
               s4 = "Offline";   
           }
           
           if (i4 == "1");
           {
               s4 = "Online";   
           }
       }
       
       if ( q5 == queryid)
       {
           i5 = data;
           
           if (i5 == "0")
           {
               s5 = "Offline";   
           }
           
           if (i5 == "1");
           {
               s5 = "Online";   
           }
       }
       
       e1 = kn1 + " is " + s1 ;
       e2 = kn2 + " is " + s2 ;
       e3 = kn3 + " is " + s3 ;
       e4 = kn4 + " is " + s4 ;
       e5 = kn5 + " is " + s5 ;
   
       if (i1 != "")
       {
           if (i2 != "")
           {
                       if (i3 != "")
                       {
                                   if (i4 != "")
                                   {
                                       if (i5 != "")
                                       {
                                           llSetText(e1 + "\n" + e2 + "\n" + e3 + "\n" + e4 + "\n" + e5,<1,0,0>,1.0);
                                       }
                                   }
                       }
           }
       }
   
   }

} </lsl>