Difference between revisions of "Permission watch & blacklist"

From Second Life Wiki
Jump to navigation Jump to search
(Permissions watcher and blacklist)
 
Line 1: Line 1:
//lsl_Script: Permissions watcher & blacklist.
//lsl_Script: Permissions watcher & blacklist.
//this page needs to be cleaned up....
   
   
//By Flew Voom/B00tsy Compton 2009
//By Flew Voom/B00tsy Compton 2009
Line 13: Line 14:


list blacklist=["avatar name","avatar name","avatar name","avatar name"];
list blacklist=["avatar name","avatar name","avatar name","avatar name"];
//Enter avatar names here between the "quotes" that you want to blacklist. Blacklisted avatars will not be able to use your product. It auto detaches and deletes when rezzed. You can add more names by adding: ,"avatar name" This is mostly useful for objects/products that you regularly update and when you send the updates to your users. The blacklisted users will not be able to use updated versions anymore.
//Enter avatar names here between the "quotes" that you want to blacklist. Blacklisted avatars will not be able to use your product. It auto detaches and deletes when rezzed. You can add more names by adding: ,"avatar name" This is mostly useful for objects/products that you regularly update and when you send the updates to your users. The blacklisted users will not be able to use updated versions anymore.



Revision as of 04:13, 4 March 2011

//lsl_Script: Permissions watcher & blacklist. //this page needs to be cleaned up....

//By Flew Voom/B00tsy Compton 2009 --B00tsy Compton 03:10, 4 March 2011 (PST)

//This script can freely be used and modded. Do not sell the script, it is ment as open source.

//Simple way to Ban users from using your scripted object and checks for alterations of script permissions. Optionally it also deletes scripts from the object.



list blacklist=["avatar name","avatar name","avatar name","avatar name"];

//Enter avatar names here between the "quotes" that you want to blacklist. Blacklisted avatars will not be able to use your product. It auto detaches and deletes when rezzed. You can add more names by adding: ,"avatar name" This is mostly useful for objects/products that you regularly update and when you send the updates to your users. The blacklisted users will not be able to use updated versions anymore.




default { on_rez(integer start_param) { llResetScript(); } state_entry() {


   //checks script permissions

integer PERMS_OPEN = (PERM_MODIFY | PERM_COPY | PERM_TRANSFER); string check = llGetScriptName(); integer checkperms = llGetInventoryPermMask(check, MASK_EVERYONE); integer nextPerms = llGetInventoryPermMask(check, MASK_NEXT); if (!(checkperms & PERM_MODIFY)) { if ((nextPerms & PERMS_OPEN) == PERMS_OPEN) {



//When full perms is detected the script takes permission to attach to the avatar (if already attached the avatar will not notice the permission request).This command is needed to detach from the avatar when full perms are detected.
    llRequestPermissions(llGetOwner(),PERMISSION_ATTACH);
   
   
   
   
   //Place your avatar key here below between the "quotes". Using your key is better then the alternative "llGetCreator()" command. This way even if someone forges the creator name on your product it will still inform you instead of the new fake creator name. you can of course change all the warning messages to your own liking.

llInstantMessage("PLACE YOUR AVATAR UUID/KEY HERE","warning! permissions have been altered! Modify, Copy, Transfer enabled. " + check); //sends you the script name that is being opened, the owner name, the region and exact position with a timestamp. key owner = llGetOwner();

      llInstantMessage("PLACE YOUR AVATAR UUID/KEY HERE"," Owner name is: " +(llKey2Name(llGetOwner())));

vector position = llGetPos(); llInstantMessage("PLACE YOUR AVATAR UUID/KEY HERE",( "Rezzed at position: " + (string)position)); llInstantMessage("PLACE YOUR AVATAR UUID/KEY HERE", "Rezzed in region: " + llGetRegionName() + " "); llOwnerSay("You are using an illegal or an exploited copy of this product. Your name has been logged and the creator has been notified " + (llKey2Name(llGetOwner())));

//Optional.. //with llRemoveInventory command you can enter all the script names you wish to delete in the same object content. add: + " " if you want more script names in the line.

llRemoveInventory("write script name here" + "script name" + "... ");




 // When your object/product is an attached object/product (HUD or a sword for example) The product automaticly detaches from the avatar when full permissions have been detected. When rezzed inworld it will auto delete the product.    
llDetachFromAvatar();
       llDie();
   }
   
   
   
   
   //blacklist check
         if (llListFindList(blacklist,[llKey2Name(llGetOwner())])!=-1)
         

{


//Again, place your avatar key in between the "quotes" //Sends a message to the blacklisted user (change to your liking) and then detaches or deletes the product.

    llRequestPermissions(llGetOwner(),PERMISSION_ATTACH);
    llInstantMessage("PLACE YOUR AVATAR UUID/KEY HERE","A blacklisted resident tried to use your product. " + check);

key owner = llGetOwner();

      llInstantMessage("PLACE YOUR AVATAR UUID/KEY HERE"," Owner name is: " +(llKey2Name(llGetOwner())));
   llOwnerSay("You are blacklisted from using this product. Contact the creator if you think a mistake has been made.");

llOwnerSay( "/me Have a nice day.");

llDetachFromAvatar();
llDie();
   }

} } }