Jump to content

Issue with llResetScript() (?)


XbabylonX
 Share

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

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

Recommended Posts

default
{
    on_rez(integer start_param)
    {
    llResetScript();   
    }
 
    changed(integer change)
    {
        if (change & (CHANGED_OWNER | CHANGED_INVENTORY))
            llResetScript();
    }
        
    state_entry()
    {
    state First;
    }
}

state First
{
    state_entry()
    {
    llSetText("Please wait...", <1.000, 0.863, 0.000>, 1.0 );
    //HERE CODE FOR COMMUNICATING WITH A WEBSERVER   
    }

    http_response(key request_id, integer status, list metadata, string body)
    {
        if (request_id==myRequest)
        {
        //THE RESPONSE OF THE WEBSERVER IS BEING SET AS TEXT ON THE PRIM
        llSetText(body, <1.000, 0.863, 0.000>, 1.0 );
        }
    }

}

Hello, I have a problem with the script above.

When I rez a prim with this script in it for the first time, everything goes as it should.

The problem is when I take back the rezed prim in my inventory and then re-rez it again. It has as a text the webserver's response it took when it was rezzed for the first time.

Shouldnt the llResetScript() solve this issue and force the script to run from the beggining when rezed for the second time?

Thank you for your time.

Link to comment
Share on other sites

default{    state_entry()    {    llSetText("Please wait...", <1.000, 0.863, 0.000>, 1.0 );    llSleep(10.0); //Sleep mostly for fun, but also to demonstrate reset state more visibly.    //HERE CODE FOR COMMUNICATING WITH A WEBSERVER       }    http_response(key request_id, integer status, list metadata, string body)    {        if (request_id==myRequest)        {        //THE RESPONSE OF THE WEBSERVER IS BEING SET AS TEXT ON THE PRIM        llSetText(body, <1.000, 0.863, 0.000>, 1.0 );        }    }    on_rez(integer start_param)    {         llResetScript();       }     changed(integer change)    {        if (change & (CHANGED_OWNER | CHANGED_INVENTORY))        {            llResetScript();        }    }}

 This won't compile by copy/pasting, I assume you've reduced it (at least by removing initialisation of request_id). Bear this in mind when testing - aside from this, it's perfectly valid LSL.

If you're having further problems, please expand.

Link to comment
Share on other sites

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