Scripted Permissions Test

From Second Life Wiki
Jump to navigation Jump to search

[ScriptedPermissionsTest]

[VERSION] 0.1

[LENGTH] 00:45

[TESTERS] 2

[OVERVIEW] This test has been designed to test the Permissions changed via scripting.

[SETUP] 2 Users, User A: and User B:, Rezzable land and a small amount of money

[*]

[0010] User A: Find Some Rezzable land in a Sim with a Telehub

[0010.0010] User A: Right-click on the Ground and Select "Create" from the Pie Menu and Rez 5 Prim Cubes

[0010.0020] User A: Right-click on each cube in turn Select Edit and change the name of all five so each one is named one of the following.

[0010.0030] "PERMISSION_ATTACH", "PERMISSION_CHANGE_LINKS", "PERMISSION_DEBIT", "PERMISSION_TAKE_CONTROLS" and "PERMISSION_TRIGGER_ANIMATION"

[*]

[0020.0010] User A: Right-click on the "PERMISSION_ATTACH" prim and Select Edit, Click "More >>" if neccessary

[0020.0020] User A: In the General tab, Under Next owner can, Tick "Modify" and "Copy" and leave "Resell/GiveAway" Ticked"

[0020.0030] User A: Click the Contents Tab, and Press the "New Script" Button, Copy and Paste the following script over the default script.

[SCRIPT] Permissionattachscript

[0020.0040] User A: Once copied and Pasted, Click "Save" and Close the Script and Edit Windows.

[*]

[0030.0010] User A: Right-click on the "PERMISSION_CHANGE_LINKS" prim and Select Edit, Click "More >>" if neccessary

[0030.0020] User A: In the General tab, Under Next owner can, Tick "Modify" and "Copy" and leave "Resell/GiveAway" Ticked"

[0030.0030] User A: Click the Contents Tab, and Press the "New Script" Button, Copy and Paste the following script over the default script.

[SCRIPT] Permissionchangelinksscript

[0030.0040] User A: Once copied and Pasted, Click "Save" and Close the Script and Edit Windows.

[*]

[0040.0010] User A: Right-click on the "PERMISSION_DEBIT" prim and Select Edit, Click "More >>" if neccessary

[0040.0020] User A: In the General tab, Under Next owner can, Tick "Modify" and "Copy" and leave "Resell/GiveAway" Ticked"

[0040.0030] User A: Click the Contents Tab, and Press the "New Script" Button, Copy and Paste the following script over the default script.

[SCRIPT] Permissiondebitscript

[0040.0040] User A: Once copied and Pasted, Click "Save" and Close the Script and Edit Windows.

[*]

[0050.0010] User A: Right-click on the "PERMISSION_TAKE_CONTROLS" prim and Select Edit, Click "More >>" if neccessary

[0050.0020] User A: In the General tab, Under Next owner can, Tick "Modify" and "Copy" and leave "Resell/GiveAway" Ticked"

[0050.0030] User A: Click the Contents Tab, and Press the "New Script" Button, Copy and Paste the following script over the default script.

[SCRIPT] Permissiontakecontrolscript

[0050.0040] User A: Once copied and Pasted, Click "Save" and Close the Script and Edit Windows.

[*]

[0060.0010] User A: Right-click on the "PERMISSION_TRIGGER_ANIMATION" prim and Select Edit, Click "More >>" if neccessary

[0060.0020] User A: In the General tab, Under Next owner can, Tick "Modify" and "Copy" and leave "Resell/GiveAway" Ticked"

[0060.0030] User A: Click the Contents Tab, and Press the "New Script" Button, Copy and Paste the following script over the default script.

[SCRIPT] Permissiontriggeranimationscript

[0060.0040] User A: Once copied and Pasted, Click "Save" and Close the Script and Edit Windows.

[*]

[0070.0010] User A: Right-click on each cube in turn and select "Take" From the Pie Menu

[0070.0020] User A: Open your Inventory, Click the "Create" Menu at the Top and Select "New Folder"

[0070.0030] User A: Find the "New Folder", Righ-click on it and Select "Rename", rename it to "PERMISSIONS TEST"

[0070.0040] User A: Find the 5 named cubes you took from inworld and then drag them into the PERMISSIONS TEST Folder.

[0070.0050] User A: On the Rezzable Land, Drag a copy of each cube from the PERMISSIONS TEST folder in your Inventory on the Ground

