Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Discussion: Club Elite Protection Script

BigJohn Jade
Registered User
Join date: 5 Aug 2003
Posts: 93
06-14-2004 11:09
Do what you like to with this script make it better or whatever want to do with it.
CODE

// Club Elite Protection Script

// Keep this script free for all to use, do not sale it.

// This script is a Modify version of Darth Jones and Anaraxis Romulus PSPS Kicker script by BigJohn Jade

// This script was made so I could give my dacners and dj's boot power from club to kick ppl out that starts shit using owner of land llEjectFromLand and llUnSit commands to get them out of the club. It has a sensor range up to 80 meters away. Should also have a notecard called Help in whatever object the script may be in.

// Master Levels only Commands:
// ===================
// start protection - Must turn on script before it works.
// reset protection - Will reset script and clear everyone out of ban list and access list and turn script off.
// script status - Will show script info.
// aaccess username - Will give access to anyone in list to add to the ban list.
// raccess username - Will take away access from person in the list.
// accesslist - Will list everyone on access list.

// Dancers Levels commands:
// ===================
// Add username - Will add someone to ban list to kick out from club.
// remove username - Will delete from ban list from club.
// list - will list who all in ban list for club.
// ===================

integer LID;
list EliteBanList;
list Access_List;

// You can change sensor range here.
integer sensor_range = 80;

// how fast repeat for sensor is
float how_fast = 1.0;

// Name of help card when someone clicks on object they must have access to get the help card.
string note_name = "Help";

// Lets give someone we pick to have same master level access so they can add ppl and remove ppl. Note: Owener and who you pick to have master access must add there self to access list before working ban list.
key MasterLevelKey = "Ana Lily";

// Config all strings here to match whatever you need to.
string StateEntryText ="Club Elite Protection System: To activate Must have Master Level Access, say 'start protection'";

string DeleteFromAccessText=" from Club Elite Protection Access list";

string DeleteFromBanListText=" from Club Elite Ban list.";

string resetBanListText="Club Elite Protection Script System online!";

string EjectText1=" away from Club Elite Land!";

string EjectText2=" You have been boot from Club Elite Land!";

string TouchStartText=" Sorry you do not have Access to Club Elite Protection System";

string ScriptResetText="Resetting Club Elite Protection Script";

string AlreadyInAccessListText=" already in Club Elite Access list";

string AddToAccessListText=" to Club Elite Access list";

string AlreadyInBanListText=" already in Club Elite ban list";

string MemeberCantBeAddToBanList=" has Club Elite Access and can't be added to ban list";

string AddToBanListText= " to Club Elite ban list";

string NotFoundInAccessListText=" was not found in Club Elite Access list";

string WasNotFoundInBanListText=" was not found in Club Elite Ban list";

string PrintAccessListText="Club Elite Protection Access List:";

string PrintBanListText="Club Elite Ban List:";


GetScriptStatus()
{
llWhisper(0,"Script Free Memory " + (string)llGetFreeMemory());
llWhisper(0,"Script Name " + (string)llGetScriptName());
llWhisper(0,"Region Name " + (string)llGetRegionName());
llWhisper(0,"Region FPS " + (string)llGetRegionFPS());
}

string getParameter(list strings)
{
integer len = llGetListLength(strings);
integer i;
string ret;
string space= "";
for (i=1;i<len;i++)
{
ret += space + llList2String(strings,i);
space=" ";
}
return ret;
}

integer printAccessList()
{
integer i;
llWhisper(0,(string)PrintAccessListText);
for (i=0;i<llGetListLength(Access_List);i++)
{
llWhisper(0,llList2String(Access_List,i));
}
return 0;
}

integer printEliteBanList()
{
integer i;
llWhisper(0,(string)PrintBanListText);
for (i=0;i<llGetListLength(EliteBanList);i++)
{
llWhisper(0,llList2String(EliteBanList,i));
}
return 0;
}

integer DelFromAccessList(string name)
{
integer i;
for (i=0;i<llGetListLength(Access_List);i++)
{
string s = llList2String(Access_List,i);
if (s==name)
{
Access_List = llDeleteSubList(Access_List, i, i);
llWhisper(0,"Removed " + name + (string)DeleteFromAccessText);
}
}
return 0;
}

integer DelFromBanList(string name)
{
integer i;
for (i=0;i<llGetListLength(EliteBanList);i++)
{
string s = llList2String(EliteBanList,i);
if (s==name)
{
EliteBanList = llDeleteSubList(EliteBanList, i, i);
llWhisper(0,"Removed " + name + (string)DeleteFromBanListText);
}
}
return 0;
}

