Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Listen List Dialog.

Virtual Foxtrot
Registered User
Join date: 3 Sep 2008
Posts: 5
09-06-2008 07:03
I can't seem to find a way to do this in wiki's

ok here is what I'm trying to do sorry no scripts worked out so I have nothing to post on them.

when a command is used "IE touch and or voice command it will say a command"
Once the command is used it will send back like 0011001100.
I want to take the 0011001100 "1's only" from a list and place in that list "IE a,b,c,d,e,f,g,h,i,j"
From that I would get a dialog with c,d,g,h.
But the dialog will have to handle max of 39 buttons. I know 12 to each one lol.

0011001100 come back as 0011001100 this is no way to add , I tried that for a cvs call.
Any please help lol

Jenn
Baron Hauptmann
Just Designs / Scripter
Join date: 29 Oct 2005
Posts: 358
09-06-2008 08:14
I suspect there are several ways to do this. One that comes to mind (and probably not the most efficient) is to loop through and convert the binary-like string into a list. llGetSubString(list, i, i) and then you could compare against your "a,b,c,d . . ." list, and whenever the 1 is present, keep the letter, if it is 0, drop the letter from the list.

Some of those things could be combined, as well. That is the first thought that comes to my mind, hope it helps or stimulates other, better ideas!
Virtual Foxtrot
Registered User
Join date: 3 Sep 2008
Posts: 5
:/
09-06-2008 08:40
Baron chould you show my that in lsl from. I'm not so go with ummm lists. And I learn better if you show me a simple set up :P
Lear Cale
wordy bugger
Join date: 22 Aug 2007
Posts: 3,569
09-06-2008 13:36
CODE

list AllButtons = ["eat", "drink", "be merry", ...];

...
list buttons;
integer ix;
for (ix = 0; ix < llGetStringLength(bitstring); ++ix) {
if ((integer)llGetSubString(bitstring, ix, ix) == 1) {
buttons += llList2String(AllButtons, ix);
}
}
llDialog(id, message, buttons, chan);


where 'bitstring' is the binary string you mentioned above, as a string.

Hit the Quote button below this post to see the code with indentation.