Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //
- //##############################################################################
- //
- // Get Avatars Online Status
- // Listens on channel 6 for a name to be entered, then reports that av's online status
- //
- // Dorex Delicioso 2023
- //
- // YouTube: https://www.youtube.com/@SecondLifeSimplyScripting
- // Marketplace: https://marketplace.secondlife.com/stores/173632
- //
- //##############################################################################
- integer DODEBUG = TRUE;
- // ############################## CONSTANTS ####################################
- // ############################## VARIABLES ####################################
- key avatarId;
- key name_key_query;
- key status_request;
- // ############################## FUNCTIONS ####################################
- init(){
- llListen(6, "", llGetOwner(), "");
- }
- // ############################## DEBUG FUNCTIONS ##############################
- sayDebug(string text){ if (DODEBUG) llOwnerSay(text);}
- // ############################## DEFAULT STATE ##############################
- // ############################## DEFAULT STATE ##############################
- // ############################## DEFAULT STATE ##############################
- default
- {
- on_rez(integer start) {
- init();
- }
- state_entry()
- {
- init();
- }
- dataserver(key queryid, string data)
- {
- if ( name_key_query == queryid )
- {
- status_request = llRequestAgentData((key)data, DATA_ONLINE);
- } else if (queryid == status_request){
- if ((integer)data == 0){
- llOwnerSay("Offline");
- } else {
- llOwnerSay("Online");
- }
- }
- }
- listen(integer channel, string name, key id, string message)
- {
- if (channel == 6){
- name_key_query = llRequestUserKey(message);
- }
- }
- timer()
- {
- }
- changed(integer change)
- {
- if(change & (CHANGED_OWNER | CHANGED_INVENTORY))
- llResetScript();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement