Jump to content

Initiating Scripts & Reading Group Profile Members - Advice?


JaslynMaia
 Share

You are about to reply to a thread that has been inactive for 1953 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Okay so, like everyone else, I've had a fair share of griefers; as did my friend, who recently had to deal with one today, hence prompting me to ask this question.

Question one! 

I'd personally consider the worst form of home griefing to be refusing to go and acting like they own the place. Although methods like security ejecting and banning is possible, I'd like to simply prevent them from even being able to access furniture menus for sits. So here's my question, is there anyway I can connect scripts, like tell the object to run through script A ( the script that I've written, and dropped into the item's inventory) first before running Script B (the no-mod script somebody else wrote and included with the object that I've purchased). If Script A was false, then do nothing or send a message telling them that no access is allowed. If Script A was true, continue on to Script B. I understand that there is a way to do this within a single script, but as certain scripts are no mod, and almost all no whitelist, I'm hoping there's a way for me to drop a script into an object to make it so?

Question two! 

Okay, so question two! Is there anyway to write a script that reads a group profile's members list? For example, if JaslynMaia Resident is on the Group A's members list, then proceed without needing the group tag to be active? I've been to a place or two (I can't remember what its called at the moment) where you can access everything if you're part of the group without having the group tag active. You'd still receive the benefits of the group if you're in it without the tag being active, but if you're not part of the group, you simply do not have access or receive benefits. Is there any way to achieve that result? 

Edited by JaslynMaia
Link to comment
Share on other sites

Certainly, that would be an easy enough script, here's a starting point (not tested)

list whitelist = ["name 1"];//add the names of the people you want to allow, case sensitive
default
{
    changed(integer change)
    {
        if(change & CHANGED_LINK)
        {
            key id = llAvatarOnSitTarget();
            if(id)
            {
                name = llKey2Name(id);
                integer index = llListFindList(whitelist,[name]);
                if(index == -1 && id != llGetOwner())
                {
                    llUnSit(id);
                }
            }
        }
    }
}

 

  • Thanks 1
Link to comment
Share on other sites

7 minutes ago, Ruthven Willenov said:

Certainly, that would be an easy enough script, here's a starting point (not tested)


list whitelist = ["name 1"];//add the names of the people you want to allow, case sensitive
default
{
    changed(integer change)
    {
        if(change & CHANGED_LINK)
        {
            key id = llAvatarOnSitTarget();
            if(id)
            {
                name = llKey2Name(id);
                integer index = llListFindList(whitelist,[name]);
                if(index == -1 && id != llGetOwner())
                {
                    llUnSit(id);
                }
            }
        }
    }
}

 

Ahh yes, I understand how to whitelist, but I simply don't understand how to get my script to initiate another script that someone else wrote? Or would simply dropping a whitelist script into the object, enable the object to block the person from accessing Script B unless authorized? 

  • Like 1
Link to comment
Share on other sites

That's certainly one way to get the result you want.  There's another completely different way.  Take a look at the LSL function llSetScriptState, which can be used to set another script in the same prim to not running or running.  It's a tool for letting you use one script as an on/off switch for another one. so

if ( llDetectedKey(0) == llGetOwner() )
{
    llSetScriptState( my_other_script, TRUE );
}
else
{
    llSetScriptState( my_other_script, FALSE );
}

The only thing you'll have to keep in mind is the triggering event.  If my_other_script is activated by a touch_start event, don't put this little bit of code in a touch_start event in your new controlling script, because a touch will try to affect both scripts at once.  Use a listen event of do some other magic to avoid a conflict.  If your object is a piece of furniture with something like AvSitter controlling animations, then it's probably triggered by sitting -- with a changed event. If that's the case, then a touch_start event in your new script will probably be OK.

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

9 hours ago, Ruthven Willenov said:

Certainly, that would be an easy enough script, here's a starting point (not tested)


list whitelist = ["name 1"];//add the names of the people you want to allow, case sensitive
default
{
    changed(integer change)
    {
        if(change & CHANGED_LINK)
        {
            key id = llAvatarOnSitTarget();
            if(id)
            {
                name = llKey2Name(id);
                integer index = llListFindList(whitelist,[name]);
                if(index == -1 && id != llGetOwner())
                {
                    llUnSit(id);
                }
            }
        }
    }
}

 

nice one! :)

  • Like 1
Link to comment
Share on other sites

8 hours ago, Rolig Loon said:

That's certainly one way to get the result you want.  There's another completely different way.  Take a look at the LSL function llSetScriptState, which can be used to set another script in the same prim to not running or running.  It's a tool for letting you use one script as an on/off switch for another one. so


if ( llDetectedKey(0) == llGetOwner() )
{
    llSetScriptState( my_other_script, TRUE );
}
else
{
    llSetScriptState( my_other_script, FALSE );
}

The only thing you'll have to keep in mind is the triggering event.  If my_other_script is activated by a touch_start event, don't put this little bit of code in a touch_start event in your new controlling script, because a touch will try to affect both scripts at once.  Use a listen event of do some other magic to avoid a conflict.  If your object is a piece of furniture with something like AvSitter controlling animations, then it's probably triggered by sitting -- with a changed event. If that's the case, then a touch_start event in your new script will probably be OK.

This cool too.  I not realized no-mod scripts could be started and stopped. :)

Link to comment
Share on other sites

12 hours ago, JaslynMaia said:

Okay, so question two! Is there anyway to write a script that reads a group profile's members list? For example, if JaslynMaia Resident is on the Group A's members list, then proceed without needing the group tag to be active? I've been to a place or two (I can't remember what its called at the moment) where you can access everything if you're part of the group without having the group tag active.

There's no way to do that, at least not one of which I'm aware, that wouldn't involve either manually copying the group membership list to a whitelist or perhaps using a bot (I don't know much about bots, which is the only reason I speculate that it might be possible).

If I were asked to design something on the lines of the items you describe that you say you've seen, I think I'd do it by using a group inviter that either opens up the Group > Info page so you can join the group from that, or sends a message to a bot that invites you, and have the inviter add you to a whitelist at the same time.    Or have a scanner in the club that checks on people's active group membership  and  constructs a whitelist from  that.   There are several ways to do it, now I come to think of it.

Could that be what you've seen?   It would need  manual maintenance to remove from the access list people who subsequently left the group but, in practice, I doubt anyone would bother with that unless the group member had actually been removed from the group for some misbehaviour or other.    

But it wouldn't work for banning members of groups unconnected with you, of course.

I once went into this quite deeply on behalf of some entertainment regions who were having problems with one particular clan of Spampires, whose members persisted in sending out unwanted bite requests to everyone they saw.      Our eventual solution, which worked, I'm glad to say, was to provide the Vampire-in-Chief of that particular clan with a list of the names of all his clan members (taken from the Bloodlines website) and tell him that if  things didn't improve we were going to put all of them on the ban list, and when they found themselves teleported home, they'd receive an explanation that this had unfortunately been necessary because their vampire king couldn't keep some of his minions under control.     Confronted with that ultimatum, he did make his over-enthusiastic underlings behave, so fortunately we didn't have to go through with it.

But to do that, you do need access to the group's membership list, which can't be read directly by script.

 

Edited by Innula Zenovka
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1953 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...