Window Tinter

Written by: Headmaster
//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");
                        }
                }
        }
}
///END SCRIPT
 
//Here the target (aka Windows), put this script into them.
 
//START SCRIPT
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);
                }
        }
}
//////END SCRIPT

 

Category: