Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
script that loops llTeleportAgentHome on targeted Agent
#1
Looking for a script usable on my full sim that i can attach and pick an Agent, either by a set uuid in the script/description/or from a dialog menu, and have it continuously eject them and send them home in a constant loop. basically never giving them a chance to sit down or do anything. I have one that works as a button and ejects everyone, but its no mod. if this could have a choice to eject all or just a single individual, but leave the owner of the object alone, that would be cool, but I'm fine with the bare minimal, i don't mind adding uuids manually or whatever.

I know i Could just ban them, but i wanna make a point.

I also could do it on my own but I'm not sure oh how to go about laying out the script it deals with scripting i have not really messed with before. so any advice would be great as well.

Thanx in Advanced.

<3
Reply
#2
Here you go <3 Hope this is what you're looking for. It's not gonna be -fast- however since llTeleportAgentHome() sleeps the script for 5 seconds per call. So it will be 5 seconds between each avatar being sent home. You could theoretically break your avatar list up into several (unlinked) prims, throw the script in to each one, and utilize smaller lists of avatars however to sort of get around it.

PHP Code:
list ejectAvs =
[
    
//Put your list of avatar UUIDs here to eject
    //The below are not real UUIDs. They are just here for example.
    
    
"c2a14142-2fd5-49d7-bb09-9c7eba4eeb35",
    
"7a8a25a6-3870-44d3-8f96-efd74fa80fda",
    
"fee85bc5-5a5e-42c3-b2bd-fe93d4a6d396",
    
"554f8203-3752-4965-9f29-f75713026710"
];

float refreshTime 1.0//How fast the timer fires

