SecondLife Linden Scripting Language GPL Chat Logger, Version 0.1
Chat logging can be a handy thing for meetings and so forth within SecondLife. The problem, of course, is that not everyone wants to have their chat logged - and by Section 4 of the Community Standards of SecondLife:
Disclosure
Residents are entitled to a reasonable level of privacy with regard to their Second Lives. Sharing personal information about a fellow Resident --including gender, religion, age, marital status, race, sexual preference, and real-world location beyond what is provided by the Resident in the First Life page of their Resident profile is a violation of that Resident's privacy. Remotely monitoring conversations, posting conversation logs, or sharing conversation logs without consent are all prohibited in Second Life and on the Second Life Forums.
The key word is consent. So I looked all over for a chat logger which met the community standards (not to mention just plain good taste). I did find one SL Chat Logger, but again - it didn't ask for consent.
This is beta code - and it is at version 0.1 (the plan is to release updates via comments on this page, at least for a while). If you find bugs, feel free to fix them and let me know, or plain let me know. To report a bug, please copy and paste some text of the bug and note how it can be recreated in IMs to Nobody Fugazi in world, or comments here.
The code, upon being touched by the owner, starts logging chat. The first time a person within chat range says something, it asks their permission to log their chat. If they decline, the script ignores anything they say from then on (until the script is reset, when they will be asked again). If they accept, their chat is logged.
Touching the logger again will cause logging to stop and the text, formatted in HTML, to be sent to chat - where, using History, you may copy and paste to your heart's content.
To use the script, simply copy it into an object you rez; in IE the entire script may not show (?) so I added the text file below.
Or grab a copy from someone who has one.
By using this script, I'm not taking the responsibility of violation of the community standards away from the user of the script - use with your own discretion, and at your own risk.
// Code adapted from: http://www.simteach.com/wiki/index.php?title=SL_Chat_Logger
// which is covered by GNU Free Documentation License (http://www.gnu.org/copyleft/fdl.html)
// in the spirit of which this script is GPL'd.
//
// Copyright (C) 2007 Nobody Fugazi/T. Rampersad
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// The GPL license should be available in the notecard provided
// within the object; if it is not reference:
// http://www.gnu.org/copyleft/gpl.html
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// Change Log:
// January 12, 2007: Text output in HTML, Requests permissions from user before logging chat. (NF/TR)
list names;
list speech;
list colours=["002EB8","FF6633","006600","660066","660033","663300","1A9900","FF14B1","001A99","#B88A00"];
list unique_names;
list ignore_names;
list buffer_await;
integer BUFFERSTRIDE = 2;
list ALLOW_MENU = ["sure", "no way"]; // the main menu
integer CHANNEL = 42; // Life, the Universe, and Everything.
integer HandleDialogListen;
default
{
state_entry()
{
llSetText("This is a GPL Chat Logger.\n We request permission before recording.",<0,0,0>,1.0);
integer i;
integer c;
for (i=0;i= llGetListLength(colours)) // dont crash if I run out of colours
c -= llGetListLength(colours);
llSetObjectName("" + llList2String(names,i) );
llOwnerSay( llList2String(speech,i) + "" );
}
names = [];
speech = [];
unique_names = [];
llSetObjectName("GPL ChatLogger 0.1");
}
on_rez(integer i)
{
llResetScript();
}
touch_start(integer total_number)
{
if (llDetectedKey(0) == llGetOwner() )
{
llSay(0, "Beginning Chat Logging.");
state chat_logging;
}
}
}
state chat_logging
{
state_entry()
{
llListen(0,"",NULL_KEY,"");
buffer_await = [];
}
on_rez(integer i)
{
llOwnerSay("Logging still active! Touch to get playback");
}
timer()
{
// If the dialog is hanging out doing nothing too long, kill the llListen
llListenRemove(HandleDialogListen);
}
touch_start(integer total_number)
{
if (llDetectedKey(0) == llGetOwner() )
{
llSay(0, "chat logging now off - replaying log!.");
state default;
}
}
listen(integer channel, string name, key id, string message)
{
// Is this a message from the permissions dialog?
if ((llListFindList(ALLOW_MENU, [message]) != -1) && (channel==CHANNEL))
{
string buffer_temp;
// we'll need this from the strided list.
integer buffer_loc;
list temp_name;
temp_name +=name;
buffer_loc = llListFindList(buffer_await, temp_name);
if (message=="sure")
{
unique_names += name;
llListenRemove(HandleDialogListen);
// buffered message is worthwhile, so add it:
buffer_temp = llList2String(buffer_await, buffer_loc);
names += buffer_temp;
buffer_loc++;
buffer_temp = llList2String(buffer_await, buffer_loc);
speech += buffer_temp;
buffer_loc--;
llDeleteSubList(buffer_await, buffer_loc, BUFFERSTRIDE);
return;
}
else
{
// To Be Safe, even if someone hits ignore
ignore_names += name;
llListenRemove(HandleDialogListen);
// We can delete the buffer without adding stuff.
llDeleteSubList(buffer_await, buffer_loc, BUFFERSTRIDE);
return;
}
}
if(llListFindList(ignore_names,[name]) != -1)
{
return;
}
if(llListFindList(unique_names,[name]) == -1)
{
//Check if avatar will give permissions
HandleDialogListen = llListen(CHANNEL, "", NULL_KEY, "");
llDialog(id,
"Hello. If you give us permission, your participation will be recorded.
May we have your permission?",
ALLOW_MENU, CHANNEL);
// Give people 1.5 minutes to respond,
// else kill the llListen in timer()
llSetTimerEvent(90);
//store in strided buffer in case last message is to be permed.
buffer_await +=[name,message];
//we're done here (until the user responds to the dialog).
return;
}
names += name;
speech += message;
}
}
| Attachment | Size |
|---|---|
| GPL Chat Logger Version 0.1.txt | 5.68 KB |

chat logger
Poinky Malaprop has one that's asked me to log my chat before -- I'm betting your code is similar. Thanks for the new tool :)
--Rez
Yeah, Poinky's logger was the inspiration.
Credit where credit is due - forgot to mention that. Got too tied up in the code. Also, a mention of Tao Takashi for helping me debug and llListening();
:-)
Already there?
I thought Linden Lab had added chat logging to one of the recent upgrades, so logging a chat is a one-click operation. Does that notify people? I haven't explored it much.
I'll feel awfully silly if it is there.
Never heard of it. I'd have thought it would have shown up in a Google Search, at the least - which I did many of...
Post new comment