Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Syntax Whoes...

EyeDye Constantine
Registered User
Join date: 24 May 2008
Posts: 4
06-17-2008 21:38
I am tring to put together a menu based teleporter that will work with landmarks stored in object inventory, but am having alot of problems with syntax. Here is an example of what I have so far: (the error seems to be at the dataserver command)

integer menu_handler;
integer menu_channel;
integer command_channel = 333;
menu(key user,string title,list buttons)//make dialog easy, pick a channel by itself and destroy it after 5 seconds
{
menu_channel = (integer)(llFrand(99999.0) * -1);//yup a different channel at each use
menu_handler = llListen(menu_channel,"","","";);
llDialog(user,title,buttons,menu_channel);
llSetTimerEvent(5.0);

}

default
{on_rez(integer params){
llResetScript();}
state_entry()
{key uuid = llGetOwner();
string name = llKey2Name(uuid);
llSetObjectName(name);
}
touch_start(integer t)
{
menu(llDetectedKey(0)," \n \nTeleport Menu....",["Fav 1","Fav 2","Fav 3","Fav 4","Fav 5","Fav 6"]);

}
timer() //so the menu timeout and close its listener
{
llSetTimerEvent(0.0);
llListenRemove(menu_handler);
}
listen(integer channel,string name,key id,string message)
{
if (channel == menu_channel) //in case you have others listeners
{
if(message == "Fav 1";)
{

key request;
string name;
string sim_name;
vector pos;

llAllowInventoryDrop(1);
if(llGetInventoryNumber(INVENTORY_LANDMARK))
{
name = llGetInventoryName(INVENTORY_LANDMARK,0);
request = llRequestInventoryData(name);
}
else
llWhisper(0,"Please drop a landmark on me";);
}
dataserver(key id, string data)
{
if(id == request)
{
pos = (vector)data;
sim_name = llGetRegionName();
llSetText("",<1.0,1.0,1.0>,1.0);
}
}
touch_start(integer a)
{
if(name != "";)
llMapDestination(sim_name, pos, pos);
}
changed(integer a)
{
if(a & (CHANGED_INVENTORY | CHANGED_ALLOWED_DROP))
if(llGetInventoryNumber(INVENTORY_LANDMARK))
request = llRequestInventoryData(name = llGetInventoryName(INVENTORY_LANDMARK,0));
}
}


Any LSL guru's out there that may be able to help me make this work?
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
06-17-2008 21:46
You have four open curly braces ({) between 'listen' and 'dataserver', but only two close curly braces (}). I'm not going to try to ferret out what you MEANT to do, but know that they must come in matched (nested) pairs, and you cannot have one event handler inside another (you can't put 'dataserver' in the middle of 'listen').
EyeDye Constantine
Registered User
Join date: 24 May 2008
Posts: 4
06-17-2008 21:59
From: Hewee Zetkin
You have four open curly braces ({) between 'listen' and 'dataserver', but only two close curly braces (}). I'm not going to try to ferret out what you MEANT to do, but know that they must come in matched (nested) pairs, and you cannot have one event handler inside another (you can't put 'dataserver' in the middle of 'listen').


So how might I go about reformatting this part of the script to work properly? I'm not entirely sure of the placement. Keep in mind iI am very new to LSL. Feel free to PM me if it's easier.

Thank you for your reply
Viktoria Dovgal
Join date: 29 Jul 2007
Posts: 3,593
06-18-2008 19:42
I can throw some brackets around and make the thing compile, but I'm still lost as to what this script is supposed to be doing.

Do you really want this thing to allow anyone at all to drop random landmarks into it? (is this a personal pr public thing?) The six favorites thing, do you want there to be a limit to the number of landmarks? How, in plain language, do you picture this thing working?
_____________________