Jump to content

Me again. This time... Communicating by Email


Seren Sautereau
 Share

You are about to reply to a thread that has been inactive for 4323 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hey again.

 

Right, so, yesterday I got quoted 10k for a script that would store an attachment uuid in a list and do something with it after an hour of it being in the list. After much widened eyebrows I decided to try and do it myself. Who knows, maybe I'll learn something :P

 

So I've made 2 prims. One is the server with 2 scripts inside. A simple llGetKey() script so I know where I'm sending the message to (it is stil "uuid@lsl.secondlife.com" right?) the other should be a functional email receiving script basically copy/pasted from somewhere. 

default
{
    state_entry()
    {
        llSetTimerEvent(30);
    }
 
    timer()
    {
        llOwnerSay("Getting Emails...");
        llGetNextEmail("", "");
    }
 
    email( string time, string address, string subject, string message, integer num_left )
    {
        if (llGetSubString(address, -19, -1) == "@lsl.secondlife.com")
        {//Message was sent from within SL. For this example we will just strip the header.
            message = llDeleteSubString(message, 0, llSubStringIndex(message, "\n\n") + 1);
        }
        
        llOwnerSay("Received Email");
 
        llSay(0, message);
 
        if(num_left)
            llGetNextEmail("", "");
    }
}

 Oh yes, it has a couple of llOwnerSay thingies so I can see how things are working, or not as the case is.

 

The second prim has 2 scripts in it. 

The first is a llLinkMessage script to communicate with the 2nd script, as the former is going to be putchered to place into the already existing script for an attachment I've been working on for the last few days. (Which works great btw :P)

default
{
    state_entry()
    {
        
    }

    touch_start(integer total_number)
    {
        llMessageLinked(LINK_THIS, 0, "Send", "");
        llOwnerSay("Sending Link Message");
    }
}

 Note: It won't be a touch_start event when put into the main script, it will be a timer event along with several other functions in that same event. This is purely for testing and learning purposes.

The 2nd script in the sender prim is the actual llEmail script.

string server = "5045a6c6-c772-23f6-0158-6846bf879514@lsl.secondlife.com";

emailserver1()
{
    string msg1 = llGetKey();
    string subj = llGetObjectName();
    llEmail(server, subj, msg1);
    llOwnerSay("Sending Email");
}

default
{
    state_entry()
    {
    
    }

    link_message(integer source, integer num, string str, key id){
        llOwnerSay("Link Message Received");
    
    
    if (str == "Send")
        {
            emailserver1();
            
        }
    }
}

 The string uuid for the address is correct as stated using the llGetKey() script in the server.

 

You can see I have llOwnerSay messages set for each stage of the process.

 

Here's what happens.

On touch of the sender I get: 


[00:24] Sender: Sending Link Message
[00:25] Sender: Link Message Received
[00:25] Sender: Sending Email
[00:25] Server: Getting Emails...
[00:25] Server: Getting Emails...
[00:26] Server: Getting Emails...

And the Getting Emails... message just continues every 30 secs.

Basically, as far as I can see, the server prim isn't receiving the message.

So what silly little mistake have I made this time?

 

Thanks in advance once again, you're all always a great help.

Link to comment
Share on other sites

Since I didn't see something wrong, I tested it - and, als, this is the result:

[00:54] sender: Sending Link Message[00:54] sender: Link Message Received[00:55] sender: Sending Email[00:55] receiver: Getting Emails...[00:55] receiver: Received Email[00:55] receiver: e3bd898d-dc9d-0739-219b-11e1fb6d7053

 Are you sure, you copied the key correctly?

Link to comment
Share on other sites


A couple of little edits to the scripts to show more details in the owner say. (changed "sending email" to "sending email to" + server and changed "getting emails" to "server " + llGetKey() + ": Getting emails")

Link Message Received
[01:06] Sender: Sending Email to 5045a6c6-c772-23f6-0158-6846bf879514@lsl.secondlife.com
[01:06] Server: Server 5045a6c6-c772-23f6-0158-6846bf879514: Getting Emails...
[01:07] Server: Server 5045a6c6-c772-23f6-0158-6846bf879514: Getting Emails...

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4323 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...