Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Help With bug Whacking Please :)

Jodie Suisei
Lost In LSL Code
Join date: 6 Oct 2006
Posts: 66
09-07-2008 04:41
Hello again all i posted a about a week or go with getting a notecard or aka Noteline reader working i am a little cautios about piosting the entire script because the basic bottom line is its a product i will be selling but i will try to outline what i have done and the basic dynamics of the script.

after some much appreciated help from people on this forum i have pieced together a noteline reader and dialog buttons derived from the wiki with next and previous pages

CODE


list Desc; // our read and seperated Station Names
list Url; // our read and seperated URL list

integer Desci; // our seperated Description list using the wiki so i could get the list Desc; and have every station name after and | in the note line reader displayed as the button choices.

string gUrl = llList2String(Url);
string gDesc = llList2String(Desc);

llSetText("Playing Station" + "\n" +gDesc, <1,1,1>, 1.0);
llSetParcelMusicURL(gUrl);



Please bear in mind this is the last bit of the puzzle im missing to make the script work and the radio at least i believe it is i got my read lines seperated and lists made out of those

i used http://wiki.secondlife.com/wiki/SimpleDialogMenuSystem to create the multi page dialog and edited it to what i needed and the integer Desci; falls into the place of taking the list Desc; and then putting that onto the buttons but thats the basic idea of what i done so far with that section.

Now what im trying to do as i said before is to take that printed list onto the buttons and when you click the buttons it will recognise that specific Description and then set the Music URL that matchs it so what im looking for is a little help to get this working.

what i think i am missing is the what i call it the universal remote to listen for which dialog button was pressed and change the URL according to that i may of missed something but if any one can help me whack this one on the head would be appreciated :)
Ron Khondji
Entirely unlike.
Join date: 6 Jan 2007
Posts: 224
One thing I noticed.
09-07-2008 05:38
llList2String needs 2 variables:

llList2String(list src, integer index)

where index might be your Desci.
Jodie Suisei
Lost In LSL Code
Join date: 6 Oct 2006
Posts: 66
09-07-2008 08:13
FC & LC correspond to the first and last choices on the menu dialog i wrote based on the wiki tutorial for multipage dialog and next and previous buttons, integer i had just sitting there doing nothing so i switched the dialog integer Desci to just plain old i.


CODE

integer i;
integer FC;
integer LC;

list Url;
list Desc;



for (i = FC; i <= LC; i++)
{
string gUrl = llList2String(Url, i );
string gDesc = llList2String(Desc, i );

}



and for the listen this is about as fas as i got

CODE


string gUrl = llList2String(Url, i );
string gDesc = llList2String(Desc, i );

llSetText("Playing Station" + "\n" +gDesc, <1,1,1>, 1.0);
llSetParcelMusicURL(gUrl);



the listen is about as far as i got as i just dont know how i can hook the information from when the buttons are pressed to the Desc and URL choice now the Url and Desc and the strings for them are all running from the one integer i; but im stumped on how to proceed lol

EDIT
am i on the right lines here?

Grrr without posting the entire script i wont be able to debug the problems and getting the menu to ignore the first 3 buttons so i guess this is something im going to have to figure for myself thanks for the help anyway
Innula Zenovka
Registered User
Join date: 20 Jun 2007
Posts: 1,825
09-08-2008 07:34
Since you won't post the full script, it's a bit difficult to help, but you might find some guidance here: http://lslwiki.net/lslwiki/wakka.php?wakka=ZenMondo ZenMondo has posted some very helpful scripts he's made that read notecards, generate menus and, among other things, open urls, so perhaps studying those examples would assist?
Very Keynes
LSL is a Virus
Join date: 6 May 2006
Posts: 484
09-08-2008 09:47
Here is a very simple radio that concentrates on, I hope, the question you are asking in that it reads the dialogue response and sets the stream, I hope it points you in the right direction.

CODE

//Very Keynes - 2008
//Simple Radio
list stations =
[
"Martini in the Morning","http://sc6.spacialnet.com:23384",
"Bossanova Jazz","http://160.79.128.40:7806"
];
integer DlgCh = -63482645;
integer handle;

default
{
touch_start(integer total_number)
{
handle = llListen(DlgCh, "", NULL_KEY, "");
llDialog(llDetectedKey(0),"Choose a station", llList2ListStrided(stations,0,-1,2), DlgCh);
}
listen(integer channel, string name, key id, string message)
{
llListenRemove(handle);
llSetParcelMusicURL(llList2String(stations, llListFindList(stations,[message]) + 1));
}
}
Jodie Suisei
Lost In LSL Code
Join date: 6 Oct 2006
Posts: 66
09-08-2008 16:08
i managed to get it all fixed thank you for the links though will prove very usefull i am however having a spot of trouble with link messaging now not my day frankly trying to get one dialog button to send a link message to another script that will receive it and then open that dialog lol i got the basic down but im having a spot of trouble with sorting the actual dialog to open

CODE

// Sent From The Main Script

if (message == "Options")
{
llMessageLinked(LINK_SET, 0, "Options", NULL_KEY);
llSay(0,"Accessing Options Menu");
}

// Recieved by the Second Script
list Main = ["Spooky"];

integer channel = 55;

default
{
state_entry()
{
llListen(channel,"",NULL_KEY,"");
}

link_message(integer sender_num, integer num, string str, key id)
{
if(str == "Options");
{
llDialog("", "Options Menu", Main, channel);
}
}
}



as you can see i am a bit stumped on what the "" should be for the llDialog so it opens a secondary menu in the second script any help or suggestions would be great lol i am howver getting better with dialogs and notereading and will soon i hope branch out into updating some of my other products with the base of reading notecard get info display buttons based on it :) but first bit first lol

the main script sends the signal no problem at least from the llSay that i added so i know its getting pressed and recognised but the problem with this little thing is the actual ID to listen for from the main script.

yes i know its probably more effecient to have the main script run the whole dialog but i plan to add alot of different options so i wanted to spread it into a second script and this is the last learning curve of how to call a menu from another script hehe. and i know list choices written into the script can be a bit of a bloater to the memory usage :s

anyway if some one can point me into how to fill in that quotation mark gap after the llDialog would be great lol
Very Keynes
LSL is a Virus
Join date: 6 May 2006
Posts: 484
09-08-2008 16:23
in place of the NULL_KEY in the line:
llMessageLinked(LINK_SET, 0, "Options", NULL_KEY);
pass the key of the person you intend to get the dialogue and in the receiving script:
llDialog(id, "Options Menu", Main, channel);
Jodie Suisei
Lost In LSL Code
Join date: 6 Oct 2006
Posts: 66
09-08-2008 16:34
aaaaaha! thank you i shall give that a try :)

EDIT

tried that i must of done something wrong as i havent got it to work yet will keep trying though eventually i will get it right but your reply was most helpfull :)

thank you kindly :)

Double Edit

YAY took me 5 aseconds to work out where i went wrong fixed and working now i can whip up the new scripts menus :D