05-20-2004 09:50
i wrote this code after i typing up a nice long detailed bug report in notecard form. When i asked who to send it to they (they being a tech support Linden) said "support@lindenlab.com" so thats what i did. Since i'd rather be cryptic then send long bug reports; i don't think i'll be developing it anymore. Enjoy.

CODE

//Notecard2EmailTechSupport version 0.11 alpha
//Writen by Strife Onizuka
//Released under GPL
//http://www.gnu.org/copyleft/

string reading = "";
string emailtext;
integer line;
integer parts;
string postfix="\n----------\nMessage Converted from notecard with Notecard2EmailTechSupport version 0.1 alpha";//\nPlease send feedback (less then 1023 characters) about this script to "; //didn't feel like adding this, to much work.
string emailaddress="support@lindenlab.com";
string quote="\""; //"

send(string subject, string message, integer part)
{
if (part)
{
subject+=" - Email Part " + (string)llAbs(part);
message="Continuation of "+quote+subject+" - Email Part 1"+quote+"\n---\n"+message;
}
if (part>0)
message+="\n---\nMessage contiues in another email Please see email named"+quote+subject+" - Email Part " + (string)(part+1)+quote;
else
message+=postfix;//+(string)llGetKey()+"@lsl.secondlife.com";
llSay(0,"Sending"+llGetSubString(" Last Message: ",-(part>0)*2,-1)+subject);
llEmail(emailaddress,subject,message);
}

default
{
state_entry()
{
if (llGetInventoryNumber(INVENTORY_NOTECARD))
state notecard;
}
changed(integer a)
{
if (llGetInventoryNumber(INVENTORY_NOTECARD))
state notecard;
}
}

state notecard
{
state_entry()
{
emailtext="";
llGetNotecardLine(reading=llGetInventoryName(INVENTORY_NOTECARD,0), line=parts=0);
llSay(0,"Parsing Notecard "+quote+reading+quote);
}
dataserver(key id, string data)
{
if (data != EOF)
{
// if (llStringLength(data)>3700) //Code To cut a long line,
// { //but was to lazy to finish writing it as who
// if (!parts) parts=1; //is going to put 3800+char on a single line?
// send(reading,,parts);
// emailtext="";
// parts++;
// }
// else
if (llStringLength(emailtext)+llStringLength(data)>3800)
{
if (!parts) parts=1;
send(reading,emailtext,parts);
emailtext="";
parts++;
}
emailtext+=data+"\n";
llGetNotecardLine(reading, ++line);
}
else
{
send(reading,emailtext,-parts);
llRemoveInventory(reading);
llSleep(5);
if (!llGetInventoryNumber(INVENTORY_NOTECARD))
state default;
emailtext="";
llGetNotecardLine(reading=llGetInventoryName(INVENTORY_NOTECARD,0), line=parts=0);
llSay(0,"Parsing Notecard "+quote+reading+quote);
}
}
}


EDIT:
lowered max text count.
also, Tech Support won't like you unless you implement an email reader for this (ie email event), as they like to be able to respond to emails. This also needs more testing (and not by sending bug reports to L).
_____________________
Truth is a river that is always splitting up into arms that reunite. Islanded between the arms, the inhabitants argue for a lifetime as to which is the main river.
- Cyril Connolly

Without the political will to find common ground, the continual friction of tactic and counter tactic, only creates suspicion and hatred and vengeance, and perpetuates the cycle of violence.
- James Nachtwey