Difference between revisions of "User:Daemonika Nightfire/Scripts/Bot Ejecter"

From Second Life Wiki
Jump to navigation Jump to search
(Created page with "== *DS* Bot Ejecter v1.0.00 == This little script sends every agent with the scritped agent status (usually called bot) home within a second without warning. <source lang="ls...")
 
m
Line 1: Line 1:
== *DS* Bot Ejecter v1.0.00 ==
== *DS* Bot Ejecter v1.0.01 ==
This little script sends every agent with the scritped agent status (usually called bot) home within a second without warning.
This little script sends every agent with the scritped agent status (usually called bot) home within a second without warning.


Line 15: Line 15:
     Please see https://wiki.secondlife.com/wiki/LlTeleportAgentHome#Ownership_Limitations for details.
     Please see https://wiki.secondlife.com/wiki/LlTeleportAgentHome#Ownership_Limitations for details.
*/
*/
integer counter = 0;
Refresh()
{
    string msg = "Ejected Bots: " + (string)counter;
    llSetText(msg, <1,1,1>, 1.0);
    llSetObjectDesc(msg);
}


default
default
Line 20: Line 28:
     state_entry()
     state_entry()
     {
     {
        counter = (integer)llLinksetDataRead("ejects");
        Refresh();
       
         llSetTimerEvent(1.0); // don't set faster than once per second
         llSetTimerEvent(1.0); // don't set faster than once per second
     }
     }
Line 37: Line 48:
                 {
                 {
                     llTeleportAgentHome(agent);
                     llTeleportAgentHome(agent);
                   
                    counter++;
                    llLinksetDataWrite("ejects", (string)counter);
                    Refresh();
                 }
                 }
             }
             }
Line 45: Line 60:
     on_rez(integer Dae)
     on_rez(integer Dae)
     {
     {
        llLinksetDataDelete("ejects");
         llResetScript();
         llResetScript();
     }
     }
}
}
</source>
</source>

Revision as of 08:35, 12 August 2024

*DS* Bot Ejecter v1.0.01

This little script sends every agent with the scritped agent status (usually called bot) home within a second without warning.

/*
    *DS* Bot Ejecter v1.0.00 by Daemonika nightfire
    
    The motivation behind this script is to make it as difficult as possible for data collectors to use bots.
    Bots are teleported home by this script within a second without warning.
    The height at which a bot is located is irrelevant.
    The bot is also ejected at the highest point at 2147483647 metres.
    
    It is expressly permitted and even desired to pass on this script free & fullperm.
    
    Please see https://wiki.secondlife.com/wiki/LlTeleportAgentHome#Ownership_Limitations for details.
*/

integer counter = 0;
Refresh()
{
    string msg = "Ejected Bots: " + (string)counter;
    llSetText(msg, <1,1,1>, 1.0);
    llSetObjectDesc(msg);
}

default
{
    state_entry()
    {
        counter = (integer)llLinksetDataRead("ejects");
        Refresh();
        
        llSetTimerEvent(1.0); // don't set faster than once per second
    }

    timer()
    {
        list agents = llGetAgentList(AGENT_LIST_PARCEL, []); // use AGENT_LIST_REGION if you own the whole region
        integer length = llGetListLength(agents);
        integer i = 0;
        do
        {
            key agent = llList2Key(agents, i);
            integer info = llGetAgentInfo(agent);
            if(info & AGENT_AUTOMATED)
            {
                if(!llSameGroup(agent)) // your own bots are save with the same group
                {
                    llTeleportAgentHome(agent);
                    
                    counter++;
                    llLinksetDataWrite("ejects", (string)counter);
                    Refresh();
                }
            }
        }
        while(++i < length);
    }
    
    on_rez(integer Dae)
    {
        llLinksetDataDelete("ejects");
        llResetScript();
    }
}