[0070.0060] User A: Next to the "PERMISSION_CHANGE_LINKS" cube, Right Click on the Ground, Select "Create" and Rez a cube, Close the edit Window

[0070.0070] User A: Left-click on each box and accept permissions

[0070.0080] User A: Left-click on each box again to run the test, and Verify:

[0070.0090] User A: Verify The cube called "PERMISSION_ATTACH" attaches to your right shoulder.

[0070.0100] User A: Verify The cube called "PERMISSION_CHANGE_LINKS" links the nearest unscripted box to itself (You will need to create a box near it which it can link each time you run this test).

[0070.0110] User A: Verify The cube called "PERMISSION_DEBIT" pays $5 of your money to whoever touches it.

[0070.0120] User A: Verify The cube called "PERMISSION_TAKE_CONTROLS" watches your controls and chat if you walk backward or click your mouse button while in mouselook.

[0070.0130] User A: Verify The cube called "PERMISSION_TRIGGER_ANIMATION" makes you do a backflip.

[*]

[Negative Cases - Should Release Permissions Of Original Owner]

[*]

[Given objects release permissions]

[*]

[0080.0010] User A: Right-click on each of the 5 cubes and Select "Take" from the Pie Menu

[0080.0020] User A: From your Inventory pass a copy of the PERMISSIONS TEST folder with the 5 cubes in it to User B:

[0080.0030] User B: Accept these Items

[0080.0040] User B: Find the PERMISSIONS TEST folder and Rez a copy of each cube in world.

[0080.0050] User B: Left-click on each box

[0080.0060] User B: Verify the ask you for Permissions.

[0080.0070] User B: Accept Permissions

[*]

[Sold objects release permissions]

[*]

[0090.0010] User B: Right-click on Each of your 5 cubes in turn, and Select "Edit"

[0090.0020] User B: In the General tab, Tick the "For Sale" Tickbox, Enter a price of 0, and Select the "Original" Sale type

[0090.0030] User B: Close the window, and Set all 5 cubes for Sale in the same manner.

[0090.0040] User A: Right-click on each of User B:'s cubes and Select "Buy" until you own all 5

[0090.0050] User A: Left-click on each of the boxes

[0090.0060] User A: Verify that each asks you for Permissions

[0090.0070] User A: Accept Permissions

[*]

[Reset scripts release permissions]

[*]

[0100.0010] User A: Right-click on each of the 5 cubes and Select "Edit" from the Pie Menu

[0100.0020] User A: Click the "Content" Tab, Open the Script and Click "Reset"

[0100.0030] User A: Close the Script and Edit Window and Repeat for all 5 Prim Cubes

[*]

[NOTE] Permissions should now be released.

[*]

[0100.0040] User A: Left-click on each box

[0100.0050] User A: Verify that each asks you for Permissions

[0100.0060] User A: Accept Permissions

[*]

[Resaved scripts release permissions]

[*]

[0110.0010] User A: Right-click on each of the 5 cubes and Select "Edit" from the Pie Menu

[0110.0020] User A: Click the "Content" Tab, Open the Script

[0110.0030] User A: Resave the Scripts(insert a space, then delete it, then click save)

[0110.0040] User A: Close the Script and Edit Window and Repeat for all 5 Prim Cubes

[*]

[NOTE] Permissions should now be released.

[*]

[0110.0050] User A: Left-click on each box

[0110.0060] User A: Verify that each asks you for Permissions

[0110.0070] User A: Accept Permissions

[*]

[Positive Cases - Should Keep Permissions]

[*]

[Relog while script remains in world]

[*]

[0120.0010] User A: Drag the cubes to the ground from your inventory (if they are not already on the ground)

[0120.0020] User A: Relog

[0120.0030] User A: Left-click on each cube

[0120.0040] User A: Verify they do their scripted behavior

[*]

[Teleport to same sim]

[*]

[0130.0010] User A: Right-click on each cube, select "More > Attach >" and then choose a different location for each cube until you have attached all 5

[0130.0020] User A: Create a landmark of your location by Selecting the "World" menu and "Create Landmark Here"

[0130.0030] User B: walk a few meters away, then Right-click on User A: Select "Profile" and "Offer Teleport"

[0130.0040] User A: Accept the Teleport