integer isEliteAccessUser(string name)
{
integer i;
for (i=0;i<llGetListLength(Access_List);i++)
{
string s = llList2String(Access_List,i);
if (s==name) return 1;
}
return 0;
}

integer isEliteBan(string name)
{
integer i;
for (i=0;i<llGetListLength(EliteBanList);i++)
{
string s = llList2String(EliteBanList,i);
if (s==name) return 1;
}
return 0;
}
SensorSetup()
{
llSensorRepeat("","" , AGENT, sensor_range, 2*PI, how_fast);
}

integer resetBanList()
{
string listen_name = llDetectedName(0);
llWhisper(0,(string)resetBanListText);
llSensorRemove();
SensorSetup();
llListenRemove(LID);
LID = llListen(0,"","","");
return 0;
}
default
{
state_entry()
{
SensorSetup();
llWhisper(0,(string)StateEntryText);
llListenRemove(LID);
LID = llListen(0,"","","");
}
sensor(integer total_number)
{
integer i;
for (i=0;i<total_number;i++)
{
key person = llDetectedKey(i);
string name = llDetectedName(i);
if (isEliteBan(name)>0)
{
llWhisper(0,"I Eject " + name + (string)EjectText1);
llUnSit(person);
llEjectFromLand(person);
llInstantMessage(person, name + (string)EjectText2);
}

}
}

touch_start(integer total_number)
{
integer i;
for (i=0;i<total_number;i++)
{
key person = llDetectedKey(i);
string name = llDetectedName(i);
if (isEliteAccessUser(name)>0)
{
llGiveInventory(person, note_name);
}
else llInstantMessage(person, name + (string)TouchStartText);

}
}
listen(integer channel, string name, key id, string message)
{
if (message == "script status" && (id == llGetOwner() || llKey2Name(id) == MasterLevelKey))
{
GetScriptStatus();
}

else if (message == "start protection" && (id == llGetOwner() || llKey2Name(id) == MasterLevelKey))
{
resetBanList();
return;
}
else if (message == "reset protection" && (id == llGetOwner() || llKey2Name(id) == MasterLevelKey))
{
llWhisper(0,ScriptResetText);
llResetScript();
}
list strings = llParseString2List(message,[" "],[]);
string command = llList2String(strings,0);
if (command=="accesslist" && (id == llGetOwner() || llKey2Name(id) == MasterLevelKey))
{
printAccessList();
}
else if(message=="list" && (isEliteAccessUser(name)>0))
{
printEliteBanList();
return;
}
string par = getParameter(strings);
if (par=="")
{
return;
}
else if (command=="aaccess" && (id == llGetOwner() || llKey2Name(id) == MasterLevelKey))
{
if (isEliteAccessUser(par)>0)
{
llWhisper(0,"Sorry " + par + (string)AlreadyInAccessListText);
return;
}
else Access_List = llListInsertList(Access_List,[par],llGetListLength(Access_List));
llWhisper(0,"Added " + par + (string)AddToAccessListText);
return;
}
else if(command=="add" && (isEliteAccessUser(name)>0))
{
if (isEliteBan(par)>0)
{
llWhisper(0,"Sorry " + par + (string)AlreadyInBanListText);
return;
}
if (isEliteAccessUser(par)>0)
{
llWhisper(0,"Sorry " + par + (string)MemeberCantBeAddToBanList);
return;
}
else EliteBanList = llListInsertList(EliteBanList,[par],llGetListLength(EliteBanList));
llWhisper(0,"Added " + par + (string)AddToBanListText);
return;
}
else if (command=="raccess" && (id == llGetOwner() || llKey2Name(id) == MasterLevelKey))
{
if (isEliteAccessUser(par)>0)
{
DelFromAccessList(par);
return;
}
else llWhisper(0,"Sorry " + par + (string)NotFoundInAccessListText);
}
else if(command=="remove" && (isEliteAccessUser(name)>0))
{
if (isEliteBan(par)>0)
{
DelFromBanList(par);
return;
}
else llWhisper(0,"Sorry " + par + (string)WasNotFoundInBanListText);
}
}
}

edit-just added the code mark-ups
Fargon Millhouse
Soul Wanderer
Join date: 26 May 2004
Posts: 8
Original Thread
06-22-2004 10:09
/15/b8/15487/1.html


