Join us in Outworldz at www.outworldz.com:9000 or follow us:

Search dozens of selected web sites for OpenSim and LSL script

New! Script Meta-Search will search thousands of scripts here and at other sites for LSL or Opensim scripts.
Loading

Want to add a script or a project? Upload it and a half million people will see it and your name here this year.

Home   Show All
Category: Contributor: Creator
Email SL_Email_Terminal  

SL_Email_Terminal

Instructions

* Open your inventory
* Choose New Script and rename it email script
* Copy the script below, doubleclick the email script in SL and paste
* Click Build on the bottom bar and the Create in the menu
* Use your magic wand to place an object on the ground
* Right click the object and choose Edit
* Rename the object My Emailer
* Drag your email script into the object
* Right click the object and choose Take
* Just drag the My Emailer object out and touch it to send emails

Category: Email
By : Doc Nerd
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for SL_Email_Terminal
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. SL_Email_Terminal_1.lsl
1 //...........One Way Email Terminal..........
2 //.......Originally written by Doc Nerd......
3 // This Script is distributed under the terms
4 // of the modified BSD license, reproduced at
5 // the end of the script. The license and
6 // acknowledgments listed must be included if
7 // this script is redistributed in a
8 // non-readable or non-modifiable form.
9
10
11 //..........Variable Block..........
12 key senderKey;
13 string senderName;
14 string eMail;
15 string subject;
16 string bodyText;
17 list sendButtons = ["Yes", "No"];
18 list writeButtons;
19 string removeButton;
20 integer i;
21
22
23 //..........Modules Block..........
24
25 //..........Modules for writing each part of email..........
26 writeAddress()
27 {
28 llListen(0, "", senderKey, ""); //Listen to what the user says.
29 llSay(0, "Please say the address of whom you are sending your email."); //Tell them what to say.
30 llSetTimerEvent(30); //Give them 30 seconds to say it.
31 }
32
33 writeSubject()
34 {
35 llListen(0, "", senderKey, ""); //Listen to what the user says.
36 llSay(0, "Please say the subject of your email."); //Tell them what to say.
37 llSetTimerEvent(30); //Give them 30 seconds to say it.
38 }
39
40 writeBody()
41 {
42 llListen(0, "", senderKey, ""); //Listen to what the user says.
43 llSay(0, "Please say the message you would like to send."); //Tell them what to say.
44 llSetTimerEvent(120); //Give them 120 seconds (2 minutes) to say it.
45 }
46
47
48 //..........Modules to remove buttons already used in llDialog menu..........
49 removeAddress()
50 {
51 i = llListFindList(writeButtons, ["Address"]); //Find "Address" button in list.
52 writeButtons = llDeleteSubList(writeButtons, i, i); //Remove it where it's found.
53 }
54
55 removeSubject()
56 {
57 i = llListFindList(writeButtons, ["Subject"]); //Find "Subject" button in list.
58 writeButtons = llDeleteSubList(writeButtons, i, i); //Remove it where it's found.
59
60 }
61
62 removeMessage()
63 {
64 i = llListFindList(writeButtons, ["Message"]); //Find "Message" button in list.
65 writeButtons = llDeleteSubList(writeButtons, i, i); //Remove it where it's found.
66 }
67
68
69 //..........Running script block..........
70 default
71 {
73 {
74 llSetObjectName("Nerd Gadgets & Scripting Emailer 100"); //Makes sure the object is called the Nerd Gadgets Emailer 100.
75 writeButtons = ["Address", "Subject", "Message"]; //Sets the llDialog buttons.
76 llListen(67895, "", senderKey, "Yes"); //Activate listeners.
77 llListen(67895, "", senderKey, "No");
78 }
79
80 touch_start(integer total_number)
81 {
82 senderKey = llDetectedKey(0); //Detects who's touching it, to get a raw key.
83 senderName = llKey2Name(llDetectedKey(0)); //Detects who's touching it, to get a name.
84 llDialog(senderKey, "Greetings " + senderName + ", would you like to send an email?", sendButtons, 67895); //Do you like me? Y/N
85 }
86
87 listen(integer channel, string name, key id, string message)
88 {
89 if(message == "Yes") //Starts email writing process.
90 {
91 llSay(0, "Currently being used by " + senderName + "."); //Tells area who's using terminal.
92 state emailer;
93 }
94 if(message == "No") //Thank you, come again.
95 {
96 llSay(0, "Thank you " + senderName + ", for using the " + llGetObjectName());
97 }
98 }
99 }
100
101 state emailer
102 {
104 {
105 if(writeButtons == []) //Check to see if there's anything left to write in the email.
106 {
107 state sendMail; //If not, move to sending module.
108 }
109 llListen(67895, "", senderKey, "Address"); //Activate listeners.
110 llListen(67895, "", senderKey, "Subject");
111 llListen(67895, "", senderKey, "Message");
112 llSetTimerEvent(30); //Gives user 30 seconds to choose a part to write...
113 llSay(0, "You have 30 seconds to choose."); //Informs user they have 30 seconds to choose.
114 llSetText("In use, please wait.", <255,0,0>, .1); //Gives visual cue to others that no one else can use it right now.
115 llDialog(senderKey, "What part of your message would you like to write?", writeButtons, 67895); //Selection button GUI.
116 }
117
118 listen(integer channgel, string name, key id, string message)
119 {
120 if(message == "Address") //Select "Address" button.
121 {
122 state addressWrite; //Enter address writing state.
123 }
124 else if(message == "Subject") //Select "Subject" button.
125 {
126 state subjectWrite; //Enter subject writing state.
127 }
128 else if(message == "Message") //Select "Message" button.
129 {
130 state messageWrite; //SEnter message writing state.
131 }
132 }
133
134 timer() //After 30 seconds are up, time out, and return to default state.
135 {
137 llSay(0, "User has failed to select option in time. Unit is now available for use or retry.");
138 llSetText("",<0,0,0>, 0); //Removes floating text.
139 state default;
140 }
141
142 }
143
144 state addressWrite
145 {
147 {
148 writeAddress(); //Start address writing module.
149 }
150
151 listen(integer channel, string name, key id, string message)
152 {
153 eMail = message; //Save message user said.
154 removeButton = "Address"; //Set variable for button removal.
155 state remainButton; //Enter button removal process state.
156 }
157
158 timer() //After 30 seconds are up, time out, and return to selection state.
159 {
161 llSay(0, "User has failed to enter information quickly enough. Please try again.");
162 state emailer;
163 }
164 }
165
166 state subjectWrite
167 {
169 {
170 writeSubject(); //Start subject writing module.
171 }
172
173 listen(integer channel, string name, key id, string message)
174 {
175 subject = message; //Save message user said.
176 removeButton = "Subject"; //Set variable for button removal.
177 state remainButton; //Enter button removal process state.
178 }
179
180 timer() //After 30 seconds are up, time out, and return to selection state.
181 {
183 llSay(0, "User has failed to enter information quickly enough. Please try again.");
184 state emailer;
185 }
186 }
187
188 state messageWrite
189 {
191 {
192 writeBody(); //Start message writing module.
193 }
194
195 listen(integer channel, string name, key id, string message)
196 {
197 bodyText = message; //Save what the user said.
198 removeButton = "Message"; //Set variable for button removal.
199 state remainButton; //Enter button removal process state.
200 }
201
202 timer() //After 120 seconds (2 minutes) are up, time out, and return to selection state.
203 {
205 llSay(0, "User has failed to enter information quickly enough. Please try again.");
206 state emailer;
207 }
208 }
209
210 state remainButton //Removing buttons from a list SUCKS!
211 {
213 {
214 if(removeButton == "Address") //Removes "Address" button.
215 {
216 removeAddress();
217 state emailer;
218 }
219 else if(removeButton == "Subject") //Removes "Subject" button.
220 {
221 removeSubject();
222 state emailer;
223 }
224 else if(removeButton == "Message") //Removes "Message" button.
225 {
226 removeMessage();
227 state emailer;
228 }
229 }
230 }
231
232 state sendMail
233 {
235 {
236 llListen(67895, "", senderKey, "Yes"); //Starts listeners.
237 llListen(67895, "", senderKey, "No");
238 llSay(0, "Your email reads as the followed:"); //Spews out the actual email message.
239 llSay(0, eMail);
240 llSay(0, subject);
241 llSay(0, bodyText);
242 llDialog(senderKey, "Do you wish to send this message?", sendButtons, 67895); //Do you like me? Y/N
243 }
244
245 listen(integer channel, string name, key id, string message)
246 {
247 if(message == "Yes") //You like me! You really like me!
248 {
249 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.
250 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).
251 llSay(0, "Thank you " + senderName + ", for using the " + llGetObjectName()); //Thank you, come again.
252 llSetText("", <0,0,0>, 0); //Removes "busy signal".
253 llSetObjectName(senderName); //Change to user's name.
254 llEmail(eMail, subject, bodyText); //Send that damn thing already!
255 state default; //Return to normal.
256 }
257 else if(message == "No") //You don't like me? *emo tear*
258 {
259 llSay(0, "Thank you " + senderName + ", for using the " + llGetObjectName()); //Thank you, come again.
260 llSetText("", <0,0,0>, 0); //Removes "busy signal".
261 state default; //Return to normal.
262 }
263 }
264 }
265
266
267 //Copyright (c) 2005, Doc Nerd & player
268 //All rights reserved.
269 //
270 //Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
271 //
272 // * Redistributions in modifiable form must retain the above copyright notice, this list of conditions and the following disclaimer.
273 // * 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 provided with the distribution.
274 // * 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.
275 //
276 //THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Back to the Best Free Tools in Second Life and OpenSim.