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
Merchant Tools Verify_Item_Received_when_rezzed  

Verify_Item_Received_when_rezzed

Verify_Item_Received_when_rezzed

Category: Merchant Tools
By : Ferd Frederix
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for Verify_Item_Received_when_rezzed
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Verify_Item_Received_when_rezzed_1.lsl

This script by Ferd Frederix may be used in any manner, modified, and republished.  Unless specified otherwise, my scripts are always free and open source.  Objects made with these scripts may be sold with no restrictions.  All I ask is that you point others to this location should they ask you about it and to not sell this script, unless it is for $0 L. Please help improve my work by reporting bugs and improvements.

1 Somebody posted some scripts recently that will send an email when an item is rezzed in world another will send an email when an item is unpacked. Not sure if I found this on Xstreet or someone else's site but this is what was there, haven't tested it yet might help you if they work.
2
3 My Apologies for not having the script writers name.
4 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5 okay - i think my first time posting code, so sorry if i get this messy the first couple tries...
6 after what seems to be a standing ovation of indifference... i am posting open-source my latest .
7 product packaging. i've yet to fully install this in my own inventory, but tests so far seem to work
8 out.
9
10 used in a packed-up product prim (three times fast!),
11 -zPackaging offers some helpful floating text for the customer, if they're newbish.
12 it also triggers off calls in two other (completely optional) scripts...
13 -PackagingReceipt1 (which sends a 'rezzed' email when the package is dragged out of the user's
14 inventory), and
15 -PackagingReceipt2 (which sends its email message when the prim is unpacked).
16
17 this uses three scripts primarily to make up for email's scriptlag.
18 (additionally, as i only wish to receive each notice only once, each receipt script will
19 delete itself after use.)
20
21 //////////////////////////////////////////////////////////////////////////////////////
22 ///////////// SCRIPT 1 OF 3 SCRIPT 1 OF 3 SCRIPT 1 OF 3 SCRIPT 1 OF 3 ////////////////
23 //////////////////////////////////////////////////////////////////////////////////////
24
25 // -zPackaging
26
27 // package 'phones home' (emails message)
28 // 1) email on-rez - would apply to attachement or ground rez i think - great
29 // 2) email on inventory change - will this work upon avi unpacking a set?? - even better!!
30 // INVENTORY CHANGE DOES NOT TRIGGER on open/copy to inventory! so, use a timer. :\
31
32 // my own touch-controlled transfer, instead of prim-open?
33 // CANNOT USE llGiveInventoryList instead of open/copy or contents drag, 'cuz that seems restricted to full-perm stuff.
34
35 // this script can act as a standalone for floating text handling; just remove one or the other (or both) receipt scripts if you don't want to use them.
36
37 // this scripts are DISARMED by default for the creator to use and modify - no email will be sent; scripts will not self-destruct. only when the prim changes hands to a different owner will they activate. (i have some test booleans, but the logics may need cleaned up for them to work.)
38
39 // all three scripts should be set to no modify, copy, no transfer to work properly. (copy scripts prevents them from being removed before completing their process.
40
41 // ALTHOUGH THESE ARE INTENDED FOR OPEN-SOURCE, DO NOT RELEASE MODIFIABLE COPIES OF YOUR PACKAGED RECEIPT SCRIPTS!! you may be giving away whichever email address you are using included in the script. when exchanging copies, be sure your email address is deleted!!
42
43 // 071001 - NEW!! patching in Cubey Terra's ingenious 'detach if worn' script. very handy, and saves me all that nasty extra floating text i use...
44
45 //these are the 'most important' vars to change; read the script to change any scriptnames or linkmessage num hooks.
46 string STRownerTest="Avatar Name";
47
48 integer INTinventoryCount;
49 integer BLNtesting;//=TRUE;
50
51 testMessage(string STRmsg){//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
52 integer INTmemory=llGetFreeMemory();
53 if(BLNtesting==TRUE){
54 string STRtestAppend=llGetScriptName()+
55 "\ttime: "+(string)llGetTime()+
56 "\tmem: "+(string)INTmemory+
57 "\t"+STRmsg+"|";
58 llOwnerSay(STRtestAppend);
59 }
60 integer INTlowMemWarning=500;
61 if(INTmemory<INTlowMemWarning){
62 llOwnerSay(llGetScriptName()+"!!! LOW MEMORY WARNING: LESS THAN "+(string)INTlowMemWarning+"bytes!! "+(string)INTlowMemWarning);//also email home a warning??
63 }
64 }//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
65 resetAll(){//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
66 testMessage("resetAll");
67 string STRtext=llKey2Name(llGetOwner()) + "'s";
68 if(INTinventoryCount>inventoryCount() || inventoryCount()==0){
69 llMessageLinked(LINK_THIS, 924, "-PackagingReceipt2", NULL_KEY);
70 if(inventoryCount()==0){
71 STRtext=STRtext+"\nEMPTY PACKAGE :\\";
72 STRtext=STRtext+"\nDon't be a litterbug!! ";
73 STRtext=STRtext+"\nRight-click 'MORE-DELETE'!! ";
74 llSetText(STRtext, <1,1,1>, 1.0); //Display the string in solid black.
75 llMessageLinked(LINK_THIS, 927, "-Nyoko'sPackagingFX", NULL_KEY);//sending this extra trigger out to my 'special effects' script
76 llSleep(1.0);
77 deleteScripts();
78 }else{
79 STRtext=STRtext+"\n"+llGetObjectName();// + "\n---\n";
80 STRtext=STRtext+"\n-";
81 STRtext=STRtext+"\nALMOST THERE!! ";
82 STRtext=STRtext+"\nBe sure to drag";
83 STRtext=STRtext+"\neverything from 'contents.'";
84 llSetText(STRtext, <1,1,1>, 1.0); //Display the string in solid black.
85 llMessageLinked(LINK_THIS, 927, "-Nyoko'sPackagingFX", NULL_KEY);//sending this extra trigger out to my 'special effects' script
86 llSetTimerEvent(1.0);
87 }
88 }else{
89 STRtext=STRtext+"\n"+llGetObjectName();// + "\n---\n";
90 STRtext=STRtext+"\n-";
91 // STRtext=STRtext+"\n1) If you are holding the package,";
92 // STRtext=STRtext+"\nright-click 'DROP' ";
93 // STRtext=STRtext+"\n-";
94 STRtext=STRtext+"\nCLICK ME, or right-click 'OPEN'";
95 STRtext=STRtext+"\nthen 'COPY TO INVENTORY'!";
96 llSetText(STRtext, <1,1,1>, 1.0); //Display the string in solid black.
97 llMessageLinked(LINK_THIS, 923, "-PackagingReceipt1", NULL_KEY);
98 // llMessageLinked(LINK_THIS, 927, "-Nyoko'sPackagingFX", NULL_KEY);//sending this extra trigger out to my 'special effects' script
99 llSetTimerEvent(1.0);
100 }
101 INTinventoryCount=inventoryCount();
102 //text has a length limit of 255 characters.
103 testMessage("chars leftover: "+(string)(255-llStringLength(STRtext)));
104 }//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
105 integer inventoryCount(){
109 }
110 deleteScripts(){//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
111 if(llKey2Name(llGetOwner())!=STRownerTest){
112 if(llGetInventoryType("-PackagingReceipt1")!=INVENTORY_NONE){
113 llRemoveInventory("-PackagingReceipt1"); // delete this script
114 }
115 if(llGetInventoryType("-PackagingReceipt2")!=INVENTORY_NONE){
116 llRemoveInventory("-PackagingReceipt2"); // delete this script
117 }
118 testMessage("DELETING script. bb!! ");
119 llRemoveInventory(llGetScriptName()); // delete this script
120 }
121 }
122 default{//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
123 on_rez(integer start_param){//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
124 testMessage("default/on_rez");
126 }
128 testMessage("default/state_entry");
129 if(llKey2Name(llGetCreator())!=STRownerTest){//self-destruct
130 testMessage("i would be DELETING script (this prim was not created by me).");// bb!! ");
131 // deleteScripts();
132 // it seems that in laggier areas that the time to call up llGetCreator overtakes the logictest,
133 // and always seems to just come out TRUE (even though it is the original package that works just fine
134 // in quieter areas... advice??
135 }
136 if(llGetAttached()){ // llGetAttached returns non-zero if attached
137 // Must get perms before detaching. Attach/detach perms are given automatically (no blue popup) b/c the item is attached.
138 llRequestPermissions(llGetOwner(),PERMISSION_ATTAC H);
139 }
140 resetAll();
141 }
143 if(perm & PERMISSION_ATTACH){
144 llOwnerSay("PRIVATE MESSAGE: To prevent accidental loss, do not wear this item. Instead, drag it from your inventory onto the ground.");
146 }
147 }
148 changed(integer change){
149 testMessage("default/changed");
150 if(change==CHANGED_INVENTORY){
151 testMessage("My inventory has changed...");
152 resetAll();
153 }
154 }
155 timer() {
156 // testMessage("default/timer");
157 if(INTinventoryCount!=inventoryCount()){
158 testMessage("default/timer INSIDE");
159 llSetTimerEvent(0.0);
160 resetAll();
161 }
162 }// \\\\\\\\\\\\\\\
163 link_message(integer sender_num, integer num, string str, key id){//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
164 if(str==llGetScriptName()){
165 testMessage("default/link_message");
166 //these hooks allow for quicker deletion of the emailing scripts. so far i haven't had the amount of sleeptime
167 //overtake the emailing script, but that may happen in very crowded sims. advice??
168 if(num==925){
169 llSleep(1.0);
170 testMessage("DELETING script sPackagingReceipt1. bb!! ");
171 llRemoveInventory("-PackagingReceipt1"); // delete this script
172 }else if(num==926){
173 llSleep(1.0);
174 testMessage("DELETING script sPackagingReceipt2. bb!! ");
175 llRemoveInventory("-PackagingReceipt2"); // delete this script
176 }
177 }
178 }//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
179 }//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
180
181 //////////////////////////////////////////////////////////////////////////////////////
182 ///////////// SCRIPT 2 OF 3 SCRIPT 2 OF 3 SCRIPT 2 OF 3 SCRIPT 2 OF 3 ////////////////
183 //////////////////////////////////////////////////////////////////////////////////////
184
185 // -PackagingReceipt1
186
187 //these are the 'most important' vars to change; read the script to change any scriptnames or linkmessage num hooks.
188 string STRownerTest="Avatar Name";
189 string STRownerEmail="your.email@home.com";
190
191 string STRmessage="rezzed";
192 string STRowner;
193 integer BLNemailCreator;//=TRUE;
194 integer BLNtesting;//=TRUE;//testing toggle, set FALSE for rollout.
195
196 testMessage(string STRmsg){//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
197 integer INTmemory=llGetFreeMemory();
198 if(BLNtesting==TRUE){
199 string STRtestAppend=llGetScriptName()+
200 "\ttime: "+(string)llGetTime()+
201 "\tmem: "+(string)INTmemory+
202 "\t"+STRmsg+"|";
203 llOwnerSay(STRtestAppend);
204 }
205 integer INTlowMemWarning=500;
206 if(INTmemory<INTlowMemWarning){
207 llOwnerSay(llGetScriptName()+"!!! LOW MEMORY WARNING: LESS THAN "+(string)INTlowMemWarning+"bytes!! "+(string)INTlowMemWarning);//also email home a warning??
208 }
209 }//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
210 sendEmail(){
211 if(llKey2Name(llGetOwner())!=STRownerTest || BLNemailCreator){
212 STRowner=llKey2Name(llGetOwner());//saving this to prevent accidental script deletion...
213 //may rerun the sequence if owners are different?? otherwise whole thing may stall on occassion...
214 string STRtemp;//=" Package contents:\n";
215
217 string STRname=llGetInventoryName(INVENTORY_ALL, INTcount);
218 while(STRname!=""){
219 STRtemp=STRtemp+"\n"+STRname;
220 INTcount=INTcount+1;
221 STRname=llGetInventoryName(INVENTORY_ALL, INTcount);
222 }
223 string STRsubject=llKey2Name(llGetOwner())+"-"+llGetObjectName()+" "+STRmessage;
224 testMessage("NOW PAUSING FOR emailing STRsubject="+STRsubject);
225 llMessageLinked(LINK_THIS, 925, "-zPackaging", NULL_KEY);
226 llEmail(STRownerEmail, STRsubject, STRsubject+"\n"+STRtemp);
227 deleteScript();
228 }else{
229 testMessage("SKIPPING EMAIL rezzed...");
230 }
231 }
232 deleteScript(){//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
233 if(llKey2Name(llGetOwner())!=STRownerTest && llKey2Name(llGetOwner())==STRowner){
234 testMessage("DELETING script. bb!! ");
235 llRemoveInventory(llGetScriptName()); // delete this script
236 }else{
237 testMessage("SKIPPING script deletion");
238 if(llKey2Name(llGetOwner())!=STRowner){
239 sendEmail();
240 }
241 }
242 }//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
243 default{//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
244 on_rez(integer start_param){//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
245 testMessage("default/on_rez");
247 }//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
248 state_entry(){//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
249 testMessage("default/state_entry");
250 //check for other scripts; self-destruct if the others are not present...
251 //llGetCreator call is 'laggy'?? :\ always comes up TRUE
252 if(llKey2Name(llGetCreator())!=STRownerTest){
253 testMessage("i would be DELETING script (this prim was not created by me).");// bb!! ");
254 // deleteScript();
255 }
257 // || llGetInventoryType("-PackagingReceipt2")==INVENTORY_NONE
258 ){
259 testMessage("DELETING script (i can't find a fellow script). bb!! ");
260 deleteScript();
261 }
262 }//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
263 link_message(integer sender_num, integer num, string str, key id){//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
264 if(str==llGetScriptName()){
265 testMessage("default/link_message");
266 if(num==923){
267 sendEmail();
268 }
269 }
270 }//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
271 }//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
272
273 //////////////////////////////////////////////////////////////////////////////////////
274 ///////////// SCRIPT 3 OF 3 SCRIPT 3 OF 3 SCRIPT 3 OF 3 SCRIPT 3 OF 3 ////////////////
275 //////////////////////////////////////////////////////////////////////////////////////
276
277 // -PackagingReceipt2
278
279 //these are the 'most important' vars to change; read the script to change any scriptnames or linkmessage num hooks.
280 string STRownerTest="Avatar Name";
281 string STRownerEmail="your.email@home.com";
282
283 string STRmessage="unpacked";
284 string STRowner;
285 integer BLNemailCreator;//=TRUE;
286 integer BLNtesting;//=TRUE;//testing toggle, set FALSE for rollout.
287
288 testMessage(string STRmsg){//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
289 integer INTmemory=llGetFreeMemory();
290 if(BLNtesting==TRUE){
291 string STRtestAppend=llGetScriptName()+
292 "\ttime: "+(string)llGetTime()+
293 "\tmem: "+(string)INTmemory+
294 "\t"+STRmsg+"|";
295 llOwnerSay(STRtestAppend);
296 }
297 integer INTlowMemWarning=500;
298 if(INTmemory<INTlowMemWarning){
299 llOwnerSay(llGetScriptName()+"!!! LOW MEMORY WARNING: LESS THAN "+(string)INTlowMemWarning+"bytes!! "+(string)INTlowMemWarning);//also email home a warning??
300 }
301 }//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
302 sendEmail(){
303 if(llKey2Name(llGetOwner())!=STRownerTest || BLNemailCreator){
304 STRowner=llKey2Name(llGetOwner());//saving this to prevent accidental script deletion...
305 //may rerun the sequence if owners are different?? otherwise whole thing may stall on occassion...
306 string STRtemp;
307
308 integer INTcount;
309 string STRname=llGetInventoryName(INVENTORY_ALL, INTcount);
310 while(STRname!=""){
311 STRtemp=STRtemp+"\n"+STRname;
312 INTcount=INTcount+1;
313 STRname=llGetInventoryName(INVENTORY_ALL, INTcount);
314 }
315 string STRsubject=llKey2Name(llGetOwner())+"-"+llGetObjectName()+" "+STRmessage;
316 testMessage("NOW PAUSING FOR emailing STRsubject="+STRsubject);
317 llMessageLinked(LINK_THIS, 926, "-zPackaging", NULL_KEY);
318 llEmail(STRownerEmail, STRsubject, STRsubject+"\n"+STRtemp);
319 deleteScript();
320 }else{
321 testMessage("SKIPPING EMAIL unpacked...");
322 }
323 }
324 deleteScript(){//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
325 if(llKey2Name(llGetOwner())!=STRownerTest && llKey2Name(llGetOwner())==STRowner){
326 testMessage("DELETING script. bb!! ");
327 llRemoveInventory(llGetScriptName()); // delete this script
328 }else{
329 testMessage("SKIPPING script deletion");
330 if(llKey2Name(llGetOwner())!=STRowner){
331 sendEmail();
332 //THE REASON for this loopy process with STRowner is the email delay - if the package is perhaps taken to inventory during the pause after emailing, then given to another person, the script will continue from its delayed state and potentially delete itself without registering that its owner has changed.
333
334 //deleting the script isn't meant to be sneaky or surreptitious; it's only to keep from being 'spammed' by loose/emptied packages, script tweakers, etc.
335 }
336 }
337 }//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
338 default{//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
339 on_rez(integer start_param){//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
340 testMessage("default/on_rez");
342 }//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
343 state_entry(){//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
344 testMessage("default/state_entry");
345 //check for other scripts; self-destruct if the others are not present...
346 //again, these llGetCreator calls seem to be laggy and can be TRUE even though using the original package...
347 if(llKey2Name(llGetCreator())!=STRownerTest){
348 testMessage("i would be DELETING script (this prim was not created by me).");// bb!! ");
349 // deleteScript();
350 }
351 if(llGetInventoryType("-zPackaging")==INVENTORY_NONE){
352 testMessage("DELETING script (i can't find a fellow script). bb!! ");
353 deleteScript();
354 }
355 }//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
356 link_message(integer sender_num, integer num, string str, key id){//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
357 if(str==llGetScriptName()){
358 testMessage("default/link_message");
359 if(num==924){
360 sendEmail();
361 }
362 }
363 }//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
364 }//\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

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