Security System

Post requests for goods or services
User avatar
Veritas McMaster
Posts: 50
Joined: Wed Feb 23, 2022 12:37 pm
Has thanked: 147 times
Been thanked: 67 times
Contact:

Security System

Post by Veritas McMaster »

Can anyone direct me to a good security system (to eject unwanted visitors)? I thought I saw some on Marketplace but cannot find any. Thanks
These users thanked the author Veritas McMaster for the post:
Ilan Tochner
Graham Mills
Posts: 1314
Joined: Sun Dec 23, 2012 2:26 pm
Has thanked: 1134 times
Been thanked: 1141 times

Re: Security System

Post by Graham Mills »

I couldn't see anything on the Market either.

There are three here: https://www.outworldz.com/cgi/freescrip ... y=Security

All I can say is that the one by Anonymous compiles and runs if you include a whitelist on a notecard but I haven't tested it under OpenSim.

If you can make your requirements a little more specific it shouldn't be hard to script a simple security orb. I'm not saying it would be perfect but it might be a start.
These users thanked the author Graham Mills for the post (total 2):
Veritas McMasterIlan Tochner
User avatar
Veritas McMaster
Posts: 50
Joined: Wed Feb 23, 2022 12:37 pm
Has thanked: 147 times
Been thanked: 67 times
Contact:

Re: Security System

Post by Veritas McMaster »

Oh Graham, thank you. In SL I had a great one by Creator I think is out of business. All I really need is a way to stop anyone coming in who is not invited and a way to eject, white list and black list. I don't like using ban lines. Having a menu would be great.

I downloaded them but do not know what to do with them. I am not the only one who will want one. What about making one and putting it on Kitely Market? Pleassseeeeeeeeeeee.... and for KC, not just $$.
Graham Mills
Posts: 1314
Joined: Sun Dec 23, 2012 2:26 pm
Has thanked: 1134 times
Been thanked: 1141 times

Re: Security System

Post by Graham Mills »

I don't have much experience with security devices but here's my first attempt.

It's limited to Owners/Estate Managers as it uses restricted OSSL functions. It operates at the parcel level. Simply add the script to a new prim located on the parcel. At present there is just a whitelist option, otherwise if not on the list everyone except the owner of the prim is expelled from the parcel if the device is on (coloured green). It scans every 20 sec and gives intruders 20 sec grace before teleporting them to the Kitely Welcome Centre. At present it communicates with visitors by IM which isn't necessarily optimal as it defaults to brown on black text in my Firestorm.

Touch the prim to get the main menu which allows you to switch the orb on (green) or off (red) and to add avatars to the whitelist. The latter pops up a textbox (in Firestorm at least) into which you type the avatar name (two words, case insensitive). If it is recognised in the Kitely database the name and avatar key are added to an automagically generated notecard called whitelist, one avatar per line. At present there is no way to add hypergrid visitors though you could in principle add them manually, name and key with comma delimiters, to the notecard which is editable.

It probably needs a fair bit of refining but I'm curious as to whether it meets a need. Use at your own peril of course. I would suggest experimenting on a small parcel created for the purpose.

[CODE REMOVED. SEE UPDATED VERSION IN LATER POST]
Last edited by Graham Mills on Sun Sep 25, 2022 3:56 pm, edited 1 time in total.
These users thanked the author Graham Mills for the post (total 2):
Ilan TochnerVeritas McMaster
User avatar
Veritas McMaster
Posts: 50
Joined: Wed Feb 23, 2022 12:37 pm
Has thanked: 147 times
Been thanked: 67 times
Contact:

Re: Security System

Post by Veritas McMaster »

OMG!!!! Thank you. I think I can follow that. I'll try as soon as I get home and give you feedback. THANK YOU sooo much!
These users thanked the author Veritas McMaster for the post:
Graham Mills
Graham Mills
Posts: 1314
Joined: Sun Dec 23, 2012 2:26 pm
Has thanked: 1134 times
Been thanked: 1141 times

Re: Security System

Post by Graham Mills »

Updated version that restarts the timer when the world restarts.

Code: Select all

//SECURITY ORB v0.2 by Graham Mills_2
//Uses OSSL functions restricted to Owners/Estate Managers
//Use at your own risk. I suggest changing the channel values DCHAN and WCHAN for your own use.


integer DCHAN = -456;
integer WCHAN = -457;
//integer BCHAN = -458;
key ID;
key OWNER;
string STATUS;
list TP_OLD;
list TP_NEW; 
vector RED = <1,0,0>;
vector GREEN = <0,1,0>;

list order_buttons(list buttons)
{
    return llList2List(buttons, -3, -1) + llList2List(buttons, -6, -4)
         + llList2List(buttons, -9, -7) + llList2List(buttons, -12, -10);
}

