Billie Winslet Posted March 5, 2012 Share Posted March 5, 2012 Hi all. I have been searching everywhere for a snippet of a script that will let me collect all the names of no-copy inventory items as they are added to an object in a list. I only want to list the objects. Not notecards,scripts etc.Can anyone help me out with just a sample or a link to a sample? I am fairly confident is scripting so I am defiantlly not asking for someone to do it all for me just help me get started.Thank you Link to comment Share on other sites More sharing options...
Darkie Minotaur Posted March 5, 2012 Share Posted March 5, 2012 First you get the number of inventory items in the list - and then you iterate over the items in a loop. Then - at each loop, you check: is it a script - next loop is it a nc - next loop in both cases you use llGetInventoryType if non of the conditions is true, you check if copy permission is set or not using llGetInventoryPermMask . If I hope this helps you. 2 Link to comment Share on other sites More sharing options...
Dora Gustafson Posted March 5, 2012 Share Posted March 5, 2012 Here is a snippet that displays an inventory list and adds a a note for attributes not set for each inventory item: string s;string content="";integer no_perm;integer i;integer x = llGetInventoryNumber(INVENTORY_ALL);for ( i=x-1; i>=0; i-- ){ s = llGetInventoryName(INVENTORY_ALL, i); content += "\n"+": "+s ; no_perm = ~llGetInventoryPermMask( s, MASK_NEXT ); if ( no_perm & PERM_MODIFY ) content += " (No Modify)"; if ( no_perm & PERM_COPY ) content += " (No Copy)"; if ( no_perm & PERM_TRANSFER ) content += " (No Transfer)";}llOwnerSay(content); This is for next owner's permissionsSubstitute MASK_NEXT with MASK_OWNER to reflect curent permissions 1 Link to comment Share on other sites More sharing options...
Lilmix Pixelmaid Posted March 5, 2012 Share Posted March 5, 2012 This is a piece of code I came up with just now as I have a project coming up that will probably use it also. I havent compiled it so I hope there is not too many errors. But hopefully helpful for you and others too. //Define Varlist Object_list;//Define Functionlist Make_Inv_List(){list objects = [];integer l = llGetInventoryNumber(INVENTORY_OBJECT); while(l){ string Object_name = llGetInventoryName(INVENTORY_OBJECT, --l); if ((PERM_COPY & llGetInventoryPermMask(Object_name, MASK_OWNER)) == 0) { //object was no copy objects = Object_name + objects; } }return objects;}//Start Defaultdefault{ state_entry() { Object_list = Make_Inv_List(); llSay(0,llDumpList2String(Object_list, " \n"));//Output the contents of "Object_list" for debuging } changed( integer change ) { if ( change == CHANGED_INVENTORY ) { //If the Inventory has changed Object_list = Make_Inv_List(); llSay(0,llDumpList2String(Object_list, " \n"));//Output the contents of "Object_list" for debuging } }} xoxo Lilmix xoxo 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now