[0130.0050] User A: Right-click on each of the attached cubes and Select "Drop"

[0130.0060] User A: Left-click on each box

[0130.0070] User A: Verify each does its scripted behavior without asking for permissions.

[*]

[Teleport to a different sim]

[*]

[0130.0010] User A: Right-click on each cube, select "More > Attach >" and then choose a different location for each cube until you have attached all 5

[0130.0020] User A: Fly to another sim (out of telehub range from your current one)

[0130.0030] User A: Select the landmark you made earlier (from the Map or your Inventory) and Teleport back to that Telehub sim, and fly the rest of the way towards the beacon, where User B is.

[0130.0040] User A: Right-click on each of the attached cubes and Select "Drop"

[0130.0050] User A: Left-click on each box

[0130.0060] User A: Verify each does its scripted behavior without asking for permissions.

[*]

[Die]

[*]

[0140.0010] User A: Right-click on each cube, select "More > Attach >" and then choose a different location for each cube until you have attached all 5

[0140.0020] User A: Die Somehow (Fall from a height on Unsafe land etc)

[0140.0030] User A: Right-click on each of the attached cubes and Select "Drop"

[0140.0040] User A: Left-click on each box

[0140.0050] User A: Verify each does its scripted behavior without asking for permissions.

[*]

[Cross a region boundary]

[*]

[0150.0010] User A: Right-click on each cube, select "More > Attach >" and then choose a different location for each cube until you have attached all 5

[0150.0020] User A: Fly to another sim

[0150.0030] User A: Find some Rezzable land

[0150.0040] User A: Right-click on each of the attached cubes and Select "Drop"

[0150.0050] User A: Left-click on each box

[0150.0060] User A: Verify each does its scripted behavior without asking for permissions.

[*]

[Sim restart]

[*]

[0160] User A: You may need to skip this test unless you can find a linden to do the sim reset.

[0160.0010] User A: While the boxes are on the ground, log out and reset the sim.

[0160.0020] User A: Left-click on each box

[0160.0030] User A: Verify each does its scripted behavior without asking for permissions.

[*]

[Relog with script attached (script leaves world)]

[*]

[0170.0010] User A: Right-click on each cube, select "More > Attach >" and then choose a different location for each cube until you have attached all 5

[0170.0020] User A: Relog

[0170.0030] User A: Right-click on each of the attached cubes and Select "Drop"

[0170.0040] User A: Left-click on each box

[0170.0050] User A: Verify each does its scripted behavior without asking for permissions.

[0170.0060] User A & B: Delete any of your Prims on the Ground.

[*]

[llGiveInventoryList does not remove no-copy object from object inventory]

[*]

[0170.0010] User A & B: Relocate Back in the Same Sim as each other, Clean up any prims.

[0170.0020] User B: Right-click on the Ground and Select "Create" from the Pie Menu and Rez 3 Prim Cubes and 1 Prim Sphere, Call sphere "givesphere"

[0170.0030] User B: Right-click on the Prim cubes and Select "Take" leaving only the Sphere.

[0170.0040] User B: Right-click on the Sphere and Select "Edit" from the Pie Menu

[0170.0050] User B: Click the "More >>" button if neccesary and Click the General Tab

[0170.0060] User B: Under the "Next owner can:" Permissions, Tick the "Modify", "Copy", and Leave "Resell/GiveAway" Ticked, Then Click the Content Tab

[0170.0070] User B: Open your Inventory and locate the 3 Prim Cubes you just took, and drag them to the Contents of the Sphere, Then Close the Edit Window

[0170.0080] User B: Right-click on the sphere and Select "Take" From the Pie Menu

[0170.0090] User B: From your Inventory find the object "givesphere" and pass it to User A:

[0170.0100] User A: Accept the Item

[0170.0110] User A: Find the item "givesphere" in your Inventory and Rez it inworld

[0170.0120] User A: Right-click on the sphere and Select Edit, Click "More >>" if neccessary

[0170.0130] User A: Click the Contents Tab, and Press the "New Script" Button, Copy and Paste the following script over the default script.

[SCRIPT] llGiveinventorylistscript

[0170.0140] User A: Once copied and Pasted, Click "Save" and Close the Script and Edit Windows.

[0170.0150] User A: Left-click on the sphere

[0170.0160] User A: Verify you get an error "Unable to give inventory list: No items passed filter"

[*]

