osgrid.org
https://forums.osgrid.org/

Window Tint Remote Control
https://forums.osgrid.org/viewtopic.php?f=5&t=302
Page 1 of 1

Author:  Nebadon Izumi [ Tue Sep 09, 2008 2:44 am ]
Post subject:  Window Tint Remote Control

Window Tinting System (Window Unit)
{L_CODE}:
//Window Tinting System
//Copy Script into Window or object
//Credits to Lecina Enigma

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);
    }
}
}


Window Tinting System (Main Unit Send)
{L_CODE}:
//Window Tinting System
//Credits to Lecina Enigma
//Main Control Unit Send Unit

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");
            }
        }
    }
}


Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/