//----------------------------
//Profile Pic 3.6
//----------------------------
//Original script by Dan Banner
//----------------------------
// Modified by Oddball Otoole August 6, 2011
// Added a sensor.
//----------------------------
// This program is free software; you can redistribute it and/or modify it.
// License information must be included in any script you give out or use.
// This script is licensed under the Creative Commons Attribution-Share Alike 3.0 License
// from http://creativecommons.org/licenses/by-sa/3.0 unless licenses are
// included in the script or comments by the original author,in which case
// the authors license must be followed.


//-------------------------------------
//Global Variables
key profilepic;
key http;
integer displayFace = ALL_SIDES;
key agent;
string URL="http://islandoasisgrid.biz:8020/ioprofilepic/getprofilepic.php?uuid="; // Here is where we get the actual pic UUID from.

//-------------------------------------


// Main Program
default
{
    on_rez(integer start_param)
    {
        // Restarts the script every time the object is rezzed
        llResetScript(); 
    }


    touch_start(integer total_number)
    {
        agent = llDetectedKey(0);
        http=llHTTPRequest(URL+agent, [] ,"");
    }
    
    
    http_response(key id,integer status, list meta, string body)
    {
        if(http==id)
        {
            profilepic = body;
            llSetTexture(profilepic, ALL_SIDES); //Set texture on prim - ALL SIDES
        }
    }
  
}