Ensuring a script is deleted?
|
|
Chas Lusch
Registered User
Join date: 1 Mar 2007
Posts: 7
|
02-02-2008 05:29
I know there are ways to delete a script such as llDie to completely remove the object or llRemoveInventory to get rid of just the script, but:
Is there a way to ensure a script or object will delete upon delivery on an item from a server, even if the user takes that object back into their inventory before the llDie has a chance to operate?
So if the object has been taken back and then re-rezzed, it will delete straight away and can't be re-used?
Not sure if I have been clear here, sorry if I haven't.
|
|
Haruki Watanabe
llSLCrash(void);
Join date: 28 Mar 2007
Posts: 434
|
02-02-2008 05:38
Neither llDie() nor llRemoveInventory() raise an event when executed. This would be pretty useless as there wouldn't be a script anymore which could catch this event.
Since data is kept when you take an object back to your inventory, you could add a counter that is increased when the object is rezzed (on_rez -> timesRezzed++ or so).
That way, if the rezzing counter is higher than 0, you can assume that the object was rezzed before and then delete the object or script... You might even build in a limitation that way, so that the object can be rezzed only a couple of times and then won't work anymore or deletes itself.
|
|
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
|
02-02-2008 05:53
You could also throw in a test in an on_rez event as a failsafe
if(llGetOwner() != llGetCreator()) destroy something..............
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime. From: someone I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
|
|
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
|
02-02-2008 05:55
If somebody manages to take the object back before it has successfully died, when it is re-rezzed the script will just carry on from where it left.
Bear in mind that if somebody is quick enough to retake an item before death, they may well be quick enough to open it and take the contents, then put the script in another object, resetting it. So you may want to make sure to trap that in state_entry() somehow.
Exact details will depend on exactly _why_ you want the script or object to die, mind you.
_____________________
http://ordinalmalaprop.com/forum/ - visit Ordinal's Scripting Colloquium for scripting discussion with actual working BBCode!
http://ordinalmalaprop.com/engine/ - An Engine Fit For My Proceeding, my Aethernet Journal
http://www.flickr.com/groups/slgriefbuild/ - Second Life Griefbuild Digest, pictures of horrible ad griefing and land spam, and the naming of names
|
|
Chas Lusch
Registered User
Join date: 1 Mar 2007
Posts: 7
|
02-02-2008 06:21
Thanks for your replies. From: Ordinal Malaprop If somebody manages to take the object back before it has successfully died, when it is re-rezzed the script will just carry on from where it left. I didn't realise that, so when re-rezzed, the object should die anyhow. Checking the creator of the object will also be useful to prevent abuse. Thanks for youe help!
|
|
Very Keynes
LSL is a Virus
Join date: 6 May 2006
Posts: 484
|
02-02-2008 06:39
But if it were re-rezed in no script land, would it still die or could the person then just edit it and delete the script, berore it had a chance to kill the object?
|
|
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
|
02-02-2008 06:40
Checking llGetCreator isn't that handy if you have ever distributed a modifiable object, mind you.
The way I have done this sort of thing in the past is to have a hardcoded list of "approved resetters" which is checked against llGetOwner on state_entry. If you are not on the list, delete the script.
_____________________
http://ordinalmalaprop.com/forum/ - visit Ordinal's Scripting Colloquium for scripting discussion with actual working BBCode!
http://ordinalmalaprop.com/engine/ - An Engine Fit For My Proceeding, my Aethernet Journal
http://www.flickr.com/groups/slgriefbuild/ - Second Life Griefbuild Digest, pictures of horrible ad griefing and land spam, and the naming of names
|
|
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
|
02-02-2008 13:20
38 tries to raed this thread... 17 to reply....
I hope it's worth it
remember that any object rezed on no-script land won't be doing anything like dying or deleting a script, so if there are other contents they can easily be stripped by this method.
if it's just the script itself that's vunerable, no big deal, since a non running script is about as useful as a deleted one, and your self delete action will run the next time the script runs.
_____________________
| | . "Cat-Like Typing Detected" | . This post may contain errors in logic, spelling, and | . grammar known to the SL populace to cause confusion | | - Please Use PHP tags when posting scripts/code, Thanks. | - Can't See PHP or URL Tags Correctly? Check Out This Link... | - 
|
|
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
|
02-02-2008 18:58
**Curses again at removing and deleting object inventory not counting as "modifying" according to the SL permissions system.** 
|