[No-copy removed from inventory via llRezObject]

[*]

[0180.0010] User A: Right-click on the sphere and Select "Edit", Click "More >>" if neccessary

[0180.0020] User A: Click the Content Tab and Delete all the Contents of the sphere.

[0180.0030] User A: Right-click on the Ground and Select "Create" from the Pie Menu and Rez a Cube

[0180.0040] User A: Right-click on the Cube and Select "Edit", In the General Tab, Verify "Copy" is unticked

[0180.0050] User A: Right-click on the Cube and Select "Take" From the Pie Menu

[0180.0060] User A: Right-click on the Sphere and Select "Edit" from the Pie Menu, Select the Content Tab

[0180.0070] User A: Open your Inventory and locate the Cube you just took, and drag it to the Contents of the Sphere

[0180.0080] User A: While editing the Sphere Click the General Tab, Tick the "For Sale" Tickbox, set the price at 0 and the sale type to "Contents"

[0180.0090] User A: Close the Edit window.

[0180.0100] User B: Right-click on the Sphere and Select "Buy", and confirm the "Buy"

[0180.0110] User B: Right-click on the Sphere and Select "Edit" from the Pie Menu, Select the Content Tab

[0180.0120] User B: Verify that the object has been removed from inventory.

[0180.0130] User A: Delete the sphere

[*]

[0180.0140] User B: Right-click on the Ground and Select "Create" from the Pie Menu and Rez 1 Prim Sphere, Call sphere "rezsphere"

[0180.0150] User B: Right-click on the Sphere and Select "Edit" from the Pie Menu

[0180.0160] User B: Click the "More >>" button if neccesary and Click the General Tab

[0180.0170] User B: Under the "Next owner can:" Permissions, Tick the "Modify", "Copy", and Leave "Resell/GiveAway" Ticked

[0180.0180] User B: Right-click on the Ground and Select "Create" from the Pie Menu and Rez 1 Prim Cube, Call cube "rezcube"

[0180.0190] User B: Right-click on the Cube and Select "Edit" from the Pie Menu

[0180.0200] User B: Click the "More >>" button if neccesary and Click the General Tab

[0180.0210] User B: Verify Under the "Next owner can:" Permissions, that the "Copy" box is Unticked if not Do so.

[0180.0220] User B: Right-click on the Cube and Select "Take" From the Pie Menu

[0180.0230] User B: Right-click on the Sphere and Select "Edit" from the Pie Menu, Select the Content Tab

[0180.0240] User B: Open your Inventory and locate the Cube you just took, and drag it to the Contents of the Sphere

[0180.0250] User B: Right-click on the Sphere and Select "Take" from the Pie Menu

[0180.0260] User B: From your Inventory find the object "rezsphere" and pass it to User A:

[0180.0270] User A: Accept the Item

[0180.0280] User A: Find the item "rezsphere" in your Inventory and Rez it inworld

[0180.0290] User A: Right-click on the sphere and Select Edit, Click "More >>" if neccessary

[0180.0300] User A: Click the Contents Tab, and Press the "New Script" Button, Copy and Paste the following script over the default script.

[SCRIPT] llRezobjectscript

[0180.0310] User A: Once copied and Pasted, Click "Save" and Close the Script and Edit Windows.

[0180.0320] User A: Left-click on the sphere

[0180.0330] User A: Verify that the box is rezzed and removed from the contents of the sphere.

[0180.0340] User A: Right-click on the Rezzed Cube and Select "Take" from the Pie Menu

[0180.0350] User A: From your Inventory Verify that it is no-copy

[*]

[No-copy removed from inventory]

[*]

[0190.0010] User A: Open and Look in your Inventory for the Object "givesphere" which User B: gave you earlier.

[0190.0020] User A: Rez a copy of the Sphere inworld

[0190.0030] User A: Right-click on the Sphere and Select "Edit" from the Pie Menu

[0190.0040] User A: Click "More >>" if neccessary then, Click the Contents Tab

[0190.0050] User A: Drag a Cube from the Spheres Contents back into you Inventory

[0190.0060] User A: Verify you are given a warning popup message, "Though permitted, moving inventory may damage the object. Do you want to move that inventory item?".

[0190.0070] User A: Select Yes.

[0190.0080] User A: Open your Inventory and Find and Rez the Cube you just copied from the sphere

