Themabewertung:
  • 0 Bewertung(en) - 0 im Durchschnitt
  • 1
  • 2
  • 3
  • 4
  • 5
Secure Skript
#1
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):
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 queryidstring 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;nrofnames;i++){
               
keynameoncard += llGetNotecardLine("bannedlist"i);
            }
        } else
        {
            
integer listlength;
            
listlength llGetListLength(keynameoncard);
            
integer j;
            for(
j=0;j<listlength;j++) {
                if (
queryid == (keyllList2String(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_KEYAGENTrangePIrate); // 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 channelstring namekey idstring 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_KEYAGENTrangePIrate);
            
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 (
0nri++) //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 (
0llGetListLength(names); j++) // We scan through the list of names to see if this person is whitelisted
                
{
                    if (
llList2String(namesj) == 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));
                    }
                }
            }
        }
    }


Ein Metaversum sind viele kleine Räume, die nahtlos aneinander passen,
sowie direkt sichtbar und begehbar sind, als wäre es aus einem Guss.



[-] The following 3 users say Thank You to Manfred Aabye for this post:
  • , Anachron, Dorena Verne
Zitieren


Nachrichten in diesem Thema
Secure Skript - von Manfred Aabye - 24.04.2022, 12:46
RE: Secure Skript - von Gubbly - 24.04.2022, 14:19
RE: Secure Skript - von Manfred Aabye - 25.04.2022, 09:41
RE: Secure Skript - von Anachron - 25.04.2022, 09:53
RE: Secure Skript - von Gubbly - 25.04.2022, 11:51
RE: Secure Skript - von Manfred Aabye - 25.04.2022, 10:13
RE: Secure Skript - von Manfred Aabye - 26.04.2022, 18:51

Möglicherweise verwandte Themen…
Thema Verfasser Antworten Ansichten Letzter Beitrag
  YEngine Skript Restart Manfred Aabye 6 2.134 15.03.2022, 12:43
Letzter Beitrag: Manfred Aabye

Gehe zu:


Benutzer, die gerade dieses Thema anschauen: 1 Gast/Gäste