I have moded the script to have it email the log and to read the email from a notecard. The problem I've been have is that it takes a while to register email. It take two starts to show me the email. So pretty much it goes like this. I click on the recorder it says "start" to make two prims to start spining and a cube to light up to tell people that a recording is in process and "loggin in", it doesn't tell me the email address. Then i click on it again and it says "stop" and "loggin off". When I click on it again it says "start" take like 3-5 secs then is says my email and "loggin in". When I click on it again it says "stop" and "loggin off" and replays chat. Then like 7-10 secs later it tells me my email again. I don't why but it must be where I put the dataserver function. Thanks for any help
list names;
list speech;
list colours=["002EB8","FF6633","006600","660066","660033","663300","1A9900","FF14B1","001A99","#B88A00"];
list unique_names;
string email_address = " ";//<---------Email
list chat = [];
string chat1;
key request;
default
{
state_entry()
{
request = llGetNotecardLine("Type your email here", 0);
llSetText("Recorder, \nremember to tell everyone that you are going to record first",<0,0,0>,1.0);
integer i;
integer c;
for (i=0;i<llGetListLength(names);i++)
{
c = llListFindList(unique_names,llList2List(names,i,i) );
while (c >= llGetListLength(colours)) // dont crash if I run out of colours
c -= llGetListLength(colours);
llSetObjectName("" + llList2String(names,i) );
llOwnerSay( llList2String(speech,i) + "" );
chat += (llList2String(names,i) + ":" + llList2String(speech,i));
}
names = [];
speech = [];
unique_names = [];
llSetObjectName("Recorder"
;llEmail(email_address, "Recorder", "Here is the chat recorded\n" + llList2CSV(chat));
chat=[];
}
on_rez(integer i)
{
llResetScript();
}
dataserver(key ID, string Data)
{
if( ID == request)
{
email_address = Data;
llSay(0, email_address);
}
}
touch_start(integer total_number)
{
{
llSay(0, "logging on!."
;llSay(-53, "start"
;state logging_chat;
}
}
}
state logging_chat
{
state_entry()
{
llListen(0,"",NULL_KEY,""
;}
on_rez(integer i)
{
llOwnerSay("Logging still on! Touch to get playback"
;}
touch_start(integer total_number)
{
//if (llDetectedKey(0) == llGetOwner() )
{
llSay(0, "chat logging now off - replaying log!."
;llSay(-53, "stop"
;//llRemoveInventory("Type your email here"
;state default;
}
}
listen(integer channel, string name, key id, string message)
{
if(llListFindList(unique_names,[name]) == -1)
{
unique_names += name;
}
names += name;
speech += message;
}
}