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 DIALOG_MENU  

DIALOG_MENU

DIALOG MENU by Kyrah Abattoir.lsl

Category: Dialog
By : Kyrah Abbatoir
Created: 2010-01-10 Edited: 2010-01-10
Worlds: Second Life

the Zip file

Download all files for DIALOG_MENU
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. DIALOG_MENU_by_Kyrah_Abattoir_1.lsl
1
2 //DIALOG MENU by Kyrah Abattoir
3
4
5 integer menu_handler;
6 integer menu_channel;
7 menu(key user,string title,list buttons)//make dialog easy, pick a channel by itself and destroy it after 5 seconds
8 {
9 menu_channel = (integer)(llFrand(99999.0) * -1);//yup a different channel at each use
10 menu_handler = llListen(menu_channel,"","","");
11 llDialog(user,title,buttons,menu_channel);
12 llSetTimerEvent(5.0);
13 }
14
15 default
16 {
18 {
19 menu(llDetectedKey(0),"hello world",["yes","no"]);
20 }
21 timer() //so the menu timeout and close its listener
22 {
23 llSetTimerEvent(0.0);
24 llListenRemove(menu_handler);
25 }
26 listen(integer channel,string name,key id,string message)
27 {
28 if(channel == menu_channel) //in case you have others listeners
29 {
30 if(message == "yes")
31 {
32 //do stuffs
33 }
34 else if(message == "no")
35 {
36 //do other stuffs
37 }
38 }
39 }
40 }// END //

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