default
{
    state_entry()
    { 
        STATUS = "OFF";
        llSetColor(RED, ALL_SIDES);
        llListen(DCHAN, "", NULL_KEY, "");
        llListen(WCHAN, "", NULL_KEY, "");
        //llListen(BCHAN, "", NULL_KEY, "");
    }
    
    changed(integer c)
    {
        if (c & CHANGED_REGION_RESTART)
        {
            llSetTimerEvent(20.0);
        }
    }
    
    touch_start(integer n)
    {
        OWNER = llGetOwner();
        list buttons = order_buttons(["ON", "OFF", "ADD WHITE"]);//, "ADD BLACK"
        llDialog(OWNER,"Status: "+STATUS, buttons, DCHAN);
        llSetTimerEvent(20.0);
    }
    
    listen(integer chan, string name, key id, string msg)
    {
        if ((chan == DCHAN) && (id == OWNER))
        {
            if (msg == "ON")
            {
                STATUS = "ON";
                llSetColor(GREEN, ALL_SIDES);
            }
            else if (msg == "OFF")
            {
                STATUS = "OFF";
                llSetColor(RED, ALL_SIDES);
            }
            else if (msg == "ADD WHITE")
            {
                llTextBox(OWNER, "Avatar name for whitelist", WCHAN);
            }
            //else if (msg == "ADD BLACK")
            //{
            //    llTextBox(ID, "Avatar name for blacklist", BCHAN);
            //}
        }
        else if ((chan == WCHAN)  && (id == OWNER))//add to whitelist
        {
            list names = llParseString2List(msg, [" "], []);//from textbox
            key id2 = osAvatarName2Key(llList2String(names, 0), llList2String(names, 1)) ;
            if (id2 != NULL_KEY)
            {
                string idname = ","+llList2String(names, 0) +" "+ llList2String(names, 1) +","+ (string)id2+",";//add uri?
                integer exists = llGetInventoryType("whitelist");
                if (exists == INVENTORY_NONE)//no nc so make one
                {
                    osMakeNotecard("whitelist", [idname]);
                }
                else //nc present, add new id if unique
                {
                    //read nc, add name to list, write nc
                    string avies = osGetNotecard("whitelist");
                    if (llSubStringIndex(avies, ","+id2+",") > -1)
                    {
                        llOwnerSay("Avatar ID already in whitelist");
                    }
                    else
                    {                
                        llRemoveInventory("whitelist");
                        avies = avies + idname;
                        list temp = llParseString2List(avies, ["\n"], []);
                        osMakeNotecard("whitelist", llDumpList2String(temp, "\n"));
                        llOwnerSay("Avatar added to whitelist");
                        llOwnerSay((string)osGetNumberOfNotecardLines("whitelist") + " avatars on whitelist");
                    }
                }
            }
            else 
            {
                llOwnerSay("Avatar not recognised");// not in kitely db
            }
        }
    }
    
    timer()
    {
        integer exists = llGetInventoryType("whitelist");
        if ((exists != INVENTORY_NONE) && (llGetColor(0) == GREEN))
        {
            string white = osGetNotecard("whitelist");
            list agents = llGetAgentList(AGENT_LIST_PARCEL, []);
            integer i;
            key id;
            for(i = 0; i < llGetListLength(agents); i++)
            {
                id = llList2Key(agents, i);
                if ((llSubStringIndex(white, ","+id+",") > -1) || (id == OWNER))
                {
                    //On whitelist                
                }
                else
                {
                    TP_NEW = TP_NEW + [id];
                    if (llListFindList(TP_OLD, id) > -1)
                    {
                        llInstantMessage(id, "You are being expelled");
                    }
                    else
                    {    
                        llInstantMessage(id, "Access to this parcel is RESTRICTED. Please leave immediately or you will be expelled in 20 sec.");
                    }
                }
            }
            list TEMP;
            for(i = 0; i < llGetListLength(TP_NEW); i++)
            {
                id = llList2Key(agents, i);
                if (llListFindList(TP_OLD, [id]) > -1)//was present 20 sec previously
                {
                    osTeleportAgent(id, "Kitely Welcome Center", <128, 128, 25>, ZERO_VECTOR);//expel
                }
                else
                {
                    TEMP = TEMP + [id];
                }
            }
            TP_OLD = TEMP;
            TP_NEW = [];
        }
    }
}
These users thanked the author Graham Mills for the post:
Veritas McMaster
User avatar
Veritas McMaster
Posts: 50
Joined: Wed Feb 23, 2022 12:37 pm
Has thanked: 147 times
Been thanked: 67 times
Contact:

Re: Security System

Post by Veritas McMaster »

thank you, I get lots of script errors. I took it to a place I have owner's rights but still get errors. I'm going to work through all you said, step by step by rinse and repeat steps.... see if I can get it going. So appreciated!
Graham Mills
Posts: 1314
Joined: Sun Dec 23, 2012 2:26 pm
Has thanked: 1134 times
Been thanked: 1141 times

Re: Security System

Post by Graham Mills »

Veritas McMaster wrote:
Sun Sep 25, 2022 5:43 pm
thank you, I get lots of script errors. I took it to a place I have owner's rights but still get errors. I'm going to work through all you said, step by step by rinse and repeat steps.... see if I can get it going. So appreciated!
Sorry to hear that. What kind of errors are you getting?

I've left a copy (green cylinder) running on a temporary world called Security Test. The parcel affected is outlined using a hollow prim. Feel free to check it out. Hopefully it's full perms so you can take a copy. The whitelist is presently set to Dot Matrix and Ilan Tochner so you should be expelled after 20 sec stay in the parcel.
Graham Mills
Posts: 1314
Joined: Sun Dec 23, 2012 2:26 pm
Has thanked: 1134 times
Been thanked: 1141 times

Re: Security System

Post by Graham Mills »

It strikes me in passing that scripted parcel-level access might also be useful in puzzle/adventure/escape room builds where progression depends on solving some problem before you can advance to the next parcel/problem. I'm sure that's not an original observation but wondered whether anyone was actively doing it?
User avatar
Veritas McMaster
Posts: 50
Joined: Wed Feb 23, 2022 12:37 pm
Has thanked: 147 times
Been thanked: 67 times
Contact:

Re: Security System

Post by Veritas McMaster »

I'm trying not to tax you with my ignorance, @Graham, to work through what you have already posted before asking for more help. One thing I need to know is where are you made Estate Manager? Land, Group, or web? Desmond Lane at Greenfield where my main home is located is willing to do this but I don't know where it is done. I also took the script to Zeta where have Owner rights on a parcel to try it out there but don't know if they use the same scripting. I really, really appreciate your help. :)
Post Reply