Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Emailers

Genocide Nasu
Registered User
Join date: 27 Jun 2006
Posts: 5
10-09-2006 16:16
Ok i want to have a object relay commands to a diffrent object and i was wondering if anyone could give me a example script that emails another prim with a command or give me a link that explains it indepth. Any help would be great.
Thanks,
Genocide Nasu
Newgate Ludd
Out of Chesse Error
Join date: 8 Apr 2005
Posts: 2,103
Newgy-esse
10-10-2006 07:04
The following code was created after reading the wiki.

First code fragment is a button that would call a lift. This was for use outside the 100m shout limit.

CODE
key  objid= "ddc6266b-7d80-7e1f-27c9-b1705a1c1d30"; // key of target object

default
{
state_entry()
{
llSetColor(<1.0,1.0,1.0>,ALL_SIDES);
}

touch_start(integer total_number)
{
llSetColor(<0.75,0.0,0.0>,ALL_SIDES);
llSay(0,"Calling the Lift. Please wait.");
llEmail((string)objid + "@lsl.secondlife.com","CALL LIFT - DOWN","no message");
llSetColor(<1.0,1.0,1.0>,ALL_SIDES);

}
}


The receiver script is given below:

CODE

key owner;
key objid;
string strid;

default
{
state_entry()
{
key objid = llGetKey();
string strid = (string)objid;
llSay(0, "Elevator Control -" + strid);
llEmail(strid + "@lsl.secondlife.com", "Init", "This is a test message."); // send email to self

llSetTimerEvent(10); // Poll for more emails (Yuck!)
}

timer()
{
llGetNextEmail("", ""); // check for email with any subject/sender
}

email(string time, string address, string subj, string message, integer num_left)
{
llSay(0,"Received an email - " + subj);
if(subj == "CALL LIFT - DOWN")
{
llMessageLinked(0,0,"CALL LIFT",owner);
llSay(0,"Called by Email");
}
else if(subj == "CALL LIFT - UP")
{
llMessageLinked(0,1,"CALL LIFT",owner);
llSay(0,"Called by Email");
}
}
}

In the above example the linked messages where used to trigger the 'normal' lift functions
Hope that helps.
Genocide Nasu
Registered User
Join date: 27 Jun 2006
Posts: 5
10-10-2006 15:48
Thanks i'll play around with the script to try and mold it to what i need it to do.