Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

possible to obtain ID of person who dropped a script onto an object?

Ged Larsen
thwarted by quaternions
Join date: 4 Dec 2006
Posts: 294
01-06-2007 02:18
I (and a person who kindly responded on the Scripters group IM) don't think this is possible, but I'll try asking anyway:

Is there a way for a script to know WHO dragged a script onto a MOD-permission enabled object, if that person might not be the owner of the object itself?

llGetOwner and llGetOwnerKey will return the owner of the object, not the person who dragged the script (the "owner" of the script), I believe.

The reason I want to get the ID, is to be able to set up an llDialog to ask the script-dragger which of a set of options to perform. The only solution I can come up with is kludgy, which is to force a Touch sensor, and then do an llDetectedKey, which adds a pointless step.

Thanks.
Woopsy Dazy
Registered User
Join date: 12 Nov 2006
Posts: 173
01-06-2007 02:34
lslwiki states:

Q: Can I use the detection functions (llDetected*) with changed()?
A: No, they only work with touches, collisons and sensors.

Q: Can I find out who (or what) caused the object to change?
A: No.

So I guess you're forced to add another step :(
Peekay Semyorka
Registered User
Join date: 18 Nov 2006
Posts: 337
01-06-2007 03:09
Hmm, can an avatar even drop a script into a not-owned object? I didn't know that was possible. MOD-permission applies to the "next" owner after a transfer, not to the current object.

-peekay
Anti Antonelli
Deranged Toymaker
Join date: 25 Apr 2006
Posts: 1,091
01-06-2007 10:04
From: Peekay Semyorka
Hmm, can an avatar even drop a script into a not-owned object? I didn't know that was possible. MOD-permission applies to the "next" owner after a transfer, not to the current object.

-peekay

llAllowInventoryDrop

http://www.lslwiki.com/lslwiki/wakka.php?wakka=llAllowInventoryDrop
Dustin Widget
Script Monkey for hire
Join date: 15 Feb 2006
Posts: 101
01-06-2007 10:56
And if you read that wiki entry you will see that it doesn't allow for script drop.

If you do figure out how people can drop scripts, use

CODE
 
if(llGetInventoryCreator(item)!=llGetCreator())
Action;
}


it will do action if dropper of item was not the owner.
Just stick this under a changed event with a loop that looks at all items. It may be beneficial to keep a list of all items so that you can identify which is the newest one.

One thing to be aware of is that it will return the creator of the inventory, not the previous owner. There is really no good way to get the most recent owner if they aren't the creator.
Jacques Groshomme
Registered User
Join date: 16 Mar 2005
Posts: 355
01-06-2007 11:38
From: LSL Wiki

The exception are scripts, attempting to drop a script onto an object which allows inventory drops will cause the object to shout "Not permitted to edit this!".
  1. Really, it shouts this? Isn't that... insane? -- Catherine
  2. Heh, very much so, it does this also when using Tools > Save Object Back Into Object Contents :-\ -- Chris
  3. The exception to the exception is if the scripts are given from one object to another via llGiveInventory, which transfer the scripts in a non-running state



If another object gets the key to your object, and your object has llAllowInventoryDrop(True), then a script can be transferred via llGiveInventory(), albeit in a disabled state.

You can then use llResetOtherScript() to reactivate it.