24.04.2022, 12:46
(Dieser Beitrag wurde zuletzt bearbeitet: 24.04.2022, 12:54 von Manfred Aabye.)
Das ist ein Skript welches Leute nach Namen rauswirft.
Diese Namensliste wird in einer Notecard namens "bannedlist" Zeilenweise geschrieben.
Der/Die gelisteten Leute werden von der Region geworfen.
Der vorteil ist das nicht nach dem Ursprung also Grid geschaut wird sondern nur nach Namen.
bannedlist Beispiel:
Max Mustermann
John Doe
etc.
OSSL Secure Skript(kein php):
Diese Namensliste wird in einer Notecard namens "bannedlist" Zeilenweise geschrieben.
Der/Die gelisteten Leute werden von der Region geworfen.
Der vorteil ist das nicht nach dem Ursprung also Grid geschaut wird sondern nur nach Namen.
bannedlist Beispiel:
Max Mustermann
John Doe
etc.
OSSL Secure Skript(kein php):
PHP-Code:
// Secure Stick
//free to use, modify, copy or transfer
//Create a notecard with the name blacklist.
//Enter the unwanted people line by line.
//------------------------------------
key second = NULL_KEY; // fill in a second key if you want
string active = "active";
float range = 256.0; // Bereich, in dem wir nach Personen suchen, um zu überprüfen, ob sie auf der bannedlist stehen
float rate = 1.0; // Wie oft ein sensor-no_sensor in die Warteschlange gestellt wird.
key nrofnamesoncard; // Some variables used to collect all the data from the notecard
integer nrofnames;
list names;
list keynameoncard;
string nameoncard;
string storedname;
integer listener;
default // We use the default state to read the notecard.
{
state_entry()
{
llOwnerSay("Startup state reading bannedlist notecard");
nrofnamesoncard = llGetNumberOfNotecardLines("bannedlist"); // Triggers the notecard reading by getting the numer of lines in the notecard
}
on_rez (integer param)
{
llResetScript();
}
dataserver (key queryid, string data){
if (queryid == nrofnamesoncard)
{
// When we receive the number of lines in the notecard we do llGetNotecardLine for each line to get the contents
nrofnames = (integer) data;
llOwnerSay("Found "+(string)nrofnames+ " names in bannedlist.");
integer i;
for (i=0;i < nrofnames;i++){
keynameoncard += llGetNotecardLine("bannedlist", i);
}
} else
{
integer listlength;
listlength = llGetListLength(keynameoncard);
integer j;
for(j=0;j<listlength;j++) {
if (queryid == (key) llList2String(keynameoncard,j))
{ // after checking if this really was an answer to one of our llGetNotecardLines calls (checking the keys we stored earlier)
// We add the name to our names list. Which we will use in a later state.
llOwnerSay("Name added to bannedlist: "+data);
names += data;
}
}
}
if (llGetListLength(names) == nrofnames)
{
// If we have read all the names (just as many names as there where notecard lines). We switch to our next state "start"
// This state will do the actual work
llOwnerSay ("Done with reading notecard. Starting script now");
state start;
}
}
}
state start
{
state_entry ()
{
// This is where we enter our state. We start 2 listeneres. One for our owner and one for our second owner..
llListen(9, "", llGetOwner(), "");
llListen(9, "", second, "");
llSensorRepeat("", NULL_KEY, AGENT, range, PI, rate); // We also start scanning for people in it's vincinity. This scan scans for AGENS (avatars), in a range we determinded above (first few lines). And PI means a full circle around us. In theory you could just scan parts of it.
}
on_rez(integer param)
{
llResetScript();
}
listen(integer channel, string name, key id, string message)
{ // This is our listen event. Here we receive all commands to control the orbs behaviour.
if (message == "activate") // Starts the orb
{
active = "active";
llOwnerSay("Activated");
}
if (message == "deactivate") // Stops the orb
{
active = "deactive";
llOwnerSay("Deactivated");
}
if (message == "reset") // Resets the script
{
llResetScript();
}
if (llGetSubString(message,0,4) == "range"){ // If the command was range. We extract the new range from the command. Stop the sensor and start it again with the new range.
range = (float) llGetSubString(message,6,-1);
llSensorRemove();
llSensorRepeat("", NULL_KEY, AGENT, range, PI, rate);
llOwnerSay("Changed range to: "+(string) range);
}
}
sensor(integer nr)
{
// Here is where all people found in its vincinity are returned.
if (active == "active") // first we make sure the orb is active before we continue
{
integer i;
for (i = 0; i < nr; i++) //Here we start to loop throug all persons we found. We do this one by one.
{
string found = "yes";
string nametotest = llDetectedName(i);
integer j;
for (j = 0; j < llGetListLength(names); j++) // We scan through the list of names to see if this person is whitelisted
{
if (llList2String(names, j) == nametotest){
found = "no"; // When found we set found to true.
}
}
if (found == "no" && llOverMyLand(llDetectedKey(i)) && (llDetectedKey(i) != llGetOwner())) // ifperson has not been found, check if this person is on our land. we will never kick the owner ;)
{
if (llOverMyLand(llDetectedKey(i))) // Ok let's see if he has left.
{
// kicked off the land
llTeleportAgentHome(llDetectedKey(i));
}
if (llOverMyLand(llDetectedKey(i))) // Is it still there?
{
// kicked off the land
llEjectFromLand(llDetectedKey(i));
}
}
}
}
}
}