Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Little Email Script i can't get to work

Nilp Morris
Registered User
Join date: 7 Jan 2006
Posts: 13
03-23-2007 05:58
Hi there, i just started scripting again and i got my first problem, i just cant get this small script to work:

From: someone

default {
state_entry() {
touch_start() {
email(string time, string address, string subj, string message, integer num_left) {
llSay(0, "You got mail! " + (string)num_left + " more mails.";);
llSay(0, llList2CSV([time, address, subj, message]));
}
}
}
}


What's wrong with it, could someone please fix it and tell me what didn't work? Thanks in advance
nand Nerd
Flexi Fanatic
Join date: 4 Oct 2005
Posts: 427
03-23-2007 06:04
From: Nilp Morris
Hi there, i just started scripting again and i got my first problem, i just cant get this small script to work:



What's wrong with it, could someone please fix it and tell me what didn't work? Thanks in advance


What you appear to have done is nested the events, you cannot have an event within an event. Also the email event will only fire when you call llGetNextEmail and there is an email waiting which matches the calls parameters (in this case I've left them empty).

CODE

default {
touch_start()
{
llGetNextEmail("", "");
}

email(string time, string address, string subj, string message, integer num_left)
{
llSay(0, "You got mail! " + (string)num_left + " more mails.");
llSay(0, llList2CSV([time, address, subj, message]));
}
}


LSL Wiki: email
LSL Wiki: llGetNextEmail
_____________________
www.nandnerd.info
http://ordinalmalaprop.com/forum - Ordinal Malaprop's Scripting Forum
Nilp Morris
Registered User
Join date: 7 Jan 2006
Posts: 13
03-23-2007 06:16
From: nand Nerd
What you appear to have done is nested the events, you cannot have an event within an event. Also the email event will only fire when you call llGetNextEmail and there is an email waiting which matches the calls parameters (in this case I've left them empty).

CODE

default {
touch_start()
{
llGetNextEmail("", "");
}

email(string time, string address, string subj, string message, integer num_left)
{
llSay(0, "You got mail! " + (string)num_left + " more mails.");
llSay(0, llList2CSV([time, address, subj, message]));
}
}


LSL Wiki: email
LSL Wiki: llGetNextEmail


Thank you but when i try to compile it i still get a syntax error message at (1,16)
nand Nerd
Flexi Fanatic
Join date: 4 Oct 2005
Posts: 427
03-23-2007 06:53
From: Nilp Morris
Thank you but when i try to compile it i still get a syntax error message at (1,16)


CODE

default {
touch_start(integer num)
{
llGetNextEmail("", "");
}

email(string time, string address, string subj, string message, integer num_left)
{
llSay(0, "You got mail! " + (string)num_left + " more mails.");
llSay(0, llList2CSV([time, address, subj, message]));
}
}


I had accidentally left out the "integer num" from the touch_start event, this is used to tell how many touches have been triggered in this event call.
_____________________
www.nandnerd.info
http://ordinalmalaprop.com/forum - Ordinal Malaprop's Scripting Forum