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
Dialog Formatted_Sensor_Dialog  

Formatted_Sensor_Dialog

Formatted Sensor Dialog script by Evil Fool.lsl

Category: Dialog
By : Evil Fool
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for Formatted_Sensor_Dialog
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Formatted_Sensor_Dialog_script_by_E_1.lsl
1
2 //Formatted Sensor Dialog script by Evil Fool
3 // You may give this script away for free, but please leave creator information in.
4 // Next owner MUST have script modify access if any of this code is used in part or whole
5 //CONFIG
6 integer gOwnerOnly = FALSE;
7 integer gChann = -293190;
8 integer gStride = 9;
9 //END CONFIG
10
11 list names;
12 integer gPos = 0;
13 key tReq;
14
15 dialog(key id)
16 {
17 integer nTop = gPos + gStride - 1;
18 list buttons = llList2List(names, gPos, nTop);
19 string msg = llDumpList2String(buttons, "\n");
20 while(llGetListLength(buttons) % 3 != 0)
21 {
22 buttons = llListInsertList(buttons, [" "], gStride);
23 }
24 if(gPos >= gStride)
25 {
26 buttons += ["PREVIOUS"];
27 }else{
28 buttons += [" "];
29 }
30 buttons += [" "];
31 if(nTop - 1 < llGetListLength(names))
32 {
33 buttons += ["NEXT"];
34 }else{
35 buttons += [" "];
36 }
37
38 llDialog(id, msg, buttons, gChann);
39 }
40
41 default
42 {
44 {
45 llListen(gChann, "", NULL_KEY, "");
46 }
47
48 touch_start(integer num_times)
49 {
50 if( ( gOwnerOnly == TRUE && llDetectedKey(0) == llGetOwner() ) || gOwnerOnly == FALSE)
51 {
52 tReq = llDetectedKey(0);
53 llWhisper(0, "Restarting script for user " + llDetectedName(0) + "!");
54 llSensor("", NULL_KEY, PASSIVE, 96.0, PI);
55 }
56 }
57
58 sensor(integer num_detected)
59 {
60 names = [];
61 gPos = 0;
62 integer i;
63 for (i = 0; i < num_detected; i++)
64 {
65 names = names + llDetectedName(i);
66 }
67 dialog(tReq);
68 }
69
70 listen(integer channel, string name, key id, string msg)
71 {
72 if(msg == "NEXT")
73 {
74 gPos = gPos + gStride;
75 dialog(id);
76 }else if(msg == "PREVIOUS")
77 {
78 gPos = gPos - gStride;
79 dialog(id);
80 }else if(msg == " ")
81 {
82 llSay(0, "Sorry, this is just a filler!");
83 }else{
84 llSay(0, msg);
85 }
86 }
87 } // END //

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