You are on page 1of 6

Picture Board Script

Source: http://www.freeslscripts.gendersquare.org/index.php?option=com_content&view=article&id=104:picture-boardscript&catid=10:texture&Itemid=4
// Display pictures from any user via ctrl-drag onto object in Second Life.

// PictureBoard Script // Original script by Cienna Rand // Retrieved from from Free SL Scripts on www.gendersquare.org/sl or www.freeSLscripts.com

// Chat commands: // next // back : advance to next picture : go back to previous picture

// slide N : advance automatically every N seconds (slideshow) // slide 0 : stop slideshow mode // purge : (owner only) purge dropped textures from inventory of board // Config Items // If TRUE, show name of image above the board, FALSE for no name integer showText = TRUE; // If showText is TRUE, text shown will be in this color vector textColor = <1,1,1>; // SCRIPT BEGINS - Do not modify unless you know what you're doing // integer curr = 0; list contents = ["Blank"]; setText(string text) { if (showText) llSetText(text, textColor, 1.0); } purge() { integer i = 0; integer n = llGetInventoryNumber(INVENTORY_TEXTURE); while (n > i) { string name = llGetInventoryName(INVENTORY_TEXTURE, i); if (name != "Blank") llRemoveInventory(name); else i++; n = llGetInventoryNumber(INVENTORY_TEXTURE); } curr = 0; contents = ["Blank"]; llSetTexture("Blank",1); llSetText("", <1,1,1>, 1.0); } back() { if (llGetListLength(contents) == 1) return; if (curr == 1) curr = llGetListLength(contents) - 1; else curr--; setText(llList2String(contents, curr)); llSetTexture(llList2String(contents, curr), 1); } next() { if (llGetListLength(contents) == 1) return; if (curr == llGetListLength(contents) - 1) curr = 1; else curr++; setText(llList2String(contents, curr)); llSetTexture(llList2String(contents, curr), 1); } help() { llWhisper(0, "Say 'next' to advance to the next picture."); llWhisper(0, "Say 'back' to go back to the previous picture."); llWhisper(0, "Say 'slide N' to automatically advance every N seconds (ex: slide 5)");