[0190.0090] User A: Right-click on the Cube and Select "Edit" from the Pie Menu

[0190.0100] User A: While holding the Shift key down, Left-click on another prim or object.

[0190.0110] User A: Goto the "Tools" Menu and Click "Link" or Press Ctrl-l

[0190.0120] User A: Verify you cannot link Cube to another object or to a linked object. You will receive a error message "...because you don't have modify permisssions on all the objects..."

[0190.0130] User A: Right-click on the Sphere and Select "Edit" from the Pie Menu

[0190.0140] User A: Click the "More >>" button if neccesary and Click the General Tab

[0190.0150] User A: Under the "Next owner can:" Permissions, Set these Permissions, "Modify" and "Resell/GiveAway" are Ticked/Allowed and "Copy" is unticked/nocopy

[0190.0160] User A: Select the Contents Tab, and Delete any Items in there

[0190.0170] User A: From your Inventory copy the "rezcube" object to the Contents of the sphere. Then Close the Edit window

[0190.0180] User A: Right-click on the Sphere and Select "Take" from the Pie Menu

[0190.0190] User A: From your Inventory find the object "givesphere" and pass it to User B:

[0190.0200] User B: Accept the Item

[0190.0210] User B: From your Inventory find the object "givesphere" and Rez it on the ground

[0190.0220] User B: Right-click on the sphere and Select Edit, Click "More >>" if neccessary

[0190.0230] User B: Click the Contents Tab, and Press the "New Script" Button, Copy and Paste the following script over the default script.

[SCRIPT] llGiveinventoryscript

[0190.0240] User B: Once copied and Pasted, Click "Save" and Close the Script and Edit Windows.

[0190.0250] User B: Left-click on the sphere

[0190.0260] User B: Select "Keep" when the blue system drop down window appears

[0190.0270] User B: Right-click on the sphere and Select Edit, Click Contents

[0190.0280] User B: Verify that Cube is given to you and removed from the sphere's contents.

[0190.0290] User B: Open your Inventory and drag Cube to the ground, Right-click and "Take" it again, Verifying that Cube is still no-copy.

[0190.0300] User A & B: Delete all your Prims

[END]


[Permissionattachscript]

// PERMISSION_ATTACH test 
default 
{ state_entry() 
{ 
llListen(0, "", "", "release"); 
} 
touch_start(integer num_detected) 
{ 
key on = llDetectedKey(num_detected - 1); 
if (on != NULL_KEY) 
{ 
integer perm = llGetPermissions(); 
if (perm != (PERMISSION_ATTACH)) 
{ 
llRequestPermissions(on, PERMISSION_ATTACH); 
} 
else 
{ 
llAttachToAvatar(4); 
} 
} 
} 
run_time_permissions(integer perm) 
{ 
if (perm) 
{ 
llWhisper(0, "you have permissions"); 
} 
} 
listen(integer channel, string name, key id, string message) 
{ 
llWhisper(0, "detaching"); 
llDetachFromAvatar(); 
llRequestPermissions(id, !PERMISSION_ATTACH); 
} 
}


[Permissionchangelinksscript]

// PERMISSION_CHANGE_LINKS test 
key attachtarget; 
key on; 
default 
{ state_entry() 
{ 
llListen(0, "", "", "release"); 
llSensorRepeat("", "", PASSIVE, 2, PI, 0.5); 
} 
touch_start(integer num_detected) 
{ 
on = llDetectedKey(num_detected - 1); 
if (on != NULL_KEY) 
{ 
integer perm = llGetPermissions(); 
if (perm != (PERMISSION_CHANGE_LINKS)) 
{ 
llRequestPermissions(on, PERMISSION_CHANGE_LINKS); 
} 
else 
{ 
llWhisper(0, "linking to "+(string)attachtarget); 
llCreateLink(attachtarget, TRUE); 
} 
} 
} 
run_time_permissions(integer perm) 
{ 
if (perm) 
{ 
llWhisper(0, "you have permissions"); 
} 
} 
listen(integer channel, string name, key id, string message) 
{ 
llBreakAllLinks(); 
llWhisper(0, "released"); 
llRequestPermissions(id, !PERMISSION_CHANGE_LINKS); 
} 
no_sensor() 
{ 
attachtarget = NULL_KEY; 
llSetText((string)attachtarget, <1,1,1>,1); 
} 
sensor(integer num_detected) 
{ 
attachtarget = llDetectedKey(num_detected - 1); 
llSetText((string)attachtarget, <1,1,1>,1); 
} 
} 


