Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

[[DemoniX DesignZ]] Drop Down Menu Dialog Quick Runs

Noble Barnes
Jack of All Trades
Join date: 3 Aug 2007
Posts: 12
01-22-2008 01:15
// I create allot of menu driven systems and I think that this happens to be the the best way
// to handle multiple menus in a items.
// This consists of 2 scripts The first one is the primary control script.

Primary Control Script
CODE

string main = "Title Goes Here\nWhat Would you Like to do?";
integer debug = FALSE;
string command1 = "A"; //This is the text displayed on the opt1 button of the menu, you can add more if you like
string command2 = "B"; //This is the text displayed on the opt2 button of the menu, you can add more if you like
integer coms_chan = 129834765;
integer menu_chan = 129834766; //Add additonal channels if you want to add multiple sub menus. Make certain to change the Listen area to compensate for additional sub menus
integer prim = LINK_THIS;
list main_options = [command1,"EXIT",command2];
integer listening;
integer sys_chan;
key Toucher;
key owner;
string Oname;
string gUser;

menu_main(key id)
{
llListenRemove(listening);
sys_chan = (integer)llFrand(-2000000000);
listening = llListen(sys_chan,"",id,"");
llListenControl(listening,TRUE);
llDialog(id,"Welcome: "+Oname+"\n"+main,main_options,sys_chan);
}

function1(string message)
{ llSay(0,"Something for Function 1 goes here"); }

default
{
on_rez(integer r)
{
llResetScript();
}

state_entry()
{
owner = llGetOwner();
Oname = llKey2Name(llGetOwner());

}

touch_start(integer total_number)
{
Toucher = llDetectedKey(0);
gUser = llDetectedName(0);
if (Toucher == owner)
{
listening = llListen(sys_chan,"",owner,"");
menu_main(owner);
llSetTimerEvent(0.0);
}
}

link_message(integer send, integer ch, string str, key id)
{
if ( ch == coms_chan )
{
sys_chan = (integer)llFrand(-2000000000);
listening = llListen(sys_chan,"",id,"");
menu_main(id);
}
}

listen(integer ch, string name, key id, string msg)
{
if ( ch == sys_chan )
function1(msg);
}
}


now for the secondary response script
CODE

// --~<[[ DemoniX DesignZ Inc. ]]>~-- Menu Interfacer Responder:
// Created: 12/29/2006
// Modified Several Times since then.
// Scripted By: Noble Barnes of DemoniX DesignZ
// So here goes, after reviewing several pose scripts and seeing that not one in particular
// was actually able to do everything I needed it to do, so I went ahead and created this.
// this is released under free trade, do with it as you wish, I do however ask that you respect the following terms
// 1.) If you use this code please allow it to be atleast mod/copy/no trans
// 2.) Please leave this header intact.
// 3.) If you use this script and like it, donate 1L$ to Noble Barnes.
// 4.) You can use this script to sell your items, but don't sell this script please.
// 5.) Don't expect any technical assistance with this script.
// 6.) This is released 'as is', it works just fine, read the headings they tell you what to do.
// 7.) Don't IM me asking for help with this script. its FREEWARE for that reason, no support included, I will do a custom version if you need one though.
//
// I create allot of menu driven systems and I think that this happens to be the the best way
// to handle multiple menus in a items.
// This consists of 2 scripts The first one is the primary control script.
string title = "Title Text Goes Here";
string command1 = "A";
string command2 = "B";
list options = [command1,"BACK",command2];
integer prim = LINK_THIS;
integer coms_chan = 129834765; //This channel should match that in the primary control script
integer menu_chan = 129834766; //Change channel if you have multiple sub menus in the primary control script.
integer debug = FALSE;
integer listening;
integer sys_chan;


menu_main(key id)
{
llListenRemove(listening);
sys_chan = (integer)llFrand(-2000000000);
listening = llListen(sys_chan,"",id,"");
llListenControl(listening,TRUE);
llDialog(id,title,options,sys_chan);
}
function1()
{ llSay(0,"Something for Function 1 goes here"); }

function2()
{ llSay(0,"Something for Function 2 goes here"); }

default
{
link_message(integer prim, integer ch, string str, key id)
{
if ( ch == menu_chan )
{
menu_main(id);
}
}

listen(integer ch, string name, key id, string msg)
{
llListenControl(listening,FALSE);
if (debug)
llOwnerSay(llGetScriptName()+" received: "+msg+" command");

if (msg == "BACK") { llMessageLinked(prim, coms_chan, msg, id); }

if (msg == command1) { function1(); }

if (msg == command2) { function2(); }
}
}


this makes it so you can have one controller script and if you want to add multiple settings functions you can have one control menu with up to 9 sub menus.

Hope you found this helpful.

Sincerest Regards;
Noble Barnes
Owner: DemoniX DesignZ Inc.

Edited On: 24 JAN 2008 to add notes about how to add additional sub menu's and to inform people they can pick up a working copy of this script at my store in Second Life at:

http://slurl.com/secondlife/Stipe/141/136/92
_____________________
Sincerest Regards;
Noble Barnes
Owner: DemoniX DesignZ™ Inc. in World