default
{
    
state_entry()
    {
        
llSetTimerEvent(refreshTime);
    }
    
    
touch_start(integer x)
    {
        
llResetScript();
    }
    
    
on_rez(integer params)
    {
        
llResetScript();
    }
    
    
timer()
    {
        
llSetTimerEvent(0);
        
        
integer numAvs llGetListLength(ejectAvs);
        
integer i 0;
        
        for(
inumAvsi++)
        {
            
key av = (key)llList2String(ejectAvsi);
            
//llOwnerSay("Sending " + llGetUsername(av) + " home");
            
llTeleportAgentHome(av);
        }   
        
        
llSetTimerEvent(refreshTime);
    }

Reply
#3
Omg thanx Big Grin <3 hehe
Reply
#4
No problem Big Grin Big Grin
Reply
#5
Quote:list agentlist;
list triggers = ["uuid"];

default
{
state_entry()
{
llSetTimerEvent(1);
}
timer()
{
integer isFound = -1;
agentlist = llGetAgentList (AGENT_LIST_REGION,[]);
isFound = llListFindList(agentlist,triggers);

if(isFound != -1){
llSetAlpha(0,ALL_SIDES);
llSay(0, "is found");
}
else{
llSay(0, "not found");
llSetAlpha(1,ALL_SIDES);
}
}}

how about to hide a prim when it detects an avi in the region? am i doing this right??
Reply
#6
Hmm... Not quite, while it will work if you only have one UUID in your triggers list; it will quit working if you add more. This is because lists are comprised of multiple elements; which means you would need to iterate through the list and check each UUID in your triggers list against what is currently contained in agentlist.

I have also added some additional checks to it to test if the prim is currently hiding or not. This is to prevent the script from spamming calls to llSetAlpha() and possibly slowing itself down.

Please enclose your code in "["CODE"]" (code here) "["/CODE"]" or "["PHP"]" (code here) "["/PHP"]" (without the " marks) tags when posting so that it will maintain formatting. It makes it easier to read and debug Big Grin

Code:
list agentlist;

list triggers =
[
    "UUID1",
    "UUID2",
    "etc"
];

integer isHidden = FALSE;

default
{
    state_entry()
    {
        llSetTimerEvent(1.0);
        llSetAlpha(1.0, ALL_SIDES);
    }
    
    timer()
    {
        integer isFound = FALSE;
        
        agentlist = llGetAgentList(AGENT_LIST_REGION, []);
        
        integer i = 0;
        integer numAgents = llGetListLength(agentlist);
        
        for(i; i < numAgents; i++)
        {
            string curAgent = llList2String(agentlist, i);
            
            if(llListFindList(triggers, [curAgent]) != -1)
                isFound = TRUE;
        }

        if(isFound && !isHidden)
        {
            llSetAlpha(0.0, ALL_SIDES);
            llSay(0, "is found");
            isHidden = TRUE;
        }
        
        else if(!isFound && isHidden)
        {
            llSay(0, "not found");
            llSetAlpha(1.0, ALL_SIDES);
            isHidden = FALSE;
        }
    }
}
Reply
#7
Code:
key TARGET = "00000000-0000-0000-0000-000000000000"; // Set the key of the agent to detect.
float TIME = 1; // Interval to run task. in seconds. can use a float value, EX: "0.01";
float RANGE = 10; // Range in meters, 96 is max.

default
{
    state_entry()
    {
    llSensorRepeat("",TARGET,AGENT,RANGE,PI,TIME);
}
    sensor(integer DETECTED)
    {
        while(DETECTED--)
        {
            if(llDetectedKey(0) == TARGET)
            llInstantMessage(llGetOwner(),"Target " +llDetectedName(DETECTED)+ ", was detected, removing target!");
            //llUnSit(TARGET);
            //llEjectFromLand(TARGET);
            llTeleportAgentHome(TARGET);
        }
    }
}
This should do what you want. uses a sensor, if it detects the set target it sends them home, pretty simple. or you can eject them from the land if their home is set to the sim their in, but being both EjectFromLand and TeleporAgentHome are only commands you can use if you own the parcel/sim, it's limited to that. You can also use unsit too, if you need. Yeah I see a few already posted some of these, but I was bored and wanted to see if i could make my own.
Reply
#8
(01-31-2014, 11:57 PM)Nakora Wrote: Guests cannot see links in the messages. Please register to forum by clicking here to see links.Looking for a script usable on my full sim that i can attach and pick an Agent, either by a set uuid in the script/description/or from a dialog menu, and [....]

<3

(10-07-2016, 09:49 PM)Nakora Wrote: Guests cannot see links in the messages. Please register to forum by clicking here to see links.
Code:
key TARGET = "00000000-0000-0000-0000-000000000000"; // Set the key of the agent to detect.
float [ ..]

This should do what you want. uses a sensor, if it detects the set target it sends them home, pretty simple. or you can eject them from the land if their home is set to the sim their in, but being both EjectFromLand and TeleporAgentHome are only commands you can use if you own the parcel/sim, it's limited to that. You can also use unsit too, if you need. Yeah I see a few already posted some of these, but I was bored and wanted to see if i could make my own.


ehhh, did you just solve your own issue, two years later?

I will move the thread to 'solved'
Guests cannot see links in the messages. Please register to forum by clicking here to see links. | Guests cannot see links in the messages. Please register to forum by clicking here to see links.| Guests cannot see links in the messages. Please register to forum by clicking here to see links. | Guests cannot see links in the messages. Please register to forum by clicking here to see links.
Reply
#9
(02-12-2014, 08:02 AM)mew380 Wrote: Guests cannot see links in the messages. Please register to forum by clicking here to see links.Hmm... Not quite, while it will work if you only have one UUID in your triggers list; it will quit working if you add more. This is because lists are comprised of multiple elements; which means you would need to iterate through the list and check each UUID in your triggers list against what is currently contained in agentlist.

I have also added some additional checks to it to test if the prim is currently hiding or not. This is to prevent the script from spamming calls to llSetAlpha() and possibly slowing itself down.

Please enclose your code in "["CODE"]" (code here) "["/CODE"]"  or "["PHP"]" (code here) "["/PHP"]" (without the " marks) tags when posting so that it will maintain formatting. It makes it easier to read and debug Big Grin

Code:
list agentlist;

list triggers =
[
   "UUID1",
   "UUID2",
   "etc"
];

integer isHidden = FALSE;

default
{
   state_entry()
   {
       llSetTimerEvent(1.0);
       llSetAlpha(1.0, ALL_SIDES);
   }
   
   timer()
   {
       integer isFound = FALSE;
       
       agentlist = llGetAgentList(AGENT_LIST_REGION, []);
       
       integer i = 0;
       integer numAgents = llGetListLength(agentlist);
       
       for(i; i < numAgents; i++)
       {
           string curAgent = llList2String(agentlist, i);
           
           if(llListFindList(triggers, [curAgent]) != -1)
               isFound = TRUE;
       }

       if(isFound && !isHidden)
       {
           llSetAlpha(0.0, ALL_SIDES);
           llSay(0, "is found");
           isHidden = TRUE;
       }
       
       else if(!isFound && isHidden)
       {
           llSay(0, "not found");
           llSetAlpha(1.0, ALL_SIDES);
           isHidden = FALSE;
       }
   }
}

(10-08-2016, 12:26 AM)C.Nails Wrote: Guests cannot see links in the messages. Please register to forum by clicking here to see links.
(01-31-2014, 11:57 PM)Nakora Wrote: Guests cannot see links in the messages. Please register to forum by clicking here to see links.Looking for a script usable on my full sim that i can attach and pick an Agent, either by a set uuid in the script/description/or from a dialog menu, and [....]

<3

(10-07-2016, 09:49 PM)Nakora Wrote: Guests cannot see links in the messages. Please register to forum by clicking here to see links.
Code:
key TARGET = "00000000-0000-0000-0000-000000000000"; // Set the key of the agent to detect.
float [ ..]

This should do what you want. uses a sensor, if it detects the set target it sends them home, pretty simple. or you can eject them from the land if their home is set to the sim their in, but being both EjectFromLand and TeleporAgentHome are only commands you can use if you own the parcel/sim, it's limited to that. You can also use unsit too, if you need. Yeah I see a few already posted some of these, but I was bored and wanted to see if i could make my own.


ehhh, did you just solve your own issue, two years later?

I will move the thread to 'solved'
You know what's funny .... I didn't even notice that it was a question I asked, I totally forgot! Omg wtf XD, looks like I did indeed ask it back when I could not script, and two years later... I learned how to script. :>
Reply
#10
wow thanx, this was exactly what i was looking for!
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Script nanie vantelli 2 1,280 04-26-2017, 03:38 PM
Last Post: MBallerBrim
  automatic sliding door script ᴇNɢLɪDᴜTᴄH 1 1,267 03-27-2017, 05:10 PM
Last Post: C.Nails
  exploding shard script ᴇNɢLɪDᴜTᴄH 2 1,455 07-29-2016, 11:10 AM
Last Post: ᴇNɢLɪDᴜTᴄH
  looking for RLV grabber / forcer script KingGoon 35 24,813 05-30-2016, 11:39 AM
Last Post: larsowl
  Search, SlideShow script with effects! Transporter 2 1,295 03-01-2016, 01:06 AM
Last Post: Transporter



Users browsing this thread: 1 Guest(s)