Jump to content

RLV Commander and Snooper


Quistess Alpha
 Share

You are about to reply to a thread that has been inactive for 461 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Sometimes applying arbitrary RLV via the RLV Relay protocol can be fun when done responsibly:

integer gChannel_Owner=36; // channel for owner to hud talk.
integer gChannel_Other=37;
string gTarget = NULL_KEY;
list gAttachKeys = [];
string gCommand = "GrieferHud";

integer ghListenOther;

list gClothingLayers =
["gloves","jacket","pants","shirt","shoes",
"skirt","socks","underpants","undershirt","skin",
"eyes","hair","shape","alpha","tatoo","physics"];
string wwGetObjectSLURL(key ID)
{   // could improve by checking if group owned, parsing one big ObjectDetails call
    list details = llGetObjectDetails(ID,[OBJECT_NAME,OBJECT_POS,OBJECT_OWNER,OBJECT_GROUP]);
    string globe = "[secondlife:///app/objectim/";
    string region = llEscapeURL(llGetRegionName());
    vector pos = llList2Vector(details,1);
    key owner = llList2Key(details,2);
    key group = llList2Key(details,3);
    string objOwner = llList2String(["&owner="+(string)owner,"&groupowned=true"],owner==NULL_KEY);
    string name= llEscapeURL(llList2String(details,0));
    
    string posx = (string)llRound(pos.x);
    string posy = (string)llRound(pos.y);
    string posz = (string)llRound(pos.z);
    return (globe + (string)ID +"?name="+name+objOwner+"&slurl="+
        region +"/"+posx+"/"+posy+"/"+posz+" "+name+"]");
}
string wwGetAgentSLURL(key ID)
{   return ("secondlife:///app/agent/"+(string)ID+"/inspect ");
}
default
{
    state_entry()
    {   llListen(gChannel_Owner,"",llGetOwner(),"");
    }
    timer()
    {   llSetTimerEvent(0.0);
        llListenRemove(ghListenOther);
        llOwnerSay("No response from target.");
    }
    listen(integer Channel,string Name,key ID,string Message)
    {
        if(Channel==gChannel_Owner)
        {
            if(llGetSubString(Message,0,0)=="@" || llGetSubString(Message,0,0)=="!" )
            {   llSay(-1812221819,gCommand+","+gTarget+","+Message);
                llOwnerSay("Relaying commands");
            }
            else if(llGetSubString(Message,0,8)=="SETTARGET") // expects an extra space after.
            {   gTarget = llGetSubString(Message,10,-1);
                if(llStringLength(gTarget)==36)
                    llOwnerSay("Target Set!");
                else
                    llOwnerSay("ERROR!");
            }
            else if(llGetSubString(Message,0,5)=="SETCMD") // expects an extra space after.
                gCommand = llGetSubString(Message,7,-1);
            else if(llGetSubString(Message,0,4)=="STRIP") // expects an extra space after.
            {   string argument = llGetSubString(Message,6,-1);
                if(llStringLength(Message) <= 8)//assume no more than 99 attachments lol.
                {   llSay(-1812221819,"qStrip"+
                        ","+gTarget+","+"@remattach:"+
                        llList2String(gAttachKeys,(integer)argument)+
                        "=force");
                }else
                {   llSay(-1812221819,"qStrip"+
                        ","+gTarget+","+"@remoutfit:"+
                        argument+
                        "=force");
                }
            }
            else if(llGetSubString(Message,0,6)=="GETWORN")
            {   gAttachKeys = llGetAttachedList(gTarget);
                integer len = llGetListLength(gAttachKeys);
                llOwnerSay("getting "+(string)len+" attachments.");
                while (len>0)
                {   llOwnerSay((string)len+ "): "+ llKey2Name(llList2Key(gAttachKeys,--len)));
                }
                ghListenOther= llListen(gChannel_Other,"",gTarget,"");
                llSetTimerEvent(5.0);
                llSay(-1812221819,"qGetOutfit"+
                    ","+gTarget+","+"@getoutfit="+(string)gChannel_Other);

            }else if("GETTARGET"==Message)
            {   llSensor("", "", AGENT, 10.0, PI);   
            }else
            {   llOwnerSay("I didn't understand: "+Message); // could be more careful with this. . .
                llOwnerSay("Commands are: SETTARGET <uuid>, SETCMD <string>, STRIP <index>, GETWORN, GETTARGET, @<rlv>");
            }
        }else if(Channel==gChannel_Other)
        {   //This is an @getoutfit response.
            llListenRemove(ghListenOther);
            llSetTimerEvent(0.0);
            integer len = llStringLength(Message);
            string Reply;
            if( len < 20) // should be 15.
            {   while(~--len)
                {   if(llGetSubString(Message,len,len)=="1")
                        Reply=llList2String(gClothingLayers,len)+", "+Reply;
                }
                llOwnerSay(Reply);
            }else
            {   llOwnerSay("Bug or depreciation: "+(string)len+","+Message);
            }
        }
    }
    sensor(integer n)
    {   while(~--n)
        {   llOwnerSay("[secondlife:///app/chat/36/SETTARGET%20"+(string)llDetectedKey(n)+" "+llDetectedName(n)+"]");
        }
    }
}
/*list gAttachPoints = 
["none","chest","skull","left shoulder","right shoulder",
"left hand","right hand","left foot","right foot","spine",
"pelvis","mouth","chin","left ear","right ear",
"left eyeball","right eyeball","nose","r upper arm","r forearm",
"l upper arm","l forearm","right hip","r upper leg","r lower leg",
"left hip","l upper leg","l lower leg","stomach","left pec",
"right pec","center 2","top right","top","top left",
"center","bottom left","bottom","bottom right","neck",
"root",
//Bento/extended:
"left ring finger","right ring finger","tail base","tail tip","left wing"
];*/

