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
Inventory Giver Unpacker_With_Status_Check  

Unpacker_With_Status_Check

The only things you'll need to change ar...

Category: Inventory Giver
By : Bastian McConach
Created: 2013-04-19 Edited: 2013-04-19
Worlds: Second Life

the Zip file

Download all files for Unpacker_With_Status_Check
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Unpacker_With_Status_Check_1.lsl
1 integer menu_handler;
2 integer menu_channel;
3 key creator_key = "00000000-0000-0000-0000-000000000000";
4 key creator_query;
5 key owner;
6 string creator_status;
7
8 menu(key user,string title,list buttons)
9 {
10 menu_channel = (integer)(llFrand(99999.0) * -1);
11 menu_handler = llListen(menu_channel,"","","");
12 llDialog(user,title,buttons,menu_channel);
13 llSetTimerEvent(30.0);
14 }
15
16 default
17 {
18 on_rez(integer times)
19 {
20 creator_query = llRequestAgentData(creator_key, DATA_ONLINE);
21 owner = llGetOwner();
22 menu(owner,"Thank you for your purchase!\n\nUnpack - Give a folder with your purchase\nStatus - Check if Creator's online.",["Unpack","Status"]);
23 }
24
26 {
27 creator_query = llRequestAgentData(creator_key, DATA_ONLINE);
28 owner = llGetOwner();
29 }
30
31 timer()
32 {
33 llSetTimerEvent(0.0);
34 llListenRemove(menu_handler);
35 }
36
37 listen(integer channel,string name,key id,string message)
38 {
39 if(channel == menu_channel)
40 {
41 if(message == "Unpack")
42 {
43 list contents_list;
44 string contents_name;
46 string folderName = llGetObjectName();
47 integer i;
48 for (i = 0; i < contents_num; ++i)
49 {
50 contents_name = llGetInventoryName(INVENTORY_ALL, i);
51 contents_list += contents_name;
52 }
53 i = llListFindList(contents_list, [llGetScriptName()]);
54 contents_list = llDeleteSubList(contents_list, i, i);
55 llGiveInventoryList(llGetOwner(), folderName, contents_list);
56 if(creator_status == "online")
57 {
58 llInstantMessage(llGetOwner(), "Look in your inventory for a folder called \"" + folderName + "\". This folder contains your purchase. If you have any problems, please don't hesitate to contact Creator Name. They're online at the moment, so send them an IM before they dive into their next project!");
59 }
60 else if(creator_status == "offline")
61 {
62 llInstantMessage(llGetOwner(), "Look in your inventory for a folder called \"" + folderName + "\". This folder contains your purchase. If you have any problems, please don't hesitate to contact Creator Name. They're not online at the moment, so you should send them a notecard before their deliveries cap!");
63 }
64 }
65 else if(message == "Status")
66 {
67 creator_query = llRequestAgentData(creator_key, DATA_ONLINE);
68 if(creator_status == "online")
69 {
70 llInstantMessage(owner, "Creator Name is online at the moment. If you need assistance, be sure to IM them before they begin work on their next project!");
71 }
72 else if(creator_status == "offline")
73 {
74 llInstantMessage(owner, "Creator Name is offline at the moment. If you need assistance, drop a notecard on them and they'll get back to you before they begin work on their next project!");
75 }
76 }
77 }
78 }
79
80 touch_start(integer total_number)
81 {
82 owner = llGetOwner();
83 if(llDetectedKey(0) == owner)
84 {
85 menu(owner,"Thank you for your purchase!\n\nUnpack - Give a folder with your purchase\nStatus - Check if Creator's online.",["Unpack","Status"]);
86 }
87 else
88 {
89 llInstantMessage(llDetectedKey(0), "Sorry, but this package isn't yours! If you really want one of your own, check out Creator Name's store!");
90 }
91 }
92
93 dataserver(key queryid, string data)
94 {
95 if(creator_query == queryid)
96 {
97 if( data == "1" )
98 {
99 creator_status = "online";
100 }
101 else if(data == "0")
102 {
103 creator_status = "offline";
104 }
105 }
106 }
107 }

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