OsGetLastChangedEventKey: Difference between revisions

From OpenSimulator
Jump to navigationJump to search
imported>Djphil
Clarify the use of this function
imported>Djphil
m Change See Also
 
(2 intermediate revisions by the same user not shown)
Line 7: Line 7:
To test this example script, you must set the object and script to "Anyone: Copy".<br>
To test this example script, you must set the object and script to "Anyone: Copy".<br>
Another user can then copy the object to their inventory, rezz it and test it.<br>
Another user can then copy the object to their inventory, rezz it and test it.<br>
In this way, this user becomes the new owner of the object without modification rights (no-mod)
In this way, this user becomes the new owner of the object without modification rights (no-mod).
<source lang="lsl">
<source lang="lsl">
//
//
// osGetLastChangedEventKey Script Exemple
// osGetLastChangedEventKey Script Exemple
// Author: djphil
// Author: Ubit
//
//


Line 54: Line 54:
|additional_info=This function was added in 0.9.1.0, February, 22 2019
|additional_info=This function was added in 0.9.1.0, February, 22 2019
}}
}}
'''See Also:'''
== See Also ==
* [[osGetInventoryName]]
* [[osGetInventoryName]]
* [[osGetInventoryDesc]]
* [[osGetInventoryDesc]]

Latest revision as of 02:58, 6 December 2020

key osGetLastChangedEventKey()
No descriptions provided
Threat Level This function does not do a threat level check
Permissions Use of this function is always allowed by default
Extra Delay 0 seconds
Example(s)
To test this example script, you must set the object and script to "Anyone: Copy".

Another user can then copy the object to their inventory, rezz it and test it.
In this way, this user becomes the new owner of the object without modification rights (no-mod).

//
// osGetLastChangedEventKey Script Exemple
// Author: Ubit
//

default
{
    state_entry()
    {
        llSay(PUBLIC_CHANNEL, "Drop a item to this primitive's inventory to see osGetLastChangedEventKey usage.");
        llAllowInventoryDrop(TRUE);
    }

    changed(integer change)
    {
        if (change & CHANGED_INVENTORY)         
        {
            llSay(PUBLIC_CHANNEL, "The inventory has changed ...");
        }

        if (change & CHANGED_ALLOWED_DROP)
        {
            llSay(PUBLIC_CHANNEL, "An item has been dropped in this primitive's inventory");

            key id = osGetLastChangedEventKey();

            if (id != "")
            {
                key who = osGetInventoryLastOwner(id);
                llSay(PUBLIC_CHANNEL, "I got inventory dropped item " + (string)id);
                llSay(PUBLIC_CHANNEL, "Item dropped by "+ (string)who + " (" + llKey2Name(who) + ")");
                llSay(PUBLIC_CHANNEL, "The item name is " + osGetInventoryName(id));
                llSay(PUBLIC_CHANNEL, "The item description is " + osGetInventoryDesc(id));
            }

            else
            {
                llSay(PUBLIC_CHANNEL, "This item id is empty ...");
            }
        }
    }
}
Notes
This function was added in 0.9.1.0, February, 22 2019


See Also