llWhisper(0, "Say 'slide 0' to stop slide show mode."); llWhisper(0, "Owner only: say 'purge' to clear textures from board's inventory."); } default { state_entry() { purge(); llListen(0, "", "", ""); llAllowInventoryDrop(TRUE); llSetColor(<0.2,0.2,0.2>, ALL_SIDES); llSetColor(<1,1,1>, 1); } on_rez(integer param) { llWhisper(0, "Say 'help' for commands."); } changed(integer change) { if ((change & CHANGED_INVENTORY) || (change & CHANGED_ALLOWED_DROP)) { integer count = llGetInventoryNumber(INVENTORY_TEXTURE); if (count > llGetListLength(contents)) // New Texture { integer i; for (i = 0; i < count; i++) { string name = llGetInventoryName(INVENTORY_TEXTURE, i); if (llListFindList(contents, [name]) == -1) { contents += name; jump break; } } @break; curr = llGetListLength(contents) - 1; string name = llList2String(contents, -1); setText(name); llSetTexture(name, 1); } } } listen(integer channel, string name, key id, string msg) { if (id == llGetOwner() && msg == "purge") { llWhisper(0, "Purging textures from my inventory."); purge(); } else if (msg == "back") { back(); } else if (msg == "next") { next(); } else if (msg == "help") { help(); } else if (llGetSubString(msg, 0, 4) == "slide") { llSetTimerEvent((float)llGetSubString(msg, 6,-1)); } } timer() { next(); } }

Normal Email script example


//Send an email from Second Life to a normal email account // Author unknown: // Retrieved from Free SL Scripts on http://www.gendersquare.org/sl string mail = "xxxxx@gmail.com"; //please fill in your own e-mail adress default { state_entry() { if(mail == "Hello, this is a test message from Second Life") mail = (string)llGetKey()+"@lsl.secondlife.com"; //Send an email to a normal email account llEmail( mail, "This is the subject line from state_entry!", "This is the body text generated from state_entry" ); } touch_start( integer num_detected ) { integer i = 0; //Send an email to the person who touched the prim do llEmail(mail, "This is de subject line from touch!", "This is the body text generated from touch. I was touched by: " + llDetectedName(i) + "\nKey: " + (string) llDetectedKey(i) ); while(++i < num_detected); } }

E-mailer Basic Script Hantar email melalui Second Life (Memang terbaik)
// Menu driven e-mailer. Sens emails from Second Life. Menu asks Addresse, Subject and Message to write in local chat.

//...........One Way Email Terminal.......... //.......Originally written by Doc Nerd......

// This Script is distributed under the terms of the modified BSD license, reproduced at the end of the script. // The license and acknowledgments listed must be included if this script is redistributed in a non-readable or non-modifiable form. // Retrieved from from Free SL Scripts on http://www.freeSLscripts.com or www.gendersquare.org/sl //..........Variable Block.......... key senderKey; string senderName; string eMail; string subject; string bodyText; list sendButtons = ["Yes", "No"]; list writeButtons; string removeButton; integer i;

//..........Modules Block.......... //..........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, "Please say the subject of your email."); //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, "Please say the message you would like to send."); //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, ["Subject"]); //Find "Subject" button in list. writeButtons = llDeleteSubList(writeButtons, i, i); //Remove it where it's found. } removeMessage() { i = llListFindList(writeButtons, ["Message"]); //Find "Message" button in list. writeButtons = llDeleteSubList(writeButtons, i, i); //Remove it where it's found. }

//..........Running script block.......... default { state_entry() { llSetObjectName("Nerd Gadgets Emailer 100"); //Makes sure the object is called the Nerd Gadgets Emailer 100. writeButtons = ["Address", "Subject", "Message"]; //Sets the llDialog buttons. llListen(67895, "", senderKey, "Yes"); //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, "Greetings " + senderName + ", would you like to send an email?", sendButtons, 67895); //Do you like me? Y/N } listen(integer channel, string name, key id, string message) { if(message == "Yes") //Starts email writing process. { llSay(0, "Currently being used by " + senderName + "."); //Tells area who's using terminal. state emailer; } if(message == "No") //Thank you, come again. { llSay(0, "Thank you " + senderName + ", for using the " + llGetObjectName()); } } } 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, "Address"); //Activate listeners. llListen(67895, "", senderKey, "Subject"); llListen(67895, "", senderKey, "Message"); llSetTimerEvent(30); //Gives user 30 seconds to choose a part to write... llSay(0, "You have 30 seconds to choose."); //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, "What part of your message would you like to write?", writeButtons, 67895); //Selection button GUI. } listen(integer channgel, string name, key id, string message) { if(message == "Address") //Select "Address" button. { state addressWrite; //Enter address writing state. } else if(message == "Subject") //Select "Subject" button. {

state subjectWrite; //Enter subject writing state. } else if(message == "Message") //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, "User has failed to select option in time. Unit is now available for use or retry."); llSetText("",<0,0,0>, 0); //Removes floating text. 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 = "Address"; //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 = "Subject"; //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 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 = "Message"; //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, "User has failed to enter information quickly enough. Please try again."); state emailer; }

} state remainButton //Removing buttons from a list SUCKS! { state_entry() { if(removeButton == "Address") //Removes "Address" button. { removeAddress(); state emailer; } else if(removeButton == "Subject") //Removes "Subject" button. { removeSubject(); state emailer; } else if(removeButton == "Message") //Removes "Message" button. { removeMessage(); state emailer; } } } state sendMail { state_entry() { llListen(67895, "", senderKey, "Yes"); //Starts listeners. llListen(67895, "", senderKey, "No"); llSay(0, "Your email reads as the followed:"); //Spews out the actual email message. llSay(0, eMail); llSay(0, subject); llSay(0, bodyText); llDialog(senderKey, "Do you wish to send this message?", sendButtons, 67895); //Do you like me? Y/N } listen(integer channel, string name, key id, string message) { if(message == "Yes") //You like me! You really like me! { llSay(0, "I hope you don't mind " + senderName + ", but I will have to assume your name for a moment to send this email."); //Tell user the terminal will change it's name for proper "From" headings in inbox. llSay(0, "Your email will be sent in 20 seconds."); //Tells user email will be sent in 20 seconds (delay of llEmail function call to script). llSay(0, "Thank you " + senderName + ", for using the " + llGetObjectName()); //Thank you, come again. llSetText("", <0,0,0>, 0); //Removes "busy signal". llSetObjectName(senderName); //Change to user's name. llEmail(eMail, subject, bodyText); //Send that damn thing already! state default; //Return to normal. } else if(message == "No") //You don't like me? *emo tear* { llSay(0, "Thank you " + senderName + ", for using the " + llGetObjectName()); //Thank you, come again. llSetText("", <0,0,0>, 0); //Removes "busy signal". state default; //Return to normal. } } }

//Copyright (c) 2005, Doc Nerd & player //All rights reserved. // //Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: // // // // // * Redistributions in modifiable form must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in non-modifiable form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials * Neither the name of Doc Nerd nor his player may be used to endorse or promote products derived from this software without specific prior written permission.

provided with the distribution.

You might also like