Jump to content

Help! Really Want To Try This Window Script, What Am I Doing Wrong?!


Nima Benoir
 Share

You are about to reply to a thread that has been inactive for 4457 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hi, first let me say many thanks for your help in advance! I'm not a scripter, but am dying to try this out, so any and all help is deeply appreciated!

I have an open source Yadni script  that consists of a window tint controller and a secondary script that goes into the windows themselves. It's suppose to make all windows controllable separately, (by floor I mean, front, back  lower and upper,

etc. ) but when I try to uncomment as the script instructs, I get this when I try to save it...

Window Script.jpg

(The running box is usually checked don't know why it's not here)

Now I know you're all going to see this and think, "what a spaz!" :womanembarrassed: but please can you tell me what I'm doing wrong?

Here are both scripts:

Controller:

WINDOW CONTROLLER

//********************************************************
//This Script was pulled out for you by YadNi Monde from the SL FORUMS at http://forums.secondlife.com/forumdisplay.php?f=15, it is intended to stay FREE by it s author(s) and all the comments here in ORANGE must NOT be deleted. They include notes on how to use it and no help will be provided either by YadNi Monde or it s Author(s). IF YOU DO NOT AGREE WITH THIS JUST DONT USE!!!
//********************************************************


// Menu Driven Window Tint Script
//Window tinting script using menu based options for a two story building, but can be modified however you'd like for whichever building style you have. This script controls several windows with one controller, varying the tinting from window to window as you choose the transparency level.
//
//Critiques are appreciated and welcomed!
//
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// (C) 2007 Abba Thiebaud>SecondLifer  
// Please remember, I do not offer support for this script; your use of
// this script is your acknowledgement and agreement to the above
// terms.
//
// DO NOT REMOVE THE ABOVE HEADER FOR ANY REASON WHATSOEVER.

// Window Controller Script (put into controller prim)
list TINT_OPTIONS = ["40%", "20%", "None", "100%", "80%", "60%"];
list WALL_OPTIONS = ["Lower Front", "Lower Back", "Lower Sides", "Upper Front", "Upper Back", "Upper Sides", "Ceiling", "All"];
integer UPPER_FRONT = -28394;
integer LOWER_FRONT = -28395;
integer UPPER_BACK  = -28396;
integer LOWER_BACK  = -28397;
integer UPPER_SIDE  = -28398;
integer LOWER_SIDE  = -28399;
integer CEILING     = -28400;
integer CHANNEL     = -28393;
integer wallChannel;
integer allWalls;

PaintAllWalls(string tintLevel)
{
    integer i;
    integer j;
    
    j = -28394;

    for (i = 0; i < 7; i++)
    {
        llSay(j, tintLevel);
        j--;
    } // end for
} // end PaintAllWalls
   
