//DO NOT SELL THIS SCRIPT - You got it free, share it freely. //Opensim is FREE - Servers and Resources ARE NOT - Grid Operators and Content Creators need your support. ////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////// //CUSTOMIZABLE PARAMS string warning = "ADULTS ONLY - Avatars with child-like attributes are automatically ejected"; string place = "YourREGION-Name"; //name your region //string staffMsg = " was removed for using a child avatar."; float sizeLimit = 1.6; //height limit of avatars in region, in arbitrary units float scanInterval = 30;//the interval of scanning in seconds integer scope = AGENT_LIST_REGION;//either AGENT_LIST_PARCEL or AGENT_LIST_REGION string kickmes = "Session Terminated - Avatars with child-like attributes are not allowed."; string method = "tphome"; //set to either "eject" or "tphome" //DO NOT TOUCH - UNLESS YOU KNOW WHAT YOU ARE DOING! ////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////// integer on = FALSE; string forbiddenCreatorFile = "CreatorList"; string forbiddenAttachmentFile = "AttachmentList"; string forbiddenWordFile = "BadWords"; string sizeLimitFile = "HeightLimit"; key sizeLimitReq; key owner; integer ready = FALSE; //data lists list forbiddenWords = []; list forbiddenAttNames = []; list forbiddenCreators = []; //flags integer gotWords = FALSE; integer gotNames = FALSE; integer gotCreators = FALSE; integer gotSizeLimit = FALSE; amIready() { if(gotWords == TRUE && gotNames == TRUE && gotCreators == TRUE && gotSizeLimit == TRUE) { if(ready == FALSE) { llOwnerSay("ChildGATE OFF."); } ready = TRUE; llSetText("OFF",<1,0,0>,1); } } integer scanPersonForBadStuff(key avi) { list attachments = llGetAttachedList(avi); integer attLen = llGetListLength(attachments); integer iAtt = 0; do { key att = (key)llList2String(attachments,iAtt); string attName = llToLower(llKey2Name(att)); if(llGetListLength(forbiddenCreators) > 0) { key objCreator = llList2Key(llGetObjectDetails(att,[OBJECT_CREATOR]),0); if(llListFindList(forbiddenCreators,[objCreator]) != -1) { //creator is forbidden return TRUE; } } if(llGetListLength(forbiddenAttNames) > 0) { //Creator not forbidden, check attachment names list if(llListFindList(forbiddenAttNames,[attName]) != -1) { //attachment name is forbidden return TRUE; } integer len = llGetListLength(forbiddenAttNames); integer i = 0; do { string fName = llList2String(forbiddenAttNames,i); list temp = llParseString2List(attName,[],[fName]); if(llListFindList(temp,[fName]) != -1) { return TRUE; } } while(++i 0) { list words = llParseString2List(attName,[" "],[]); integer wLen = llGetListLength(words); integer iWord = 0; do { string word = llList2String(words,iWord); if(llListFindList(forbiddenWords,[word]) != -1) { return TRUE; } } while(++iWord < wLen); } vector size = llGetAgentSize(avi); if(size.z < sizeLimit && sizeLimit > 0) { return TRUE; } } while(++iAtt < attLen); //llOwnerSay("false"); return FALSE; } string who(key id) { return "secondlife:///app/agent/" + (string)id + "/inspect"; } //requests+stuff key creatorFileReq; integer creatorFileLine = 0; key attachmentFileReq; integer attachmentFileLine = 0; key wordFileReq; integer wordFileLine = 0; key creatorKeyReq; integer creatorNameIndex = 0; integer creatorNameLen; list creatorNonKeys = []; default { listen(integer channel, string name, key id, string txt) { if(llGetOwnerKey(id) == owner) { txt = llToLower(txt); if(txt == "on") { on = TRUE; llSetTimerEvent(scanInterval); llOwnerSay("Turning ON."); } else if(txt == "off") { on = FALSE; llSetTimerEvent(0); llOwnerSay("Turning OFF."); } } } state_entry() { owner = llGetOwner(); llListen(40,"",NULL_KEY,""); if(llGetInventoryType(forbiddenCreatorFile) == INVENTORY_NOTECARD) { creatorFileReq = llGetNotecardLine(forbiddenCreatorFile,creatorFileLine); } else { llOwnerSay("Notecard \""+forbiddenCreatorFile+"\" missing."); } if(llGetInventoryType(forbiddenAttachmentFile) == INVENTORY_NOTECARD) { attachmentFileReq = llGetNotecardLine(forbiddenAttachmentFile,attachmentFileLine); } else { llOwnerSay("Notecard \""+forbiddenAttachmentFile+"\" missing."); } if(llGetInventoryType(forbiddenWordFile) == INVENTORY_NOTECARD) { wordFileReq = llGetNotecardLine(forbiddenWordFile,wordFileLine); } else { llOwnerSay("Notecard \""+forbiddenWordFile+"\" missing."); } if(llGetInventoryType(sizeLimitFile) == INVENTORY_NOTECARD) { sizeLimitReq = llGetNotecardLine(sizeLimitFile,0); } else { llOwnerSay("Notecard \""+sizeLimitFile+"\" missing."); } } dataserver(key req,string data) { integer displayScanning = FALSE; if(req == creatorFileReq) { displayScanning = TRUE; if(data == EOF) { //stop, check amount of non-keys creatorNameLen = llGetListLength(creatorNonKeys); if(creatorNameLen > 0) { llOwnerSay("Verifying "+(string)creatorNameLen+" names of forbidden creators..."); } else { llOwnerSay("Forbidden creators parsed."); gotCreators = TRUE; amIready(); } return; } else if((key)data) { llOwnerSay("Verified "+who(data)); forbiddenCreators += [(key)data]; } else { creatorNonKeys += [data]; } creatorFileLine += 1; creatorFileReq = llGetNotecardLine(forbiddenCreatorFile,creatorFileLine); } else if(req == attachmentFileReq) { displayScanning = TRUE; if(data == EOF) { llOwnerSay("Forbidden attachment names parsed."); gotNames = TRUE; amIready(); return; } else { forbiddenAttNames += [llToLower(data)]; } attachmentFileLine += 1; attachmentFileReq = llGetNotecardLine(forbiddenAttachmentFile,attachmentFileLine); } else if(req == wordFileReq) { displayScanning = TRUE; if(data == EOF) { llOwnerSay("Forbidden words parsed."); gotWords = TRUE; amIready(); return; } else { forbiddenWords += [llToLower(data)]; } wordFileLine += 1; wordFileReq = llGetNotecardLine(forbiddenWordFile,wordFileLine); } else if(req == creatorKeyReq) { displayScanning = TRUE; if((key)data) { llOwnerSay("Verified "+who((key)data)); forbiddenCreators += [(key)data]; } creatorNameIndex += 1; if(creatorNameIndex < creatorNameLen) { } else { llOwnerSay("All creator names verified."); gotCreators = TRUE; amIready(); creatorNonKeys = []; } } else if(req == sizeLimitReq) { displayScanning = TRUE; sizeLimit = (float)data; if(sizeLimit <= 0) { sizeLimit = 0; llOwnerSay("Size scanninng disabled."); } else { llOwnerSay("Size scanning set to "+data+"."); } gotSizeLimit = TRUE; amIready(); } if(displayScanning ==TRUE && ready ==FALSE) { llSetText("...scanning...",,1); } } timer() { list ppl = llGetAgentList(scope,[]); integer len = llGetListLength(ppl); integer i = 0; vector pos = llGetPos(); do { key person = llList2Key(ppl,i); if(person) { if(scanPersonForBadStuff(person) == TRUE) { string parcelName = llList2String(llGetParcelDetails(pos,[PARCEL_DETAILS_NAME]),0); llInstantMessage(person, warning); if(method == "eject") { llEjectFromLand(person); llOwnerSay("Possible CHILD ejected from " + place); } else if(method == "tphome") { llTeleportAgentHome(person); llOwnerSay("Possible CHILD evicted from " + place); if (person == llDetectedKey(0)); list lName = llParseString2List(osKey2Name(person), [" "],[]); string FirstName = llList2String(lName,0); string LastName = llList2String(lName,1); osKickAvatar(FirstName,LastName,kickmes); } } } } while(++i < len); } touch_start(integer num) { key owner = llGetOwner(); if (llDetectedKey(0) != owner) return; if (owner); { if(on) { on = FALSE; llSetTimerEvent(0); llOwnerSay("Turning OFF."); llSetText("OFF",<1,0,0>,1); } else { on = TRUE; llSetTimerEvent(scanInterval); llOwnerSay("Turning ON."); llSetText("",<0,1,0>,1); } } } changed(integer change) { if(change & (CHANGED_INVENTORY | CHANGED_OWNER)) { llResetScript(); } } }