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
Rezzers Rezzer_with_extended_menu  

Rezzer_with_extended_menu

Rezzer_with_extended_menu

Category: Rezzers
By : anonymous
Created: 2011-08-24 Edited: 2011-08-24
Worlds: Second Life

the Zip file

Download all files for Rezzer_with_extended_menu
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Rezzer_with_extended_menu_1.lsl
1 //start of script
2
3 // Global constants - should be changed if there are any other holo-emitters in the sim, both here and in all other scripts
4 integer delete_channel = -1110020;
5 integer menu_channel = -2220020;
6 integer HE_channel = -3330020;
7 // Global variables
8
9 integer menu_listen;
10 integer menuPosition;
11
12 key Avatar; // the last person who touched this;
13
14 clear_scene()
15 {
16 llRegionSay(delete_channel, "delete"); // Sends a "delete" message to the entire sim on the delete_channel
17 }
18
19 Menu()
20 {
21 // Generate the menu of scenes by scanning the holo-emitter's inventory
22 list options = ["Clear"]; // even if there are no scenes in the holo-emitter, one option is always to clear the scene
23
24 integer num_scenes = llGetInventoryNumber(INVENTORY_OBJECT); // = number of objects in the holo-emitter's inventory
25 if(menuPosition >= 9) // add a back button if we are past the 1st menu
26 options += "<<<";
27 else
28 options += "-";
29
30 if(num_scenes > menuPosition+9) // add a forward button if there are more scene
31 options += ">>>";
32 else
33 options += "-";
34
35 if(num_scenes>0)
36 {
37 integer scene_nbr = menuPosition;
38 for ( ; scene_nbr<num_scenes; scene_nbr++)
39 {
40 options = options + [llGetInventoryName(INVENTORY_OBJECT, scene_nbr)]; // appends another scene to the list of options
41 }
42 }
43 options = llDeleteSubList(options,12,999); // kill off the ends
44
45 llDialog(Avatar, "Select the scene you would like to see:", options, menu_channel);
46
47
48 }
49
50 default
51 {
53 {
54 llSay(0,"Ready");
55 llListen(HE_channel,"",NULL_KEY,"ping");
56 menuPosition = 0;
57 menu_listen = llListen(menu_channel, "", "", "");
58 }
59
60 touch_start(integer total_number)
61 {
62 Avatar = llDetectedKey(0);
63 Menu();
64 }
65
66 listen(integer channel, string name, key id, string message)
67 {
68 if((channel==HE_channel) && (message=="ping"))
69 {
70 //llSay(0,"I heard a ping, so I'm replying with my position now (on the HE_channel).");
71 vector HE_pos = llGetPos(); // = holo-emitter position <x,y,z>
72 string str = (string)HE_pos.x+","+(string)HE_pos.y+","+(string)HE_pos.z;
73 llRegionSay(HE_channel, str);
74 //llSay(0,"My position string is "+str);
75 }
76 else if(channel==menu_channel)
77 {
78 if(message=="Clear")
79 {
80 clear_scene();
81 Menu();
82 }
83 else if(message=="<<<")
84 {
85 menuPosition -= 9;
86 if(menuPosition <0)
87 menuPosition = 0;
88 Menu();
89 }
90 else if(message==">>>")
91 {
92 menuPosition += 9;
93 Menu();
94 }
95 else // message = the name of the scene-container to rez
96 {
97 clear_scene();
98 llRezAtRoot(message, <0.0,0.0,9.0>+llGetPos(), ZERO_VECTOR, ZERO_ROTATION, 1);
99 }
100 }
101 }
102 }

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