Difference between revisions of "User:Daemonika Nightfire/Scripts/Anti copy trans"
Jump to navigation
Jump to search
Kireji Haiku (talk | contribs) m (a few minor readability improvements) |
m (<lsl> tag to <source>) |
||
(One intermediate revision by one other user not shown) | |||
Line 5: | Line 5: | ||
Make sure that you not give away scripts with modify rights which contains this function. | Make sure that you not give away scripts with modify rights which contains this function. | ||
< | <source lang="lsl2"> | ||
/* | /* | ||
╔═════════════════════════════════════−−−→ | ╔═════════════════════════════════════−−−→ | ||
Line 12: | Line 12: | ||
*/ | */ | ||
// | // stored key's (UUID) of creator and reseller | ||
list | list CreatorKey = ["61ee201a-81cf-4322-b9a8-a5eb8da777c2","00000000-0000-0000-0000-000000000000"]; // expandable | ||
////////// global function \\\\\\\\\\ | |||
CorrectPerms?() | |||
{ | { | ||
llSetText("", ZERO_VECTOR, 0.0);// | string Script = llGetScriptName(); // ask for scriptname | ||
llSetText("", ZERO_VECTOR, 0.0); // clear floatingtext | |||
// compares the ownerkey with the key's in the list | |||
if(llListFindList(CreatorKey, llCSV2List(llGetOwner())) == -1) | |||
// | |||
if ( | |||
{ | { | ||
// if the ownerkey don't match, the script will delete itself when permission copy & tranfer is given | |||
integer | integer MaskOwner = llGetInventoryPermMask(Script, MASK_OWNER); | ||
if(( | if((MaskOwner & PERM_TRANSFER) && (MaskOwner & PERM_COPY) != 0) | ||
{ | { | ||
llOwnerSay("/me " + | llOwnerSay("/me " + Script + ": Sorry, i was not made for you. Goodbye"); | ||
llRemoveInventory( | llRemoveInventory(Script); | ||
} | } | ||
} | } | ||
// | // force the reseller to set (no copy) or (no trans), otherwise the script will not work | ||
integer | integer MaskNext = llGetInventoryPermMask(Script, MASK_NEXT); | ||
if(( | if((MaskNext & PERM_TRANSFER) && (MaskNext & PERM_COPY) != 0) | ||
{ | { | ||
llSetText(" | llSetText("please correct the script-permission to:\n(copy/no transfer) or (no copy/transfer)", <1,1,0>, 1.0); | ||
state Offline; | |||
state | |||
} | } | ||
} | } | ||
Line 51: | Line 44: | ||
default | default | ||
{ | { | ||
state_entry() | |||
{ | { | ||
CorrectPerms?(); // starts the global function | |||
} | } | ||
touch_start(integer total_number) // just for show that it work | |||
{ | |||
llSay(0, "Yay, script-permission correct."); | |||
} | |||
changed(integer change) | changed(integer change) | ||
{ | { | ||
if (change & (CHANGED_OWNER | CHANGED_INVENTORY)) | if(change & (CHANGED_OWNER|CHANGED_INVENTORY)) | ||
{ | |||
llResetScript(); | llResetScript(); | ||
} | |||
} | } | ||
on_rez(integer Dae) | |||
{ | { | ||
llResetScript(); | |||
} | } | ||
} | } | ||
state | state Offline | ||
{ | { | ||
state_entry() | |||
{ | { | ||
llOwnerSay("Sorry, please correct the script-permission"); | |||
} | } | ||
changed(integer change) | changed(integer change) | ||
{ | { | ||
if (change & (CHANGED_OWNER | CHANGED_INVENTORY)) | if(change & (CHANGED_OWNER|CHANGED_INVENTORY)) | ||
{ | |||
llResetScript(); | llResetScript(); | ||
} | |||
} | } | ||
on_rez(integer Dae) | |||
{ | { | ||
llResetScript(); | |||
} | } | ||
} | } | ||
</ | </source> |
Latest revision as of 18:17, 24 January 2015
*DS* Anti (copy & transfer)
This funktion allows you to give away scripts with copy & transfer permissions and force the reseller to change the permission. Additionally the script will delete itself when the customer of the reseller receives it with both permissions. Because it is a global function, it can be used universally.
Make sure that you not give away scripts with modify rights which contains this function.
/*
╔═════════════════════════════════════−−−→
║ *DS* Anti (copy & transfer) © by Daemonika Nightfire (daemonika.nightfire)
╚══════════════════════−−−→
*/
// stored key's (UUID) of creator and reseller
list CreatorKey = ["61ee201a-81cf-4322-b9a8-a5eb8da777c2","00000000-0000-0000-0000-000000000000"]; // expandable
////////// global function \\\\\\\\\\
CorrectPerms?()
{
string Script = llGetScriptName(); // ask for scriptname
llSetText("", ZERO_VECTOR, 0.0); // clear floatingtext
// compares the ownerkey with the key's in the list
if(llListFindList(CreatorKey, llCSV2List(llGetOwner())) == -1)
{
// if the ownerkey don't match, the script will delete itself when permission copy & tranfer is given
integer MaskOwner = llGetInventoryPermMask(Script, MASK_OWNER);
if((MaskOwner & PERM_TRANSFER) && (MaskOwner & PERM_COPY) != 0)
{
llOwnerSay("/me " + Script + ": Sorry, i was not made for you. Goodbye");
llRemoveInventory(Script);
}
}
// force the reseller to set (no copy) or (no trans), otherwise the script will not work
integer MaskNext = llGetInventoryPermMask(Script, MASK_NEXT);
if((MaskNext & PERM_TRANSFER) && (MaskNext & PERM_COPY) != 0)
{
llSetText("please correct the script-permission to:\n(copy/no transfer) or (no copy/transfer)", <1,1,0>, 1.0);
state Offline;
}
}
default
{
state_entry()
{
CorrectPerms?(); // starts the global function
}
touch_start(integer total_number) // just for show that it work
{
llSay(0, "Yay, script-permission correct.");
}
changed(integer change)
{
if(change & (CHANGED_OWNER|CHANGED_INVENTORY))
{
llResetScript();
}
}
on_rez(integer Dae)
{
llResetScript();
}
}
state Offline
{
state_entry()
{
llOwnerSay("Sorry, please correct the script-permission");
}
changed(integer change)
{
if(change & (CHANGED_OWNER|CHANGED_INVENTORY))
{
llResetScript();
}
}
on_rez(integer Dae)
{
llResetScript();
}
}