Join us in Outworldz at www.outworldz.com:9000 or follow us:

Search dozens of selected web sites for OpenSim and LSL script

New! Script Meta-Search will search thousands of scripts here and at other sites for LSL or Opensim scripts.
Loading

Want to add a script or a project? Upload it and a half million people will see it and your name here this year.

Home   Show All
Category: Contributor: Creator
Security Remove_Imposters_Revisted  

Remove_Imposters_Revisted

Remove_Imposters_Revisted

Category: Security
By : mangowylder
Created: 2011-04-25 Edited: 2011-04-25
Worlds: Second Life

the Zip file

Download all files for Remove_Imposters_Revisted
Contents are in zip format, with .LSL (text) source code and LSLEdit (text + Solution) formats.
Get file # 1. Remove_Imposters_Revisted_1.lsl
1 // Inspired by Zena Juran's Remove Imposters script
2 // Which can be found here
3 // http://www.free-lsl-scripts.com//freescripts.plx?ID=1535
4 // Ok first things first:)
5 // Don't bug me about using llDialog for turning it on and off
6 // This is just a small snippet of the script I wrote to illustrate
7 // a point about llOverMyLand
8 // llOverMyLand is buggy and should always be used with some cross checking
9 // with llGetParcelDetails or some other method of your choosing.
10 // This script is designed to work on a parcel and uses llGetParcelDetails
11 // to get the key of the parcel the object is on and compare it to key of the
12 // parcel the detected avatar is on before it takes any action.
13
14 //Mango Wylder
15
16 list gLstParcelDetails;
17 list gLstChoices = ["Turn On", "Turn Off"];
18 key gKeyOwner;
19 key gKeyParcel;
20 integer gIntChannel_Dialog;
21 integer gIntListen_Id;
22 integer gIntActive;
23 string gStrOwnerName;
24 float gFltRange = 96;
25 float gFltScanRate = 5;
26
27
28 default{
29 state_entry (){
30 gIntChannel_Dialog = ( -1 * (integer)("0x"+llGetSubString((string)llGetKey(),-5,-1)) ); // set a negative integer chat channel for the dialog box
31 gLstParcelDetails = (llGetParcelDetails(llGetPos(), [PARCEL_DETAILS_ID]));
32 gKeyOwner = llGetOwner();
33 gKeyParcel = llList2Key(gLstParcelDetails,0);
34 gStrOwnerName = llToLower(llKey2Name(llGetOwner()));
35 }
36
37 on_rez(integer param){
39 }
40
41 touch_start(integer total_number){
43 llDialog(gKeyOwner, "Please make a choice.", gLstChoices, gIntChannel_Dialog);
44 gIntListen_Id = llListen(gIntChannel_Dialog, "", gKeyOwner, "");
45 llSetTimerEvent(20); //set a time limit to llListen
46 }
47 else{
48 llSay(0, "You are not authorized");
49 }
50 }
51 listen(integer channel, string name, key id, string choice){
52 if(channel == gIntChannel_Dialog){
53 if(~llListFindList(gLstChoices, [choice])) { // verify dialog choice
54 if(choice == "Turn On"){
55 if(gIntActive == 1){
56 llOwnerSay("Imposter Scanner is already armed and scanning" );
57 }
58 else{
59 gIntActive = 1;
60 llOwnerSay("Imposter Scanner is on and scanning");
61 llSensorRepeat( "", "", AGENT, gFltRange, PI, gFltScanRate );
62 }
63 llListenRemove(gIntListen_Id); //remove the listen on channel_dialog
64 }
65 if(choice == "Turn Off"){
67 gIntActive = 0;
68 llOwnerSay("Imposter Scanner is turned off");
69 llListenRemove(gIntListen_Id); //remove the listen on channel_dialog
70
71 }
72 }
73 }
74 }
75
76 timer()
77 { //TIME’S UP!
78 llListenRemove(gIntListen_Id);
79 llSetTimerEvent(0); //Stop the timer from being called repeatedly
80 }
81
82 sensor(integer nr){
83 if(gIntActive == 1) {
84 integer i;
85 do{
86 list vLstParcelDetailsI = (llGetParcelDetails(llDetectedPos(i), [PARCEL_DETAILS_ID]));
87 key vKeyParcelI = llList2Key(vLstParcelDetailsI,0);
88 key vKeyAvatar = llDetectedKey(i);
89 string vStrAvatarName = llToLower(llGetDisplayName(vKeyAvatar));
90 if((vStrAvatarName == gStrOwnerName) && (vKeyAvatar != gKeyOwner) && (gKeyParcel == vKeyParcelI)){
92 }
93 }while((++i) < nr);
94 }
95 }
96 }

Back to the Best Free Tools in Second Life and OpenSim.