Sim Wide Chat

Thread Started By deadpool

3494
0
  • 34 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Rate Thread
#1
What is it?

A basic relay system that sends and receives messages on a given channel. So you can talk to your friends (some of;) at ground level while you’re miles above, and vice versa. The messages are encrypted for privacy. You can find the original I hacked to pieces by clicking here, full credit to Kireji Haiku for creating *SIMchat_headset* so I and others can learn/create.

How-to/Info:

•Copy paste the script below into a new script inworld.
•Save it & then put the script into an object (if not there already)

PHP Code:
// Converted to use inscript config(removed need for notecard), removed extra states
// added link_message, changed to owner only usage/HUD/attachment
 
//
integer secret_channel 10;
//
 
key owner;
string  name;
string  header;
string  protocol_signature "SPY";
string  password "P@ssw0rD";
string  strHex "0123456789ABCDEF";
float   protocol_version 0.3;
vector  on_color = <0.468,1.000,0.683>;
vector  off_color = <1.000,0.468,0.468>;
integer secret_listen;
integer active 0;
 
init(){
    
owner llGetOwner();
    list 
versions llParseString2List((string)protocol_version, ["."], []);
    
string minor llList2String(versions1);
    
integer p 0;
    while(
llGetSubString(minor, --pp) == "0");
    
header protocol_signature hex(llList2Integer(versions0)) + hex((integer)llGetSubString(minor0xFF000000p));
}
 
on(){
    
llListenRemove(secret_listen);
    
secret_listen llListen(secret_channel"""""");
    
llSetColor(on_colorALL_SIDES);
    
llOwnerSay("/me ("+(string)secret_channel+") : ON :");
}
off(){
    
llListenRemove(secret_listen);
    
llSetColor(off_colorALL_SIDES);
    
llOwnerSay("/me ("+(string)secret_channel+") : OFF :");
}
 
string  hex(integer value){
    
integer digit value 0xF;
    
string text llGetSubString(strHexdigitdigit);
    
value = (value >> 4) & 0xfffFFFF;
    
integer odd TRUE;
    while(
value){
        
digit value 0xF;
        
text llGetSubString(strHexdigitdigit) + text;
        
odd = !odd;
        
value value >> 4;
    }
    if(
odd)
        
text "0" text;
    return 
text;
}
 
string  encrypt(string passwordstring message){
    
integer nonce = (integer)llFrand(0x7FFFFFFF);
    
message llMD5String(messagenonce) + message;
    
string oneTimePad llMD5String(passwordnonce);
    
integer count = (llStringLength(message) - 1) / 32;
    if(
count) do oneTimePad += llMD5String(oneTimePadnonce);
    while(--
count);
    return 
header llGetSubString("00000000" hex(nonce), -8, -1) + llXorBase64StringsCorrect(llStringToBase64(message), llStringToBase64(oneTimePad));
}
 
string  decrypt(string passwordstring message){
    
integer signature_length llStringLength(protocol_signature);
    
integer header_length signature_length 12;
    if(
llStringLength(message) < signature_length 44)
        
llOwnerSay("/me • Bugger: Insufficient data.");
    
integer index signature_length;
    
string major "0x" llGetSubString(messageindex, ++index);
    
string minor "0x" llGetSubString(message, ++index, ++index);
    
integer nonce = (integer)("0x" llGetSubString(message, ++indexindex 7));
    
message llGetSubString(messageheader_length, -1);
    
string otp llMD5String(passwordnonce);
    while(
llStringLength(otp) < (llStringLength(message) / 3))
    
otp += llMD5String(otpnonce);
    
otp llStringToBase64(otp);
    
message llXorBase64StringsCorrect(messageotp);
    
message llBase64ToString(message);
    
string digest llGetSubString(message031);
    
message llGetSubString(message32, -1);
    if(
llMD5String(messagenonce) != digest)
        
llOwnerSay("/me • Bugger: Try again?...");
    return 
message;
}
 
say(string whostring message){
    
llSetObjectName(who);
    
llSleep(llGetRegionTimeDilation()+0.04);
    
llOwnerSay(message);
    
llSetObjectName(" ");
}
 
default{
//
    
attach(key id){
        if(
id){//tests if it is a valid key and not NULL_KEY
            
llOwnerSay("/me • Channel for sim Talk /"+(string)secret_channel);
        }else{
            
llOwnerSay("/me `0'");
        }
    }
//
    
state_entry(){
        
init();
    }
//
    
touch_start(integer d){
        
active =! active;
        if(
active){
            
off();
        }else{
            
on();
        }
    }
//
    
changed(integer c){
        if(
CHANGED_OWNER){
            
llResetScript();
        }
 
    }
// 
    
link_message(integer senderinteger codestring strkey id){
        if (
str == "DCOMM"){//llMessageLinked(LINK_THIS, 0, "DCOMM","ON");
            
if(id == "ON"on();
            else if(
id == "OFF"off();
        }
    }
//
    
listen(integer channelstring namekey idstring message){
        if (
channel == secret_channel){
            if (
id == owner){
                
llRegionSay(secret_channelencrypt(passwordmessage));
                
say(name,message);
            }
            else if (
llGetAgentSize(id) == ZERO_VECTOR){
                
say(llKey2Name(llGetOwnerKey(id)),decrypt(passwordmessage));
            }
        }
    }
//

Reply




Possibly Related Threads…
Thread Author Replies Views Last Post
  Private Chat SPY Relay script zion 2 7,926 06-11-2019, 07:34 PM
Last Post: adrianzero
  Multi Av IM Chat Relay / Spy Script v2.2 zion 1 5,795 04-30-2013, 04:51 AM
Last Post: Markus89
  Editable array with the chat steadymobbin 0 3,182 02-25-2013, 01:43 AM
Last Post: steadymobbin
  Multi Av IM Chat Relay / Spy Script zion 0 3,856 02-18-2013, 03:43 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:

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