[Permissiondebitscript]

// PERMISSION_DEBIT test 
default 
{ 
state_entry() 
{ 
llListen(0, "", "", "release"); 
} 
touch_start(integer num_detected) 
{ 
key on = llDetectedKey(num_detected - 1); 
if (on != NULL_KEY) 
{ 
integer perm = llGetPermissions(); 
if (perm != (PERMISSION_DEBIT)) 
{ 
llRequestPermissions(on, PERMISSION_DEBIT); 
} 
else 
{ 
llGiveMoney(on, 5); 
} 
} 
} 
run_time_permissions(integer perm) 
{ 
if (perm) 
{ 
llWhisper(0, "you have permissions"); 
} 
} 
listen(integer channel, string name, key id, string message) 
{ 
llWhisper(0, "releasing controls"); 
llRequestPermissions(id, 0); 
} 
} 


[Permissiontakecontrolscript]

// PERMISSION_TAKE_CONTROLS test 
default 
{ 
state_entry() 
{ 
llListen(0, "", "", "release"); 
} 
touch_start(integer num_detected) 
{ 
key on = llDetectedKey(num_detected - 1); 
if (on != NULL_KEY) 
{ 
integer perm = llGetPermissions(); 
if (perm != (PERMISSION_TAKE_CONTROLS)) 
{ 
llRequestPermissions(on, PERMISSION_TAKE_CONTROLS); 
} 
else 
{ 
llWhisper(0, "walk backward or shoot in mouseview to test"); 
llTakeControls(CONTROL_BACK | CONTROL_ML_LBUTTON, TRUE, TRUE); 
} 
} 
} 
run_time_permissions(integer perm) 
{ 
if (perm) 
{ 
llWhisper(0, "you have permissions"); 
} 
} 
control(key name, integer level, integer edges) 
{ 
if level & CONTROL_BACK? 
{ 
llWhisper(0, "backward"); 
} 
if level & CONTROL_ML_LBUTTON? 
{ 
llWhisper(0, "mouselook fire"); 
} 
} 
listen(integer channel, string name, key id, string message) 
{ 
llWhisper(0, "releasing controls"); 
llRequestPermissions(id, !PERMISSION_TAKE_CONTROLS); 
} 
} 


[Permissiontriggeranimationscript]

// PERMISSION_TRIGGER_ANIMATION test 
default 
{ 
state_entry() 
{ 
llListen(0, "", "", "release"); 
} 
touch_start(integer num_detected) 
{ 
key on = llDetectedKey(num_detected - 1); 
if (on != NULL_KEY) 
{ 
integer perm = llGetPermissions(); 
if (perm != (PERMISSION_TRIGGER_ANIMATION)) 
{ 
llRequestPermissions(on, PERMISSION_TRIGGER_ANIMATION); 
} 
else 
{ 
llStartAnimation("backflip"); 
} 
} 
} 
run_time_permissions(integer perm) 
{ 
if (perm) 
{ 
llWhisper(0, "you have permissions"); 
} 
} 
listen(integer channel, string name, key id, string message) 
{ 
llWhisper(0, "releasing controls"); 
llStopAnimation("hold_R_rifle"); 
llRequestPermissions(id, !PERMISSION_TRIGGER_ANIMATION); 
} 
} 


[llGiveinventorylistscript]

default 
{ 
touch_start(integer total_number) 
{ 
integer num_objects = llGetInventoryNumber( INVENTORY_OBJECT ); 
list object_list = []; 
integer i; 
for ( i = 0; i < num_objects; i++ ) 
{ 
object_list = object_list + llGetInventoryName(INVENTORY_OBJECT,i); 
} 
llGiveInventoryList(llDetectedKey(0), "objecttest", object_list); 
} 
}


[llRezobjectscript]

default 
{ 
touch_start(integer total_number) 
{ 
llRezObject("Object", llGetPos() + <0,0,1>, <0,0,0>, <0,0,0,1>, 0); 
} 
}


[llGiveinventoryscript]

default
{
    touch_start(integer total_number)
    {
        llGiveInventory(llDetectedKey(0), 
            (string)llGetInventoryName(INVENTORY_OBJECT, 0));
    }
}