LlSameGroup Test

From Second Life Wiki
Jump to navigation Jump to search

[LLSameGroupTest]

[VERSION] 0.1

[LENGTH] 00:15

[TESTERS] 1

[OVERVIEW] This test has been designed to exercise the LLSameGroup LSL function.

[SETUP] This test requires 1 Tester and rezzable land

[*]

[0010] Right-click on yourself and Select "Groups" from the pie menu, Pick a group in which you are an officer, and Select "Activate"

[0020] Right-click on the ground and select "Create" from the pie menu and rez a default sphere

[0030] In Edit, Select "More >>" if neccesary then click the contents tab, and add the following script.

[SCRIPT] llSameGroupowner

[0040] In edit, click the General tab, and Check the "Share with group" Checkbox, Click "Deed" and acknowledge

[0050] Close the edit window

[0060] Left-click the sphere

[0070] The sphere will have chatted the Groups Key

[0080] Select and copy that key

[0090] Right-click on the ground and Select "Create" from the pie menu and rez a default cube

[0100] In edit, in the general tab set the group to a different one than your wearing to create the sphere (set group) is under creator and owner

[0110] Click the contents tab and copy the following script to the contents

[SCRIPT] llSameGrouptest

[0120] Double click on the script to open it and replace the "paste-id-here" with the key that was chatted earlier

[0130] Click save, and Exit the script and Edit windows

[0140] Verify the output from the cube is "NOT SAME GROUP, NOT SAME GROUP, SAME GROUP"

[0150] Delete your prims

[END]


[llSameGroupowner]

default
{
touch_start(integer x)
{
llSay(0,(string)llGetOwner());
}
}


[llSameGrouptest]

// llSameGroup test
string testSameGroup(key id)
{
    if (llSameGroup(id)) return "SAME GROUP";
    else return "NOT SAME GROUP";
}

default
{
    state_entry()
    {
        llSay(0,testSameGroup("paste-id-here") + ", " + testSameGroup(llGetOwner()) + ", " + testSameGroup(llGetKey()));
    }
}