La détection du viewer Cryolife se fait en écoutant le canal de son radar ( 8281825 ) donc, si l'utilisateur de ce copybot en possède le code source, il peut changer ce canal.
Voici un script qui permet d'éjecter d'un terrain toute personne sensée utiliser Cryolife.
// Cyroban script by Leah Mayo
// Anyone may copy, modify and redistribute the code at no charge.
// Credits: Ann Otoole for providing the information on Cyro viewer and testing the code
// Evil String for testing and suggesting improvements
// Users of http://thatotherlife.tk/ for testing
// Detects Cyro users in shout range (96m) and stores their names
// The Cyroban object must be owned by the land owner to be able
// to kick/ban Cyro users from land.
// On group owned land the Cyroban object must be deeded to group.
// Stores the names of detected Cyro users in any case.
// *****************************************************************************
// **** IMPORTANT: PUT YOUR AVATAR KEY AND NAME INTO THE authorities LIST ****
// *****************************************************************************
// List of authorities
// Put into this list the avatar keys and names of people who will have
// access to the menu and receive alerts by IM:
list authorities = [
"0cbb344f-0687-4882-b1d9-c6b534b1b905", "Cynthia Ultsch", "bb4b90e2-75cd-499c-b818-ad2f4199de11", "Ever Raleigh", "e0b9b4a6-581a-4ea8-b1ff-c8f271604397", "Miguelina Cazenove"
];
// Example list of authorities:
//
// list authorities = [
// "avatar-key-of-Evil-String", "Evil String",
// "avatar-key-of-Ann-Otoole", "Ann Otoole",
// "avatar-key-of-Leah-Mayo", "Leah Mayo"
// ];
//
// Each avatar key must be surrounded by quotes.
// Each avatar name must be surrounded by quotes too.
// A comma follows each entry (key or name), except the last entry in the list.
// The list must contain at least one AVkey/name pair, or nobody will be able to open the menu
// **** Default settings ****
float menu_timer = 42.0; // Wait 42 seconds for a menu choice before returning to detection
// The Following 5 variables can be toggled by menu individually.
// To restore defaults reset the script
integer IM_authorities = TRUE; // TRUE - enable alert by IM (default)
// FALSE - disable alert by IM
integer cyro_eject = FALSE; // TRUE - enable eject cyro user from parcel
// FALSE - disable eject cyro user from parcel (default)
integer cyro_TP_nome = TRUE; // TRUE - enable TP home cyro user (default)
// FALSE - disable TP home cyro user
integer cyro_ban = TRUE; // TRUE - enable ban cyro user (default)
// FALSE - disable ban cyro user
integer auto_kickban = TRUE; // TRUE - take action (eject/TPhome/ban) automatically (default)
// FALSE - don't take action, but store the name and time
// **********************************************************************************************
// **** Don't change anything below this line ****
// **** Constants ****
list OFF_ON = ["OFF", "ON"];
string newline = "\n\t\t";
// **** Variables ****
key owner;
key cyrouser_ID;
string cyrouser_name;
list detected_rippers = [];
integer cyro_channel = 8281825; // The channel Cyro shouts avatar keys on
string str_alert;
integer menu_channel = -15243;
key kMenuUser;
list menu_buttons;
string menu_message = " ";
// **** Functions ****
// Build a string containing date and time
string timeUTC() {
list timestamp = llParseString2List( llGetTimestamp(), ["T",".","Z"] , [] );
return " " + llDumpList2String(llDeleteSubList(timestamp, 2, 2), " ") + " UTC";
}
// IM the list of detected names (and time of detection) to the menu user
dump_list() {
string str_list = "Detected Cyro rippers:";
integer len = llGetListLength( detected_rippers );
integer i;
for( i = 0; i < len; i++ ) {
str_list += newline + llList2String(detected_rippers, i);
}
str_list += newline + "Total = " + (string)len;
llInstantMessage(kMenuUser, str_list);
str_list = (string)llGetFreeMemory() + " bytes free. ";
str_list += "Remember to reset the script when you are running out of memory.";
llInstantMessage(kMenuUser, str_list);
}
// List current settings
current_settings(key user) {
string str_settings = "Current settings:";
str_settings += newline + "Alert by IM is " + llList2String(OFF_ON, IM_authorities);
str_settings += newline + "Eject from parcel is " + llList2String(OFF_ON, cyro_eject);
str_settings += newline + "TP home is " + llList2String(OFF_ON, cyro_TP_nome);
str_settings += newline + "Ban from parcel is " + llList2String(OFF_ON, cyro_ban);
str_settings += newline + "Automatic Eject/TP/Ban is " + llList2String(OFF_ON, auto_kickban);
str_settings += newline + "Menu timer is set to " + (string)((integer)menu_timer) + " seconds";
llInstantMessage(user, str_settings);
str_settings = "Authorized users:";
integer len = llGetListLength( authorities );
integer i;
for( i = 0; i < len/2; i++ ) {
str_settings += newline + llList2String(authorities, i*2+1);
}
str_settings += newline + "Total = " + (string)(len/2);
llInstantMessage(user, str_settings);
}
// Check if detected name is already on the list
integer isNameOnList( string name ) {
integer len = llGetListLength( detected_rippers );
integer i;
for( i = 0; i < len; i++ ) {
if(llSubStringIndex(llList2String(detected_rippers, i), name) == 0) {
return TRUE;
}
}
return FALSE;
}
// Check if an authorized person touched the object
integer isAuthority(key user) {
integer len = llGetListLength( authorities );
integer i;
for( i = 0; i < len/2; i++ ) {
if(llSubStringIndex(llList2String(authorities, i*2), (string)user) == 0) {
return TRUE;
}
}
return FALSE;
}
// Alert all authorities by IM
do_alert(string alert) {
integer len = llGetListLength(authorities);
integer i;
for( i = 0; i < len/2; i++ ) {
llInstantMessage(llList2Key(authorities, i*2), alert);
}
}
// **** Code ****
default {
state_entry() {
owner = llGetOwner();
if(kMenuUser) {
current_settings(kMenuUser);
} else {
current_settings(owner);
}
if(llGetListLength(authorities) < 2) {
llOwnerSay("Plese provide your Avatar Key and Name. Open the script and read comments to do so.");
}
kMenuUser = NULL_KEY;
cyrouser_ID = NULL_KEY;
llSay(0, "Starting detection");
llListen(cyro_channel, "", NULL_KEY, "");
}
listen(integer channel, string name, key id, string message) {
cyrouser_name = name;
cyrouser_ID = id;
if (llGetAgentSize((key)message)) { // check if the shouted avatar key is in the region
if(auto_kickban) {
if (cyro_eject) llEjectFromLand(cyrouser_ID);
if (cyro_TP_nome) llTeleportAgentHome(cyrouser_ID);
if (cyro_ban) llAddToLandBanList(cyrouser_ID, 0.0);
}
if (!isNameOnList(cyrouser_name)) {
// Add detected ripper to the list
detected_rippers += cyrouser_name + " " + timeUTC();
}
cyrouser_ID = NULL_KEY;
str_alert = "Cyro Ripper called " + name + " yelled the AVkey of " + llKey2Name((key)message);
// Alert the device owner
// (works only if the device is not deeded to group).
// llOwnerSay(str_alert);
// llInstantMessage(owner, str_alert);
// Alert authorities on list
if (IM_authorities) {
do_alert(str_alert);
}
}
}
touch_end(integer total_number) {
if (isAuthority(llDetectedKey(0))) {
kMenuUser = llDetectedKey(0);
state menu;
}
}
}
state menu {
state_entry() {
menu_buttons = ["LIST", "SETTINGS", "BACK", "Toggle BAN", "Toggle EJECT", "RESET", "Toggle TP", "Toggle AUTO", "Toggle Alert"];
menu_message = "\nLIST - List detected users of Cyro";
menu_message += "\nSETTINGS - List current settings";
menu_message += "\nBACK - Back to Detection Mode";
menu_message += "\nRESET - Reset the script";
menu_message += "\nToggle Alert - Set IM Alert " + llList2String(OFF_ON, IM_authorities^TRUE);
menu_message += "\nToggle TP - Set TP home " + llList2String(OFF_ON, cyro_TP_nome^TRUE);
menu_message += "\nToggle BAN - Set Parcel Ban " + llList2String(OFF_ON, cyro_ban^TRUE);
menu_message += "\nToggle EJECT - Set Eject " + llList2String(OFF_ON, cyro_eject^TRUE);
menu_message += "\nToggle AUTO - Set automatic kick/ban " + llList2String(OFF_ON, auto_kickban^TRUE);
llListen(menu_channel, "", kMenuUser, "");
llSetTimerEvent(menu_timer);
llDialog(kMenuUser, menu_message, menu_buttons, menu_channel);
}
timer() {
llSetTimerEvent(0.0);
state default;
}
listen(integer channel, string name, key id, string message) {
if (id == kMenuUser) {
if (message == "RESET") {
llResetScript();
} else if (message == "LIST") {
dump_list();
state default;
} else if (message == "SETTINGS") {
current_settings(kMenuUser);
llSetTimerEvent(menu_timer);
llDialog(kMenuUser, menu_message, menu_buttons, menu_channel);
} else if (message == "Toggle EJECT") {
cyro_eject = cyro_eject^TRUE;
state default;
} else if (message == "Toggle Alert") {
IM_authorities = IM_authorities^TRUE;
state default;
} else if (message == "Toggle TP") {
cyro_TP_nome = cyro_TP_nome^TRUE;
state default;
} else if (message == "Toggle BAN") {
cyro_ban = cyro_ban^TRUE;
state default;
} else if (message == "Toggle AUTO") {
auto_kickban = auto_kickban^TRUE;
state default;
} else {
state default;
}
}
}
}