Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

syntax error Please help

Sweetheart Baskerville
Registered User
Join date: 1 Jan 2004
Posts: 32
07-29-2006 09:17
Hello, I found this script awhile back in the forums. When I put it in the controller I get a syntax error between this -37641 ; // not sure if there are other errors since I can't seem to get past that..I'm not a scripter and I sure don't understand anything about it. I did put the one script inside a controller and the rest of the other script inside the window...If someone can please look over this script and correct it for me...I can't remember whose script this is since all I copied is what you see below....
Thank You, Sweetheart Baskerville(Juliea) :confused:



Window Tinting System thanks to Kyrah`s example about llDialog.



First there must be an button to controll all Windows in the House..and or Room..the scripts itselfs works with llSay so max 20 Meters around all Windows will change.



Main Script (Send Unit) :



Code:

integer menu_handler; integer menu_channel; menu(key user,string title,list buttons) { menu_channel = -37641 ; // You can change the Channel as needed...to add more systems into one house, but dont forget to change the channels in the Window (Target) Scriot too) menu_handler = llListen(menu_channel,"","","";); llDialog(user,title,buttons,menu_channel); llSetTimerEvent(5.0); } default { touch_start(integer t) { menu(llDetectedKey(0),"Window Tinting System",["100","80","60","40","20","0"]); } timer() { llSetTimerEvent(0.0); llListenRemove(menu_handler); } listen(integer channel,string name,key id,string message) { if (channel == menu_channel) { llSetTimerEvent(0.0); llListenRemove(menu_handler); if(message == "100";) { llSay(menu_channel,"100";); } else if(message == "80";) { llSay(menu_channel,"80";); } else if(message == "60";) { llSay(menu_channel,"60";); } else if(message == "40";) { llSay(menu_channel,"40";); } else if(message == "20";) { llSay(menu_channel,"20";); } else if(message == "0";) { llSay(menu_channel,"0";); } } } }





and here the target (aka Windows), put this script into them.



Code:

default { state_entry() { llListen( -37641, "", NULL_KEY, "" ); } listen( integer channel, string name, key id, string message ) { if ( message == "100" ) { llSetAlpha(1.0, ALL_SIDES); } else if ( message == "80" ) { llSetAlpha(0.8, ALL_SIDES); } else if ( message == "60" ) { llSetAlpha(0.6, ALL_SIDES); } else if ( message == "40" ) { llSetAlpha(0.4, ALL_SIDES); } else if ( message == "20" ) { llSetAlpha(0.2, ALL_SIDES); } else if ( message == "0" ) { llSetAlpha(0.0, ALL_SIDES); } } }
Teeple Linden
Some Linden or other
Join date: 14 Dec 2005
Posts: 144
07-29-2006 15:37
Hi!

Sometimes problems come up on compiling what should be perfectly good scripts that use too many if/else clauses. It's a shortcoming in the compiler, and not the scripter's fault. I thought that might be happening here.

After reformatting the scripts, though, I was able to get them to run without any corrections. I think maybe the compiler's tripping up over a lack of whitespace somewhere.

Let me re-post the two scripts with some formatting added. Please try copying and pasting these into your objects, and let's see if they perform as expected.

The controller:

CODE

integer menu_handler;
integer menu_channel;

menu(key user,string title,list buttons) {
//
// You can change the Channel as needed...
// to add more systems into one house,
// but dont forget to change the
// channels in the Window (Target) Script too
//
menu_channel = -37641 ;
menu_handler = llListen(menu_channel,"","","");
llDialog(user,title,buttons,menu_channel);
llSetTimerEvent(5.0);
}

default {
touch_start(integer t) {
menu(llDetectedKey(0),"Window Tinting System",["100","80","60","40","20","0"]);
}

timer() {
llSetTimerEvent(0.0);
llListenRemove(menu_handler);
}


listen(integer channel,string name,key id,string message) {
if (channel == menu_channel) {
llSetTimerEvent(0.0);
llListenRemove(menu_handler);
if(message == "100") {
llSay(menu_channel,"100");
} else if (message == "80") {
llSay(menu_channel,"80");
} else if(message == "60") {
llSay(menu_channel,"60");
} else if(message == "40") {
llSay(menu_channel,"40");
} else if(message == "20") {
llSay(menu_channel,"20");
} else if(message == "0") {
llSay(menu_channel,"0");
}
}
}
}


And the window:

CODE

default {

state_entry() {
llListen( -37641, "", NULL_KEY, "" );
}

listen( integer channel, string name, key id, string message ) {
if ( message == "100" ) {
llSetAlpha(1.0, ALL_SIDES);
} else if ( message == "80" ) {
llSetAlpha(0.8, ALL_SIDES);
} else if ( message == "60" ) {
llSetAlpha(0.6, ALL_SIDES);
} else if ( message == "40" ) {
llSetAlpha(0.4, ALL_SIDES);
} else if ( message == "20" ) {
llSetAlpha(0.2, ALL_SIDES);
} else if ( message == "0" ) {
llSetAlpha(0.0, ALL_SIDES);
}
}
}


If the scripts do run for you in this original version, it's possible to simplify them a bit. We can do that next.

-- teeple
Sweetheart Baskerville
Registered User
Join date: 1 Jan 2004
Posts: 32
Thank You Teeple Linden
07-29-2006 21:18
Thanks so much for redoing that...I was in the process of trying it out when the server went down...so I guess I'll see if it works when I get back in...
Thank You,
Sweetheart Baskerville(Juliea)