default {
    state_entry()
    {
        llListen(CHANNEL, "", NULL_KEY, ""); // listen for dialog answers (from multiple users)
    } // end state_entry()

    touch_start(integer total_number)
    {
        llDialog(llDetectedKey(0), "Which wall would you like to tint?", WALL_OPTIONS, CHANNEL); // present dialog on click
        allWalls = 0;
    } // end touch_start()

    listen(integer channel, string name, key id, string message)
    {
        if (llListFindList(TINT_OPTIONS + WALL_OPTIONS, [message]) != -1)  // verify dialog choice
        {
            if (message == "Upper Front")
            {
                llDialog(id, "How much tint would you like?", TINT_OPTIONS, CHANNEL);
                wallChannel = UPPER_FRONT;
            }
            else if (message == "Upper Back")
            {
                llDialog(id, "How much tint would you like?", TINT_OPTIONS, CHANNEL);
                wallChannel = UPPER_BACK;
            }
            else if (message == "Upper Sides")
            {
                llDialog(id, "How much tint would you like?", TINT_OPTIONS, CHANNEL);
                wallChannel = UPPER_SIDE;
            }
            else if (message == "Lower Front")
            {
                llDialog(id, "How much tint would you like?", TINT_OPTIONS, CHANNEL);
                wallChannel = LOWER_FRONT;
            }
            else if (message == "Lower Back")
            {
                llDialog(id, "How much tint would you like?", TINT_OPTIONS, CHANNEL);
                wallChannel = LOWER_BACK;
            }
            else if (message == "Lower Sides")
            {
                llDialog(id, "How much tint would you like?", TINT_OPTIONS, CHANNEL);
                wallChannel = LOWER_SIDE;
            }
            else if (message == "Ceiling")
            {
                llDialog(id, "How much tint would you like?", TINT_OPTIONS, CHANNEL);
                wallChannel = CEILING;
            }
            else if(message == "All")
            {
                llDialog(id, "How much tint would you like?", TINT_OPTIONS, CHANNEL);
                allWalls = 1;
             }

            if (message == "100%")
            {
                if(allWalls == 1)
                {
                    PaintAllWalls("100");
                }
                else
                {
                    llSay(wallChannel, "100");
                }
             }
            else if (message == "80%")
            {
                if(allWalls == 1)
                {
                    PaintAllWalls("80");
                }
                else
                {
                    llSay(wallChannel, "80");
                }
             }
            else if (message == "60%")
            {
                if(allWalls == 1)
                {
                    PaintAllWalls("60");
                }
                else
                {
                    llSay(wallChannel, "60");
                }
             }
            else if (message == "40%")
            {
                if(allWalls == 1)
                {
                    PaintAllWalls("40");
                }
                else
                {
                    llSay(wallChannel, "40");
                }
             }
            else if (message == "20%")
            {
                if(allWalls == 1)
                {
                    PaintAllWalls("20");
                }
                else
                {
                    llSay(wallChannel, "20");
                }
             }
            else if (message == "None")
            {
                if(allWalls == 1)
                {
                    PaintAllWalls("0");
                }
                else
                {
                    llSay(wallChannel, "0");
                }
             }
          } // end if (valid message)
    }  // end listen
} // end default

 

Windows

WINDOW

//********************************************************
//This Script was pulled out for you by YadNi Monde from the SL FORUMS at http://forums.secondlife.com/forumdisplay.php?f=15, it is intended to stay FREE by it s author(s) and all the comments here in ORANGE must NOT be deleted. They include notes on how to use it and no help will be provided either by YadNi Monde or it s Author(s). IF YOU DO NOT AGREE WITH THIS JUST DONT USE!!!
//********************************************************


// Menu Driven Window Tint Script
//Window tinting script using menu based options for a two story building, but can be modified however you'd like for whichever building style you have. This script controls several windows with one controller, varying the tinting from window to window as you choose the transparency level.
//
//Critiques are appreciated and welcomed!
//
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// (C) 2007 Abba Thiebaud>SecondLifer  
// Please remember, I do not offer support for this script; your use of
// this script is your acknowledgement and agreement to the above
// terms.
//
// DO NOT REMOVE THE ABOVE HEADER FOR ANY REASON WHATSOEVER.
//
//
//
//Here the target (aka Windows), put this script into them.
integer chan = -28394; // uncomment for UPPER_FRONT
//integer chan = -28395; // uncomment for LOWER_FRONT
//integer chan = -28396; // uncomment for UPPER_BACK
//integer chan = -28397; // uncomment for LOWER_BACK
//integer chan = -28398; // uncomment for UPPER_SIDE
//integer chan = -28399; // uncomment for LOWER_SIDE
//integer chan = -28400; // uncomment for CEILING

//START SCRIPT
default
{
        state_entry()
        {
                llListen(chan, "", 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

 

Again many thanks!!

 

Link to comment
Share on other sites

It looks like you should only be uncommenting one of those lines 36 to 42, depending on which area you are making windows for.  The script doesn't like you uncomment two of them as this attempts to define chan twice, hence the error.

Commenting means having // at the start of the line ... so all but one of those lines should start with //.

Kimm.

 

Link to comment
Share on other sites


Kimm Paulino wrote:

It looks like you should only be uncommenting one of those lines 36 to 42, depending on which area you are making windows for.  The script doesn't like you uncomment two of them as this attempts to define chan twice, hence the error.

Commenting means having // at the start of the line ... so all but one of those lines should start with //.

Kimm.

 

Thank you so much for your fast reply, so kind! Knew it was going to be a very simple answer and thanks to you I finally understood! Dropped you a small token of appreciation. Please let me know if you didn't get it okay? And once more, ty ty!

:matte-motes-big-grin: /me is grinning from excitement that her windows are now in perfect working order!

 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4457 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...