GetUsersGrps

From SLIS Second Life Wiki
Jump to: navigation, search
Back to Sloodle API


Function: getUsersGrps
Description: Returns a list of groups a user is a member of in the course. }
llMessageLinked(LINK_SET, PLUGIN_CHANNEL, "plugin:lessons,function:getUsersGrps\nSLOODLEID:null\n\nUSERNAME:"+ llDetectedName(0)+ "|USERUUID:"+(string) llDetectedKey(0)", NULL_KEY);
Parameters:
SLOODLE_ID:null this is left as null because we aren't accessing a specific activity
USERNAME: The name of the user we are getting groups for
USERUUID: The UUID of the user we are getting groups for


Output: GetUsersGrps.jpg


Example Script:
 	 /*********************************************
*  Copyright (c) 2009 Paul Preibisch
*  Released under the GNU GPL 3.0
*  This script can be used in your scripts, but you must include this copyright header as per the GPL Licence
*  For more information about GPL 3.0 - see: http://www.gnu.org/copyleft/gpl.html
* 
*
*  This script is part of the SLOODLE Project see http://sloodle.org
*
*  Copyright:
*  Paul G. Preibisch (Fire Centaur in SL)
*  fire@b3dMultiTech.com  
*
* API DEMO OBJECT
* getUsersGrps.lsl 
* 
* PURPOSE
*  This script is part of the SLOODLE HQ.
*  
/**********************************************************************************************/
key owner;
// *************************************************** HOVER TEXT VARIABLES
integer DISPLAY_DATA                                                        =-774477; //every time the display is updated, data goes  on this channel
integer PLUGIN_RESPONSE_CHANNEL                                =998822; //sloodle_api.lsl responses
integer PLUGIN_CHANNEL                                                    =998821;//sloodle_api requests
integer SLOODLE_CHANNEL_TRANSLATION_REQUEST     = -1928374651;//translation channel
integer SLOODLE_CHANNEL_TRANSLATION_RESPONSE     = -1928374652;//translation channel
integer SLOODLE_CHANNEL_OBJECT_DIALOG                     = -3857343;//configuration channel

/***********************************************
*  s()  used so that sending of linked messages is more readable by humans.  Ie: instead of sending a linked message as
*  GETDATA|50091bcd-d86d-3749-c8a2-055842b33484 
*  Context is added instead: COMMAND:GETDATA|PLAYERUUID:50091bcd-d86d-3749-c8a2-055842b33484
*  All this function does is strip off the text before the ":" char and return a string
***********************************************/
string s (string ss){
    return llList2String(llParseString2List(ss, [":"], []),1);
}


/* &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
*
*  default state
*  In this state we wait until the rest of the scripts in this object init
*
* &&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& */
 
default
{
    state_entry()
    {
        
    }

    touch_start(integer total_number)
     {
       llMessageLinked(LINK_SET, PLUGIN_CHANNEL, "plugin:groups,function:getUsersGrps\nSLOODLEID:null\nUSERNAME:"+llDetectedName(0)+"|USERUUID:"+(string)llDetectedKey(0), NULL_KEY);
    }
    link_message(integer sender_num, integer channel, string str, key id) {
        llSay(0,str);
    }
}




Personal tools