Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Window Tinting System

Lecina Enigma
Linux Client User-x86_64
Join date: 16 Nov 2005
Posts: 32
05-22-2006 13:56
Here oneof my first *smiles* working scripts, with 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);
}
}
}

Nada Epoch
The Librarian
Join date: 4 Nov 2002
Posts: 1,423
Discussion Thread
05-27-2006 16:14
/54/ac/109800/1.html
_____________________
i've got nothing. ;)
Dominic Russell
Registered User
Join date: 16 Oct 2005
Posts: 5
compile error line six
06-12-2006 03:48
Thanks for the cool script! The window portion compiles without error, however, the control script has an error in it here somewhere:
menu(key user,string title,list buttons)