Difference between revisions of "Online Indicator"

From Second Life Wiki
Jump to: navigation, search
m
m
Line 82: Line 82:
 
     http_response(key request_id,integer status, list metadata, string body)
 
     http_response(key request_id,integer status, list metadata, string body)
 
     {  
 
     {  
         if (llSubStringIndex(body, "profile image") == 1)
+
         if (llSubStringIndex(body, "blank.jpg") == -1)
 
         {
 
         {
             if (llSubStringIndex(body, "blank.jpg") == -1)
+
             integer start_UUID = llSubStringIndex(body,"<img alt=\"profile image\" src=\"http://secondlife.com/app/image/") + llStringLength("<img alt=\"profile image\" src=\"http://secondlife.com/app/image/");
                {   
+
            integer end_UUID = llSubStringIndex(body,"\" class=\"parcelimg\" />") - 3;
                    integer start_UUID = llSubStringIndex(body,"<img alt=\"profile image\" src=\"http://secondlife.com/app/image/") + llStringLength("<img alt=\"profile image\" src=\"http://secondlife.com/app/image/");
+
            string profile_pic = llGetSubString(body, start_UUID, end_UUID);
                    integer end_UUID = llSubStringIndex(body,"\" class=\"parcelimg\" />") - 3;
+
 
                    string profile_pic = llGetSubString(body, start_UUID, end_UUID);
+
            llSetTexture((key)profile_pic, ALL_SIDES);
                    llSetTexture((key)profile_pic, ALL_SIDES);
+
                }
+
            else
+
                {
+
                    llSetTexture(blank, ALL_SIDES);
+
                }
+
 
         }
 
         }
 
         else
 
         else
Line 101: Line 95:
 
         }
 
         }
 
     }
 
     }
 +
    dataserver(key queryid, string data)
 +
    {
 +
        if ( data == "1" )
 +
        {
 +
            status = " is online";
 +
 +
            llSetText(name + status, <0,1,0>, 1.0);
 +
        }
 +
        else if (data == "0")
 +
        {
 +
            status = " is offline";
 +
 +
            llSetText(name + status, <1,0,0>, 1.0);
 +
        }
 +
 +
    }
 +
    touch_start(integer num_detected)
 +
    {
 +
        toucher = llDetectedKey(0);
 +
        state msg;
 +
    }
 +
}
 
     dataserver(key queryid, string data)
 
     dataserver(key queryid, string data)
 
     {
 
     {

Revision as of 08:57, 7 May 2009

Copying Permission

Copyright © 2008 by Kristy Fanshaw

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

To get a copy of the GNU General Public License, see <http://www.gnu.org/licenses/>.

Online Indicator