Jump to content
  • 0

dont know wy this script not works


RhaDo2496
 Share

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

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

Question

  • 0

The place to ask a question like this is the LSL Scripting forum, not Answers.  However, your script works just fine.  At least, it does exactly what I expected it to.  I assume that you are feeding it test values and listening for responses with something like this script:

 

default{    state_entry()    {        llListen(900,"","","");        llListen(240,"","","");    }        listen(integer channel, string name, key id, string message)    {        llSay(0,message);    }        touch_start(integer total_number)    {        llSay(240, "c1"); // Change this line to simulate different input messages    }}

If I click this script, it sends "c1" to your script, which hears it correctly. If I then click your script, it sends "hide" to my test script and turns a shade of gray.  If I click my test script again, your script hears it and stays gray until I click it, at which point it says "show" and turns black.  If I then change my test script to say "c7", your script hears it and then, when I click your script, turns gray and says "hide".  Just what your touch_start event says that it should do.

It might be easier to see the logic in your touch_start event if you indent it cleanly so you can see the scope of each if test:

 

    touch_start(integer total_number)     {        /// I added this next line to track  the variables ....         llSay(0,"L1 = " + (string)Ll + "  Visible = " + (string)visible);            if(Ll)         {             if(visible)            {             hide1();             llSay(900,hideGo);             llSay(0,"off");                 visible = FALSE;                              }            else            {                          show();              llSay(900,showGo);                llSay(0,"on");                     visible = TRUE;                     }        }        else        {        }    }
  • Like 1
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

The place to ask a question like this is the LSL Scripting forum, not Answers.  However, your script works just fine.  At least, it does exactly what I expected it to.  I assume that you are feeding it test values and listening for responses with something like this script:

 

default{    state_entry()    {        llListen(900,"","","");        llListen(240,"","","");    }        listen(integer channel, string name, key id, string message)    {        llSay(0,message);    }        touch_start(integer total_number)    {        llSay(240, "c1"); // Change this line to simulate different input messages    }}

If I click this script, it sends "c1" to your script, which hears it correctly. If I then click your script, it sends "hide" to my test script and turns a shade of gray.  If I click my test script again, your script hears it and stays gray until I click it, at which point it says "show" and turns black.  If I then change my test script to say "c7", your script hears it and then, when I click your script, turns gray and says "hide".  Just what your touch_start event says that it should do.

It might be easier to see the logic in your touch_start event if you indent it cleanly so you can see the scope of each if test:

 

    touch_start(integer total_number)     {        /// I added this next line to track  the variables ....         llSay(0,"L1 = " + (string)Ll + "  Visible = " + (string)visible);            if(Ll)         {             if(visible)            {             hide1();             llSay(900,hideGo);             llSay(0,"off");                 visible = FALSE;                              }            else            {                          show();              llSay(900,showGo);                llSay(0,"on");                     visible = TRUE;                     }        }        else        {        }    }
  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 2730 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...