Ahora dentro de Second Life puedes ver si estamos conectadas y así mismo enviarnos un correo electrónico.
En el primer nivel, en la recepción del Museo de Conocimiento, podrás encontrar este monitor, el cual muestra si Melissa y yo estamos conectadas, así mismo en el cubo de arriba si das clic podrás enviarnos un correo electrónico.
Para ello necesitas activar el chat, presionando la tecla Enter, si es que no has escrito nada en el chat, eso hará que se vea un textbox en la parte inferior de tu pantalla.
Al dar clic te aparecerá una ventana preguntándote si quieres enviar un correo, si presionas afirmativo, entonces te pedira que ingreses el asunto y luego el mensaje en el chat, así mismo te pedirá una confirmación para enviarlo.
Y luego en unos segundos será enviado el correo y lo recibiremos Melissa y yo.
Funcionamiento del Script
Pero además de mostrarles la funcionalidad del objeto ahora quiero incluir algo bastante interesante, quiero mostrarles todo detras de cámaras, jejeje, bueno en realidad quiero mostrarles qué hay dentro de los objetos para que hagan ésto, mostrar el estado y enviar un correo electrónico.
Para que el monitor funcione y el mensajero, existe un Lenguaje de Programación dentro de Second Life que se llama Linden Scripting Language, que para los que saben C y Java pues se les será bastante fácil de entender.
A continuación les muestro los Scripts que están involucrados en estos dos objetos, para facilitar su comprensión los he colocado con los colores que se muestran en el editor de Second Life.
Script del Monitor On-Line
//changeText – set to TRUE if you want to change the text above the object to show the
//owner’s online status. Set it to FALSE otherwise.
integer changeText = TRUE;//This is any text you want to display if the owner is online (the owner’s name will be
//added in front of this.
string showTextOnline = “ is online!“;//This is any text you want to display if the owner is offline (the owner’s name will be
//added in front of this.
string showTextOffline = “ is offline!“;//This is the color of the text displayed above the object
vector textColor = <1,1,1>;//This is the transparency of the text displayed above the object. 1 = solid, 0.2 = most //transparent
float textAlpha = 1;
//changeColor – set to TRUE if you want to change the object’s color to show the
//owner’s online status. Set to FALSE otherwise.
integer changeColor = TRUE;//This is the color to set the object if the owner is online
vector colorOnline = <0,1,0>;//This is the color to set the object if the owner is offline
vector colorOffline = <1,0,0>;//owner will be used to store the owner’s key
key owner;//ownerName will be used to store the owner’s name
string ownerName;//request will be used to store the dataserver request key;
key request;//init() – runs on state_entry and on_rez
init()
{
//If changeText == FALSE then we don’t want to show any text
if (changeText == FALSE) {
//Clears any text showing to make sure none is showing.
llSetText(“”,<0,0,0>,1);
}
//To start with set the timer event to trigger in 1 second to update the
//item straight away
llSetTimerEvent(1);
llSleep(1); // sleep to make sure that the timer event triggers
//This resets the timer so that it runs timer event every 10 seconds now.
llSetTimerEvent(10);
//Get the key of the owner
owner = llGetOwner();
//Get the owner’s name
ownerName = llKey2Name(owner);
}//Aqui es donde empieza el script a ejecutarse, podriamos decir que es el Main
default
{
//state_entry – launches whenever the script is reset (or on change of
//state but this script doesn’t use other states!)
state_entry()
{
init();
}//on_rez – launches whenever the object is rezzed
on_rez(integer times)
{
init();
}//timer – this event runs every number of seconds specified in an llSetTimerEvent command
timer()
{
//send a request to the SL dataservers. DATA_ONLINE means we’re requesting
//information about whether the owner is online or not
request = llRequestAgentData(owner, DATA_ONLINE);
}//dataserver – this event runs every time the script recieves some information
//from the data servers in SL.
//In this script we will recieve data here when we use llRequestAgentData
dataserver(key requested, string data)
{
//Checks that this dataserver event matches the last one we requested by checking
//the keys
if (requested == request) {
//If the user is online data will have the value of 1
if (data == “1“) {
//Checks to see if changeText is equal to TRUE, if it is we need to set
//the text over the object
if (changeText == TRUE) {
//Sets the text over the object to show that the owner is online
llSetText(ownerName + showTextOnline,textColor,textAlpha);
}
//Checks to see if changeColor is equal to TRUE, if it is we need to set
//the object’s color
if (changeColor == TRUE) {
//Sets the object’s color to the online color
llSetColor(colorOnline,ALL_SIDES);
}
} else { //data doesn’t have the value of 1 so the owner must be offline
//Checks to see if changeText is equal to TRUE, if it is we need to set
//the text over the object
if (changeText == TRUE) {
//Sets the text over the object to show that the owner is offline
llSetText(ownerName + showTextOffline,textColor,textAlpha);
}
//Checks to see if changeColor is equal to TRUE, if it is we need to set
//the object’s color
if (changeColor == TRUE) {
//Sets the object’s color to the offline color
llSetColor(colorOffline,ALL_SIDES);
}
}
}
}
}
Script del Mensajero – Email Sender
//…….One Way Email Terminal……….
//…….Originally written by Doc Nerd……//……….Variable Block……….
key senderKey;
string senderName;
string eMail=”winnybeth@gmail.com”;
string subject;
string bodyText;
list sendButtons = ["Si", "No"];
list writeButtons;
string removeButton;
integer i;//……….Modulos o como se conocen funciones, recuerda estas deben estar antes del Main o Default …
//……….Modules for writing each part of email……….
writeAddress()
{
llListen(0, “”, senderKey, “”); //Listen to what the user says.
llSay(0, “Please say the address of whom you are sending your email.“); //Tell them what to say.
llSetTimerEvent(30); //Give them 30 seconds to say it.
}writeSubject()
{
llListen(0, “”, senderKey, “”); //Listen to what the user says.
llSay(0, “Porfavor escribe en el chat el asunto de tu correo.“); //Tell them what to say.
llSetTimerEvent(30); //Give them 30 seconds to say it.
}writeBody()
{
llListen(0, “”, senderKey, “”); //Listen to what the user says.
llSay(0, “Porfavor escribe en el chat el mensaje que deseas enviar.“); //Tell them what to say.
llSetTimerEvent(120); //Give them 120 seconds (2 minutes) to say it.
}//……….Modules to remove buttons already used in llDialog menu……….
removeAddress()
{
i = llListFindList(writeButtons, ["Address"]); //Find “Address” button in list.
writeButtons = llDeleteSubList(writeButtons, i, i); //Remove it where it’s found.
}removeSubject()
{
i = llListFindList(writeButtons, ["Asunto"]); //Find “Subject” button in list.
writeButtons = llDeleteSubList(writeButtons, i, i); //Remove it where it’s found.}
removeMessage()
{
i = llListFindList(writeButtons, ["Mensaje"]); //Find “Message” button in list.
writeButtons = llDeleteSubList(writeButtons, i, i); //Remove it where it’s found.
}//……….AQUÍ ES DONDE INICIA TODO ——————
//Running script block……….
default
{
state_entry()
{
llSetObjectName(“Mensajero“);
llTargetOmega(<0,0,-1>,1,0.10); // Hace que el objeto se mantenga en Movimiento
writeButtons = ["Direccion", "Asunto", "Mensaje"]; //Sets the llDialog buttons.
llListen(67895, “”, senderKey, “Si“); //Activate listeners.
llListen(67895, “”, senderKey, “No“);
}touch_start(integer total_number)
{
senderKey = llDetectedKey(0); //Detects who’s touching it, to get a raw key.
senderName = llKey2Name(llDetectedKey(0)); //Detects who’s touching it, to get a name.
llDialog(senderKey, “Saludos ” + senderName + “, te gustaría enviarle un correo a Winnybeth Reina y Melita Karlsbar?“, sendButtons, 67895); //Do you like me? Y/N
}listen(integer channel, string name, key id, string message)
{
if(message == “Si“) //Starts email writing process.
{
llSay(0, “Actualmente está siendo usado por ” + senderName + “.”); //Tells area who’s using terminal.
state emailer;
}
if(message == “No”) //Thank you, come again.
{
llSay(0, “Gracias ” + senderName);
}
}
}//Inicia el Estado Emailer, es donde se recibe la información, se procesa y se pasa al estado de enviar, sendMail
state emailer
{
state_entry()
{
if(writeButtons == []) //Check to see if there’s anything left to write in the email.
{
state sendMail; //If not, move to sending module.
}
llListen(67895, “”, senderKey, “Direccion”); //Activate listeners.
llListen(67895, “”, senderKey, “Asunto”);
llListen(67895, “”, senderKey, “Mensaje”);
llSetTimerEvent(30); //Gives user 30 seconds to choose a part to write…
llSay(0, “Tienes 30 segundos para elegir una opción..“); //Informs user they have 30 seconds to choose.
llSetText(“In use, please wait.“, <255,0,0>, 1); //Gives visual cue to others that no one else can use it right now.
llDialog(senderKey, “¿Qué parte del mensaje te gustaria escribir?“, writeButtons, 67895); //Selection button GUI.
}listen(integer channgel, string name, key id, string message)
{
if(message == “Direccion“) //Select “Address” button.
{
state addressWrite; //Enter address writing state.
}
if(message == “Asunto“) //Select “Subject” button.
{
state subjectWrite; //Enter subject writing state.
}
else if(message == “Mensaje“) //Select “Message” button.
{
state messageWrite; //SEnter message writing state.
}
}timer() //After 30 seconds are up, time out, and return to default state.
{
llSetTimerEvent(0);
llSay(0, “No se ha logrado enviar el correo, inicia de nuevo!!!!“);
llSetText(“Envianos un mensaje“,<0,1,1>, 1); //Coloca el mensaje inicial.
state default;
}}
state addressWrite
{
state_entry()
{
writeAddress(); //Start address writing module.
}listen(integer channel, string name, key id, string message)
{
eMail = message; //Save message user said.
removeButton = “Direccion“; //Set variable for button removal.
state remainButton; //Enter button removal process state.
}timer() //After 30 seconds are up, time out, and return to selection state.
{
llSetTimerEvent(0);
llSay(0, “User has failed to enter information quickly enough. Please try again.“);
state emailer;
}
}state subjectWrite
{
state_entry()
{
writeSubject(); //Start subject writing module.
}listen(integer channel, string name, key id, string message)
{
subject = message; //Save message user said.
removeButton = “Asunto“; //Set variable for button removal.
state remainButton; //Enter button removal process state.
}timer() //After 30 seconds are up, time out, and return to selection state.
{
llSetTimerEvent(0);
llSay(0, “Intentalo de nuevo.“);
llSetText(“Envianos un mensaje“,<0,1,1>, 1); //Modificamos al mensaje inicial.
state emailer;
}
}state messageWrite
{
state_entry()
{
writeBody(); //Start message writing module.
}listen(integer channel, string name, key id, string message)
{
bodyText = message; //Save what the user said.
removeButton = “Mensaje“; //Set variable for button removal.
state remainButton; //Enter button removal process state.
}timer() //After 120 seconds (2 minutes) are up, time out, and return to selection state.
{
llSetTimerEvent(0);
llSay(0, “Intentalo de nuevo, el mensaje no se ha enviado.“);
llSetText(“Envianos un mensaje“,<0,1,1>, 1); //Modificamos el mensaje Flotante.
state emailer;
}
}state remainButton //Removing buttons from a list
{
state_entry()
{
if(removeButton == “Address“) //Removes “Address” button.
{
removeAddress();
state emailer;
}
else if(removeButton == “Asunto“) //Removes “Subject” button.
{
removeSubject();
state emailer;
}
else if(removeButton == “Mensaje“) //Removes “Message” button.
{
removeMessage();
state emailer;
}}
}
//**********************************************************
//En este estado ya tenemos toda la información para enviar el correo, solo pedimos la //confirmación por medio de otro llDialog, otro diálogo
//Si la respuesta es si, entonces se envia el correo por medio de llEmail.
state sendMail
{
state_entry()
{
llListen(67895, “”, senderKey, “Si“); //Starts listeners.
llListen(67895, “”, senderKey, “No“);
llSay(0, “El correo será el siguiente:“); //Spews out the actual email message.
llSay(0, eMail);
llSay(0, “Asunto: ” + subject);
llSay(0, “Mensaje: ” + bodyText);
llDialog(senderKey, “¿Deseas enviar el correo?“, sendButtons, 67895); //Do you like me? Y/N
}listen(integer channel, string name, key id, string message)
{
llSetText(“Envianos un mensaje“,<0,225,225>, 1); //Removes floating text.
if(message == “Si”)
{
llSay(0, “Tu mensaje se está enviando.“); //Tells user email will be sent in 20 seconds (delay of llEmail function call to script).
llSay(0, “Gracias ” + senderName + “, por tu mensaje.“); //Thank you, come again.
llSetText(“”, <0,0,0>, 0); //Removes “busy signal”.
llSetObjectName(senderName); //Change to user’s name.llEmail(eMail,”Desde Second Life —– “+ subject, “Un mensaje de: “+ senderName + ” ” +bodyText); //llEmail envia el mensaje, colocando inicialmente la dirección de correo, el asunto y luego el mensaje completo.
llSetText(“Envianos un mensaje“,<0,1,1>, 1); //Colocamos de nuevo el mensaje inicial.
state default; //Return to normal.
}
else if(message == “No“)
{
llSay(0, “Gracias ” + senderName); //Thank you, come again.
llSetText(“Envianos un mensaje“,<0,1,1>, 1); //Removes floating text.
state default; //Return to normal.
}
}
}
Para utilizarlos solo tienes que crear un objeto en tu tierra o en un SandBox, crear un script en la parte de contenido en el editor del objeto y sustituir el código que aparece en el script y ejecutarlo, si deseas colocar una direccion de correo especifica la puedes colocarla al inicio, en la variable address y colocar con comentarios todo lo que se relaciona con Address.
Recuerda dejar tu comentario o sugerencia que tengas sobre este tema.
Saludos.





Pues se mira interesante todo esto… no he entrado todavía… al parecer me falta ram para los requerimientos mínimos…. bueno felicidades…. lo que me intriga es eso del pago por la tierra…. se paga realmente? o es hopotético?
@Rudy Castañeda
Pues te invito a entrar a Second Life, es algo muy interesante.
Hablando sobre el pago de la tierra, pues sí es cierto, para poder contar con algo propio tienes dos opciones comprar o alquilar, para poder realizar el pago debes comprar dólares linden (L$) , la moneda oficial de Second Life, y pagas con dólares americanos, el cambio está $1 -> L$ 250, algo así.
Eso es lo interensante de este mundo virtual, que está siendo parte de la vida real, y no solo eso, involucra la economía también, ya que algo real se convierte en virtual, y algo virtual en algo real.
Existe una profesora en Japón, Ailin Graef, que inició a invertir en Second Life, comprando propiedades, ahora ya tiene una gran empresa, tiene como a 10 personas trabajando en USA, Japón, China y otros lugares, que le hacen casas o muebles en la tierra que compra y luego pues las vende y les va ganando, o renta tierra, entonces luego puede hacer el cambio de Dólares Linden a dólares americanos, ha llegado a ganar 250,000 dólares americanos.
Interesante verdad???