Jump to content
You are about to reply to a thread that has been inactive for 133 days.

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

Recommended Posts

Posted

i have a self-destructing script i need to distribute.  naturally, i ctrl-dropped it into the box so it would not be running.

 

i then sent the box to an alt for testing.

alt-i took the script out of the box and put it into inventory, then threw it into the CONTENT TAB of a new object.
to my surprise... the script did not run.

on further investigation, if i DROP the script on the OBJECT itself, in world....  the script runs.

 

what i don't know is... is that the intended behavior?

 

drag to content tab = stay not running
drag on object = change to run normally
 

???

 

this is in firestorm 6.6.17, btw.

Posted
3 minutes ago, Bloodsong Termagant said:

i have a self-destructing script i need to distribute.

best practice is to make the script execute whatever 'self destruct' features in on_rez(integer i) rather than state_entry().

If you must, you can go to land you don't own that has scripts disabled (I hear some weapons sandboxes have areas specifically for this) to reset a script and make sure it is set to running.

Posted
2 hours ago, Bloodsong Termagant said:

i then sent the box to an alt for testing.

alt-i took the script out of the box and put it into inventory, then threw it into the CONTENT TAB of a new object.
to my surprise... the script did not run.

I cannot repro this.

Alternatively, here is a "Run Only on Script Drop" protocol that can be used for anyone interested:

integer Timestamp2Unix(string ts)
{
    list TS = llParseString2List(ts,["T","-",":"],[]);
    integer y = llList2Integer(TS,0) - 1902;
    integer m = ~-llList2Integer(TS,1);
    return (86400 * ((integer)(y * 365.25 + 0.25) - 24837 +
        m * 30 + (m - (m < 7) >> 1) + (m < 2) -
        (((y + 2) & 3) > 0) * (m > 1) +
        (~-llList2Integer(TS,2))) +
        llList2Integer(TS,3) * 3600 +
        llList2Integer(TS,4) * 60 +
        llList2Integer(TS,5));
}
default
{
    state_entry()
    {
        integer i = llGetUnixTime() - Timestamp2Unix(llGetInventoryAcquireTime(llGetScriptName()));
        llOwnerSay("The script '" + llGetScriptName() + "' was added to this host " + (string)i + " second(s) ago.");
        if (i <= 3) //account for the 2s script delay bug [BUG-228939] possibly occurring
        {
            //run code here only on script drop
        }
        llRemoveInventory(llGetScriptName());
    }
}

 

  • Like 1
Posted

thank you, lucia!

 

did you use the official viewer or a third party (firestorm)?    also, did your tests result in the script running, or not running?  and did you pass the script from an alt to yourself, without full permissions?  (i think your own scripts will always run for you, wherever you put them.  right?)

  some of the folks in the scripters chat expressed a preference for the script to stay not running.  so maybe it's a feature?

 

anyway,  i shall look at implementing this code!  thanks again!

You are about to reply to a thread that has been inactive for 133 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
×
×
  • Create New...