Thank you BigJohn. Most useful!!
Navy Bean
Registered User
Join date: 29 May 2005
Posts: 13
Rented land
01-14-2006 15:20
So this would work with rented land if the landlord rezzed it and added the tennants to the access list, right? But does it have a one-time ejection option, or just a ban list?
Usagi Musashi
UM ™®
Join date: 24 Oct 2004
Posts: 6,083
01-16-2006 05:33
Can some one explain how to start this script?
Please:)
_____________________
Never Quote People that have no idea what they refering to..It give them a false feeling the need for attention...
Travis Lambert
White dog, red collar
Join date: 3 Jun 2004
Posts: 2,819
01-16-2006 09:27
A couple things:

-You can only use this script on land that you own, or land that your group owns
-I've only tested this script on non-group-owned land. YMMV on group land.
-This script uses open listens, and has other distasteful stuffs inside. Rewrite is strongly desireable
-Personally, I used this script as a foundation to create my own script more suited to my own needs. I suggest you do the same.


If you're set that far, the basic instructions are contained within the script itself:

// Master Levels only Commands:
// ===================
// start protection - Must turn on script before it works.
// reset protection - Will reset script and clear everyone out of ban list and access list and turn script off.
// script status - Will show script info.
// aaccess username - Will give access to anyone in list to add to the ban list.
// raccess username - Will take away access from person in the list.
// accesslist - Will list everyone on access list.

// Dancers Levels commands:
// ===================
// Add username - Will add someone to ban list to kick out from club.
// remove username - Will delete from ban list from club.
// list - will list who all in ban list for club.

It uses an open listener, so just type out the command you want to give in open chat.

So.... type:

aaccess Usagi Musashi (adds the person to the access list)
aaccess Navy Bean (adds the person to the access list)

start protection (turns the script on)

add Joe Griefer (adds Joe Griefer to the ban list)

remove Joe Griefer (So... Joe came back & apologized. Removing from ban list)

Note that everything is case sensitive - so if someone has a name like "gRiEfEr madness" - you have to spell it exactly as they did or it wont work.



Good luck, and hope this helps! :)
_____________________
------------------
The Shelter

The Shelter is a non-profit recreation center for new residents, and supporters of new residents. Our goal is to provide a positive & supportive social environment for those looking for one in our overwhelming world.
Usagi Musashi
UM ™®
Join date: 24 Oct 2004
Posts: 6,083
01-16-2006 17:46
Thank you Travis:)
I been reediting this script. and for some funky reason i can`t get it speak to me.
Thanks Again
Usagi
_____________________
Never Quote People that have no idea what they refering to..It give them a false feeling the need for attention...
Bosozoku Kato
insurrectionist midget
Join date: 16 Jun 2003
Posts: 452
01-16-2006 18:01
Why are string vars being typecast as strings? That's all I noticed, but I only spent approx. 3-5seconds looking at the script.
_____________________
float llGetAFreakingRealTimeStampSince00:00:00Jan11970();
Mantur Tokhes
Registered User
Join date: 16 Jan 2006
Posts: 16
01-16-2006 23:50
could you modify this script so that you buy tickets?

ie

enter disco - buy ticket for xxxL - check for item "ticket" - add to access list

????
Phoenix Psaltery
Ninja Wizard
Join date: 25 Feb 2005
Posts: 2,599
01-17-2006 10:01
You DO realize that this thread is a year and a half old?

::necroposters!!!::

:p

P2
_____________________
:cool:
Phoenix Psaltery
Ninja Wizard
Join date: 25 Feb 2005
Posts: 2,599
01-17-2006 10:04
From: Mantur Tokhes
could you modify this script so that you buy tickets?

ie

enter disco - buy ticket for xxxL - check for item "ticket" - add to access list

????


There is a contest starting soon, sponsored by the Foundation For Rich Content, for the scripting and design of a 'Box Office' that will do what it sounds like you are looking for. There is an article about it in the new Metaverse Messenger which should be out later today.

P2
_____________________
:cool:
Usagi Musashi
UM ™®
Join date: 24 Oct 2004
Posts: 6,083
01-18-2006 03:02
I can`t get this script running..........
I type to see the script bt it gives me nothing
_____________________
Never Quote People that have no idea what they refering to..It give them a false feeling the need for attention...
Genocide Nasu
Registered User
Join date: 27 Jun 2006
Posts: 5
06-28-2006 20:56
From: Usagi Musashi
I can`t get this script running..........
I type to see the script bt it gives me nothing


I can't even get it to save lol. What am i doing wrong and can i get some help with this script?
Usagi Musashi
UM ™®
Join date: 24 Oct 2004
Posts: 6,083
06-28-2006 20:59
From: Genocide Nasu
I can't even get it to save lol. What am i doing wrong and can i get some help with this script?


I never got it working myselve.....
Contact travis over at the shelter.
we will help you with it.......