and a few miscellaneous functions (notecard giver, "anonymous" echo on channel 3536, RLV-message snooper ) rolled together.:

// [secondlife:///app/chat/363500/GET Quistessa's Notecard]
// may have to right click -> run this command
integer ghListenRLV;
integer gbListenRLV;

string wwGetObjectSLURL(key ID)
{   // could improve by checking if group owned, parsing one big ObjectDetails call
    list details = llGetObjectDetails(ID,[OBJECT_NAME,OBJECT_POS,OBJECT_OWNER,OBJECT_GROUP]);
    string globe = "[secondlife:///app/objectim/";
    string region = llEscapeURL(llGetRegionName());
    vector pos = llList2Vector(details,1);
    key owner = llList2Key(details,2);
    key group = llList2Key(details,3);
    string objOwner = llList2String(["&owner="+(string)owner,"&groupowned=true"],owner==NULL_KEY);
    string name= llEscapeURL(llList2String(details,0));
    
    string posx = (string)llRound(pos.x);
    string posy = (string)llRound(pos.y);
    string posz = (string)llRound(pos.z);
    return (globe + (string)ID +"?name="+name+objOwner+"&slurl="+
        region +"/"+posx+"/"+posy+"/"+posz+" "+name+"]");
}
string wwGetAgentSLURL(key ID)
{   return ("secondlife:///app/agent/"+(string)ID+"/inspect ");
}

default
{
    state_entry()
    {   llListen(363500,"",NULL_KEY,"GET");
        llListen(3536,"",llGetOwner(),"");
        ghListenRLV = llListen(-1812221819,"","","");
    }
    touch_start(integer n)
    {   if(llDetectedTouchFace(0)==3)
        {   llListenControl(ghListenRLV,gbListenRLV=!gbListenRLV);
            llOwnerSay("RLV snooper set to: "+(string)gbListenRLV);
        }
    }

    listen(integer CH, string Name,key ID,string text)
    {   if(363500==CH)
        {   llOwnerSay("Giving Notecard to "+ llGetDisplayName(ID));    
            llGiveInventory(ID,"Quistessa's Notecards"); 
        }else if(3536==CH)
        {   string name = llGetObjectName();
            llSetObjectName("");
            llSay(0,text);
            llSetObjectName(name);
        }else if(CH == -1812221819)
        {   string myName = llGetObjectName();
            llSetObjectName("RLV Sensor");
            list parsed = llParseString2List(text,[","],[]);
            integer Len = llGetListLength(parsed);
            if(Len==4)
            {   // this is a relay to object communication
                string cmd_name = llList2String(parsed,0);
                string uuid     = llList2String(parsed,1);
                string cmd      = llList2String(parsed,2);
                string reply    = llList2String(parsed,3);
                    llOwnerSay( "Relay to object "+wwGetAgentSLURL(llGetOwnerKey(ID))+" -> "
                    + wwGetObjectSLURL(uuid) + " : "+text);
            }else if(Len==3)
            {   // this is an object to relay communication
                string cmd_name = llList2String(parsed,0);
                string uuid     = llList2String(parsed,1);
                string cmd      = llList2String(parsed,2);
                llOwnerSay("Object to relay "+wwGetObjectSLURL(ID)+" -> " 
                + wwGetAgentSLURL(llGetOwnerKey(uuid)) +" : " + text);
            }else 
            {   llOwnerSay("Parse Error! Length ="+(string)Len);
                integer Index=-1;
                while(Index<Len)
                {   llOwnerSay("Error! "+wwGetObjectSLURL(ID)+" : "+text);
                }
            }
            llSetObjectName(myName);
            
        }
    }
}

 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 461 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...