| Please Use PHP tags when posting scripts/code work Please...
| Can't See PHP or URL Tags Correctly, Check Out This Link...
| http://forums.secondlife.com/showthread.php?t=222988
chechel Choche
Registered User
Join date: 1 May 2007
Posts: 5
01-23-2008 06:30
Error responder script (64, 20) (.txt) :(

also in this posted one: (32, 13)...

mh greetings CC
Talarus Luan
Ancient Archaean Dragon
Join date: 18 Mar 2006
Posts: 4,831
01-23-2008 07:36
Well, it is one way, to be sure. "Best" is a rather subjective judgment, and is highly dependent on the specific application. ;)
Max Pitre
Registered User
Join date: 19 Jul 2006
Posts: 370
01-24-2008 05:05
Love people that say " it works just fine" without double checking

I get an error in the secondary script at this plus sign line 32,16
main_options += options;
chechel Choche
Registered User
Join date: 1 May 2007
Posts: 5
01-24-2008 06:52
From: Max Pitre
Love people that say " it works just fine" without double checking

I get an error in the secondary script at this plus sign line 32,16
main_options += options;



main_options + ? = options;

...sure !

why posting a script + antouchment, all wrong ;(...

ok may no time is the motiv ;)

greetings Cc
Noble Barnes
Jack of All Trades
Join date: 3 Aug 2007
Posts: 12
01-24-2008 07:00
From: Max Pitre
Love people that say " it works just fine" without double checking

I get an error in the secondary script at this plus sign line 32,16
main_options += options;


Have you made any changes to the script? if you have then I am can't begin to explain to why it is not working, as it stand right now it works just fine I double checked in game to see if there was an error in formatting caused by the forums converting it and it compiles and works just fine for me, If you need a fully working copy stop by my store in Stipe at

http://slurl.com/secondlife/Stipe/141/136/92
_____________________
Sincerest Regards;
Noble Barnes
Owner: DemoniX DesignZ™ Inc. in World


| Please Use PHP tags when posting scripts/code work Please...
| Can't See PHP or URL Tags Correctly, Check Out This Link...
| http://forums.secondlife.com/showthread.php?t=222988
Noble Barnes
Jack of All Trades
Join date: 3 Aug 2007
Posts: 12
01-24-2008 07:23
From: chechel Choche
main_options + ? = options;

...sure !

why posting a script + antouchment, all wrong ;(...

ok may no time is the motiv ;)

greetings Cc


Sorry but the only thing I have to say to this is HUH? What exactly are you asking? or attempting to imply?
_____________________
Sincerest Regards;
Noble Barnes
Owner: DemoniX DesignZ™ Inc. in World


| Please Use PHP tags when posting scripts/code work Please...
| Can't See PHP or URL Tags Correctly, Check Out This Link...
| http://forums.secondlife.com/showthread.php?t=222988
chechel Choche
Registered User
Join date: 1 May 2007
Posts: 5
01-24-2008 09:35
From: Noble Barnes
Sorry but the only thing I have to say to this is HUH? What exactly are you asking? or attempting to imply?


...thx Noble now its working !!! very kindly to improve
the script ;)))

sorry for shouting ;) - greetings CC
Max Pitre
Registered User
Join date: 19 Jul 2006
Posts: 370
01-24-2008 12:45
From: Noble Barnes
Sorry but the only thing I have to say to this is HUH? What exactly are you asking? or attempting to imply?


LOL, I did a HUH? too

I didn't change the script at all, copied and pasted. And looking at another poster I'm not the only one that got stuck at that same spot.
Max Pitre
Registered User
Join date: 19 Jul 2006
Posts: 370
01-24-2008 12:51
From: Noble Barnes
Have you made any changes to the script? if you have then I am can't begin to explain to why it is not working, as it stand right now it works just fine I double checked in game to see if there was an error in formatting caused by the forums converting it and it compiles and works just fine for me, If you need a fully working copy stop by my store in Stipe at

http://slurl.com/secondlife/Stipe/141/136/92

I'll recheck it when I get home from work. I see you edited the script so maybe the original one posted was the issue? I don't see the offending line of code any more.
Oh, and thanks for your work, I'm sure it will be an awesome addition to anyones collection of scripts.
Noble Barnes
Jack of All Trades
Join date: 3 Aug 2007
Posts: 12
01-24-2008 19:26
From: Max Pitre
I'll recheck it when I get home from work. I see you edited the script so maybe the original one posted was the issue? I don't see the offending line of code any more.
Oh, and thanks for your work, I'm sure it will be an awesome addition to anyones collection of scripts.

Only thing I edited was adding in //notes in a few places, and I added in the fact that you can get a fully functioning version at my Store in Stipe.
_____________________
Sincerest Regards;
Noble Barnes
Owner: DemoniX DesignZ™ Inc. in World


| Please Use PHP tags when posting scripts/code work Please...
| Can't See PHP or URL Tags Correctly, Check Out This Link...
| http://forums.secondlife.com/showthread.php?t=222988
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
01-24-2008 19:48
From: Noble Barnes
Only thing I edited was adding in //notes in a few places, and I added in the fact that you can get a fully functioning version at my Store in Stipe.

Sorry, nice joke, but you did do more then that. You are the only person who can edit your posts, outside of MAYBE the OPs. This morning after Max's post I checked your code and this was indeed there in the second script, keeping it from compiling:

main_options += options;
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum