These forums are CLOSED. Please visit the new forums HERE
Library: Multi User Lockable Door |
|
Rubina Stanwell
Queen of Sheeba
Join date: 14 Jun 2006
Posts: 128
|
10-04-2006 21:37
TY violetann <3 !
_____________________
Stealing hearts and panties since the eighties...
--------------------------- ![]() http://adimusl.wordpress.com | Afrocentric Hairstyles for Men & Women in SecondLife |
Soen Eber
Registered User
Join date: 3 Aug 2006
Posts: 428
|
12-03-2006 10:34
Numerous enhancements to the basic swing door script:
(Existing feature mods) Typing say or show works the same way Commands and names may be given in any case. Names will be converted to mixed case Only the owner of the door may remove themselves from the accesss list (New features) New Autolock with changeable time (in minutes). Default is 5 minutes. This is done with no change to the timer mechanism - it self-enables on the next access attempt. New Pivot feature now allows doors to swing left (counterclockwise) or right (clockwise) New Status message shows lock status, times, pivot direction, and access list Question: does rotation cause prim drift? If so, then a loc/rot memorize feature should be enabled as well. [1/21/07: still hoping someone will answer this] Usage instructions: Create two prims, one to represent the door, and another, much smaller one to reporesent the hinge. link the hinge to one side of the door. Make the hinge the root prim (last one linked) and drop the script into it. CODE
|
BadPenguin Posthorn
Registered User
Join date: 17 Dec 2006
Posts: 39
|
01-15-2007 13:41
CODE
Um, you have added restrictions, a poison pill, and an advertising clause, none of which are compatible with the GPLv2. Nor can you restrict someone from selling GPL'ed software as long as the comply with the terms. Just an FYI ![]() |
ostara Voskhod
Registered User
Join date: 6 Jan 2007
Posts: 1
|
really wonderful!
01-19-2007 21:00
thanks for this script! it worked like a charm right away, no problems.
the pivot action is great! i'll definitely be putting in a secret room behind my bookcase now ![]() |
Soen Eber
Registered User
Join date: 3 Aug 2006
Posts: 428
|
01-22-2007 06:18
Just a quick update to the previous code. You may now disable autolock by entering an autolock time of 0.
Future plans are to separate the authentication engine from the door code, expose functionality hooks through link messages and IM's, Expand open/close choices to sliding, iris, prim cut & phantom open/close, and (tentatively) make it usable for rental operations. |
Soen Eber
Registered User
Join date: 3 Aug 2006
Posts: 428
|
02-08-2007 12:09
Um, you have added restrictions, a poison pill, and an advertising clause, none of which are compatible with the GPLv2. Nor can you restrict someone from selling GPL'ed software as long as the comply with the terms. Just an FYI ![]() I was WONDERING why the original coder had that there ... now that I know GPL scripts can't be restricted that way I'll gladly pull that code out next time I have an update. |
Starling Reve
Registered User
Join date: 11 Dec 2006
Posts: 2
|
Little Bug?
02-15-2007 02:18
i am not sure but i think there is a little bug in it, Users with Names with more than one uppercase letters are not allowed to open a locked door. I think the name normalization is wrong or is only executed on adding a user not at the open door check.
so it compares CJ to Cj for example. |
Wiz Elswit
Registered User
Join date: 20 Feb 2007
Posts: 2
|
added variable to control amount of pivot and removed poison pill
02-24-2007 00:11
// Nifty Neato Multi User Lockable Door, A Red Visions Script
// Copyright (C) 2004 Meiyo Sojourner // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // (Also available at http://www.gnu.org/copyleft/gpl.html) // // // Additional Credits: //~~~~~~~~~~~~~~~~~~~~~ // Default door open/close operation from a script by Kyle Chaos // // Revison History: //~~~~~~~~~~~~~~~~~ //12/1/07 Soen Eber // (new) status messages // (new) changeable pivot direction // (new) autolock // (mod) Only the owner can remove themselves from access list // (mod) Arguments can be any case // (mod) Names normalized to Sentence case (i.e., soen EBER becomes Soen Eber) // (mod) "Show" or "Say" do the same thing // 12/26/07 Soen Eber // (mod) autolock time of 0 disables autolock // 02/20/07 Wiz Elswit // (mod) added variable to control how far door pivots // (mod) removed poison pill //GLOBALS //======= // For the messages, use %nn% in place of the name // of the av that clicked on the door. // Set the variable to "" to disable the message. string startup_message = "Touch door and say 'show help' in the chat for a list of commands"; string open_message = "%nn% is at the door."; string close_message = ""; string lock_message = "Sorry %nn%, this door is locked"; integer open_time = 20; integer pivot = 1; float pivot_amt = .25; // portion of circle to pivot .25 = 90 deg, .5 = 180 deg, .75 = 270 deg integer autolock_time=300; string open_sound = ""; // These can be set to "" string close_sound = ""; // to disable the sounds. integer debug_messages = FALSE; //- - - - - - - - - - - - - - - - list auth_list = []; integer door_open = FALSE; integer locked = FALSE; integer listen_tag = -1; integer old_pivot = 0; float interval = 30.0; float timeLastUsed = 0.0; list help_message = [ "**Multi User Lockable Door Commands List **", " (you may use 'show' or 'say' interchangeably)", " 'show help' - Displays this file", " 'show status' - Display door status", " 'lock' - Sets the door to Locked mode", " 'unlock' - Sets the door to Unlocked mode", " 'pivot [left|right|clockwise|counterclockwise]' - Sets the door pivot to left (counterclockwise) or right (clockwise)", " 'add [name]' - Replace [name] with the av you want to add to the list", " 'remove [name]' - Replace [name] with an av you want to delete", " 'show list' - Shows who is on the All Access list", " 'change time [time]' - Replace [time] with the number of seconds", " you want the door to stay open and listen.", " 'autolock time [time]' - Replace [time] with the number of minutes", " before the doors lock automatically. Zero value disables autolock." ]; show_status() { if (locked == TRUE) { llWhisper(0, "Door is locked" ![]() } else { llWhisper(0, "Door is unlocked" ![]() } llWhisper(0, "open time = " + (string)open_time + " seconds" ![]() if (autolock_time > 0) { llWhisper(0, "autolock time = " + (string)(autolock_time/60) + " minutes" ![]() } else { llWhisper(0, "autolock is disabled" ![]() } if (pivot == 1) { llWhisper(0, "Door pivots left (counterclockwise)" ![]() } else { llWhisper(0, "Door pivots right (clockwise)" ![]() } llWhisper(0, "Authorized Users are: " ![]() sayList(auth_list); } //TOOL FUNCTIONS //============== float debug(string m) // Allows for debug messages { // to be easily turned on/off if (debug_messages) llSay(0,m); return TRUE; } integer k = FALSE; //- - - - - - - - - - - - - - - - float debugList(list l) // List version of the { // debug() function string s = ""; if (debug_messages){ integer i; for (i = 0; i < llGetListLength(l); i++){ s += llList2String(l,i); if (i < llGetListLength(l) - 1) s += ", "; } if (s == "" ![]() llSay(0,"LIST IS EMPTY" ![]() }else{ llSay(0,s); } } return TRUE; } //- - - - - - - - - - - - - - - - integer q(){ llSay(0,"This script is provided free of charge. Please contact Meiyo Sojourner if you paid for it." ![]() return TRUE; } //- - - - - - - - - - - - - - - - float sayList(list l) // Dumps the contents of { // the list into the chat string s = ""; integer i; for (i = 0; i < llGetListLength(l); i++){ s += llList2String(l,i); if (i < llGetListLength(l) - 1) s += ", "; } if (s == "" ![]() llWhisper(0,"LIST IS EMPTY" ![]() }else{ llWhisper(0,s); } return TRUE; } //- - - - - - - - - - - - - - - - float sayList2(list l) // Dumps the contents of the list { // into the chat one line at a time integer i; for (i = 0; i < llGetListLength(l); i++){ llWhisper(0,llList2String(l,i)); } return TRUE; } //- - - - - - - - - - - - - - - - integer isIn(list test_list, list test_item) // Looks for test_item { // in test_list integer i; for (i = 0; i < llGetListLength(test_list); i++){ if (llList2String(test_item, 0) == llList2String(test_list, i)) return TRUE; } return FALSE; } //- - - - - - - - - - - - - - - - string replace(string main, string old, string new) // Search and replace { // function for strings string temp = ""; list m = llParseString2List(main,["%"],[]); integer i; for(i = 0; i < llGetListLength(m); i ++){ string c = llList2String(m,i); if (c == old){ temp += new; }else{ temp += c; } } return temp; } //- - - - - - - - - - - - - - - - float stopListening() // Kills the listen function { // in order to save resources if(listen_tag != -1) llListenRemove(listen_tag); listen_tag = -1; return TRUE; } //- - - - - - - - - - - - - - - - float removeName(string target_name) // Searches for and deletes { // target_name from auth_list integer i; for (i = 0; i < llGetListLength(auth_list); i++){ if (target_name == llList2String(auth_list, i)){ auth_list = llDeleteSubList(auth_list, i, i); return TRUE; } } return FALSE; } //- - - - - - - - - - - - - - - - integer open(string av_name) // Opens the door. { if (open_sound != "" ![]() llTriggerSound(open_sound, 0.5); if (open_message != "" ![]() llSay(0, replace(open_message,"nn",av_name)); // vv Replace this snippet with custom code to close the door vv rotation rot = llGetRot(); rotation delta = llEuler2Rot(<0,0,PI*pivot_amt*pivot> ![]() rot = delta * rot; llSetRot(rot); llSleep(0.25); rot = delta * rot; llSetRot(rot); // ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ return TRUE; } //- - - - - - - - - - - - - - - - integer close(string av_name) // Closes the door. { if (close_sound != "" ![]() llTriggerSound(close_sound, 0.5); if (close_message != "" ![]() llSay(0, replace(close_message,"nn",av_name)); // vv Replace this snippet with custom code to close the door vv rotation rot = llGetRot(); rotation delta = ZERO_ROTATION; if (old_pivot != 0) { delta = llEuler2Rot(<0,0,PI*pivot_amt*old_pivot*-1> ![]() old_pivot = 0; } else { delta = llEuler2Rot(<0,0,PI*pivot_amt*pivot*-1> ![]() } rot = delta * rot; llSetRot(rot); llSleep(0.25); rot = delta * rot; llSetRot(rot); // ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ return FALSE; } //- - - - - - - - - - - - - - - - //CODE ENTRY //========== default { state_entry() { k = q(); llRequestAgentData(llGetOwner(), DATA_NAME); } dataserver(key queryid, string data) { auth_list += data; llSay(0,"Owner added to Authorized List." ![]() if (startup_message != "" ![]() llSay(0,startup_message); } on_rez(integer rez) { llResetScript(); } touch_start(integer total_number) { list temp = []; if (!door_open){ if ((llGetTime() > autolock_time) && (autolock_time > 0)) { locked = TRUE; } llGetAndResetTime(); if (!locked){ door_open = open(llDetectedName(0)); listen_tag = llListen(0,"","","" ![]() llSetTimerEvent(open_time); } else if (isIn(auth_list, temp += llDetectedName(0))){ debug("authorized" ![]() door_open = open(llDetectedName(0)); listen_tag = llListen(0,"","","" ![]() llSetTimerEvent(open_time); } else { llSay(0, replace(lock_message,"nn",llDetectedName(0))); } } else { door_open = close(llDetectedName(0)); } debug("TEMP =" ![]() debugList(temp); debug("AUTH_LIST = " ![]() debugList(auth_list); } timer() { stopListening(); if (door_open){ door_open = close("the script" ![]() } } listen(integer chan, string name, key id, string msg) { list temp = []; if (isIn(auth_list, temp += name)){ list n = llParseString2List(msg, [" "], []); string cmd_a = llList2String(n, 0); string cmd_b = llList2String(n, 1); string cmd_c = llList2String(n, 2); integer len = 0; string first = ""; string last = ""; if (llToLower(cmd_a) == "lock" ![]() locked = TRUE; llSay(0,"Door Locked" ![]() } if (llToLower(cmd_a) == "unlock" ![]() locked = FALSE; llSay(0,"Door Unlocked" ![]() } if (llToLower(cmd_a) == "add" ![]() if ((cmd_b == "" ![]() ![]() llSay(0, "Incorrect Name Format!" ![]() }else{ temp = []; // Normalize Name len = llStringLength(cmd_b); first = llToUpper(llGetSubString(cmd_b, 0, 0)) + llToLower(llGetSubString(cmd_b, 1, len)); len = llStringLength(cmd_c); last = llToUpper(llGetSubString(cmd_c, 0, 0)) + llToLower(llGetSubString(cmd_c, 1, len)); string new_name = first + " " + last; if(!isIn(auth_list, temp += new_name)){ auth_list += new_name; llSay(0, new_name + " added to list." ![]() }else{ llSay(0, new_name + " was already on the list." ![]() } } } if ((llToLower(cmd_a) == "remove" ![]() ![]() if ((cmd_b == "" ![]() ![]() llSay(0, "Incorrect Name Format!" ![]() }else{ // Normalize Name len = llStringLength(cmd_b); first = llToUpper(llGetSubString(cmd_b, 0, 0)) + llToLower(llGetSubString(cmd_b, 1, len)); len = llStringLength(cmd_c); last = llToUpper(llGetSubString(cmd_c, 0, 0)) + llToLower(llGetSubString(cmd_c, 1, len)); string kill_name = first + " " + last; integer authorized = TRUE; if (llKey2Name(llGetOwner()) == kill_name) { if (id == llGetOwner()) { llSay(0, "Removing Owner from access list" ![]() } else { authorized = FALSE; llSay(0, "Only the door's owner may remove themselves from the access list" ![]() } } if (authorized == TRUE) { if (removeName(kill_name)){ llSay(0,"Name Successfully Removed" ![]() }else{ llSay(0,"Name Not Found!" ![]() } } } } if (((llToLower(cmd_a) == "say" ![]() ![]() ![]() sayList(auth_list); } if (((llToLower(cmd_a) == "say" ![]() ![]() ![]() sayList2(help_message); } if (((llToLower(cmd_a) == "say" ![]() ![]() ![]() show_status(); } if ((llToLower(cmd_a) == "change" ![]() ![]() ![]() float foo = llList2Float(n, 2); if (foo < 10){ llSay(0, "Invalid Time Specified!" ![]() }else{ open_time = (integer)foo; llSay(0, "Open time changed to " + cmd_c + " seconds." ![]() } } if ((llToLower(cmd_a) == "pivot" ![]() { if ((llToLower(cmd_b) == "left" ) || (llToLower(cmd_b) == "counterclockwise" ![]() old_pivot = pivot; pivot = 1; llSay(0, "pivot set to left (counterclockwise)" ![]() } if ((llToLower(cmd_b) == "right" ![]() old_pivot = pivot; pivot = -1; llSay(0, "pivot set to right (counterclockwise)" ![]() } } if ((llToLower(cmd_a) == "autolock" ![]() ![]() float foo = llList2Float(n, 2); if (foo < 0){ llSay(0, "Invalid Autolock Time Specified - must be 0 or more minutes!" ![]() }else if (foo == 0) { autolock_time = 0; llSay(0, "Autolock disabled" ![]() }else{ autolock_time = (integer)(foo * 60); llSay(0, "Autolock time changed to " + cmd_c + " minutes." ![]() } } } } } |
Wiz Elswit
Registered User
Join date: 20 Feb 2007
Posts: 2
|
Minor enhancements to add variable pivot amt and remove poison pill
02-24-2007 17:21
// Nifty Neato Multi User Lockable Door, A Red Visions Script
// Copyright (C) 2004 Meiyo Sojourner // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. // (Also available at http://www.gnu.org/copyleft/gpl.html) // // Additional Credits: //~~~~~~~~~~~~~~~~~~~~~ // Default door open/close operation from a script by Kyle Chaos // // Revison History: //~~~~~~~~~~~~~~~~~ //12/1/07 Soen Eber // (new) status messages // (new) changeable pivot direction // (new) autolock // (mod) Only the owner can remove themselves from access list // (mod) Arguments can be any case // (mod) Names normalized to Sentence case (i.e., soen EBER becomes Soen Eber) // (mod) "Show" or "Say" do the same thing // 12/26/07 Soen Eber // (mod) autolock time of 0 disables autolock // 02/20/07 Wiz Elswit // (mod) added variable to control how far door pivots // (mod) removed poison pill //GLOBALS //======= // For the messages, use %nn% in place of the name // of the av that clicked on the door. // Set the variable to "" to disable the message. string startup_message = "Touch door and say 'show help' in the chat for a list of commands"; string open_message = "%nn% is at the door."; string close_message = ""; string lock_message = "Sorry %nn%, this door is locked"; integer open_time = 20; integer pivot = 1; float pivot_amt = .25; // portion of circle to pivot .25 = 90 deg, .5 = 180 deg, .75 = 270 deg integer autolock_time=300; string open_sound = ""; // These can be set to "" string close_sound = ""; // to disable the sounds. integer debug_messages = FALSE; //- - - - - - - - - - - - - - - - list auth_list = []; integer door_open = FALSE; integer locked = FALSE; integer listen_tag = -1; integer old_pivot = 0; float interval = 30.0; float timeLastUsed = 0.0; list help_message = [ "**Multi User Lockable Door Commands List **", " (you may use 'show' or 'say' interchangeably)", " 'show help' - Displays this file", " 'show status' - Display door status", " 'lock' - Sets the door to Locked mode", " 'unlock' - Sets the door to Unlocked mode", " 'pivot [left|right|clockwise|counterclockwise]' - Sets the door pivot to left (counterclockwise) or right (clockwise)", " 'add [name]' - Replace [name] with the av you want to add to the list", " 'remove [name]' - Replace [name] with an av you want to delete", " 'show list' - Shows who is on the All Access list", " 'change time [time]' - Replace [time] with the number of seconds", " you want the door to stay open and listen.", " 'autolock time [time]' - Replace [time] with the number of minutes", " before the doors lock automatically. Zero value disables autolock." ]; show_status() { if (locked == TRUE) { llWhisper(0, "Door is locked" ![]() } else { llWhisper(0, "Door is unlocked" ![]() } llWhisper(0, "open time = " + (string)open_time + " seconds" ![]() if (autolock_time > 0) { llWhisper(0, "autolock time = " + (string)(autolock_time/60) + " minutes" ![]() } else { llWhisper(0, "autolock is disabled" ![]() } if (pivot == 1) { llWhisper(0, "Door pivots left (counterclockwise)" ![]() } else { llWhisper(0, "Door pivots right (clockwise)" ![]() } llWhisper(0, "Authorized Users are: " ![]() sayList(auth_list); } //TOOL FUNCTIONS //============== float debug(string m) // Allows for debug messages { // to be easily turned on/off if (debug_messages) llSay(0,m); return TRUE; } integer k = FALSE; //- - - - - - - - - - - - - - - - float debugList(list l) // List version of the { // debug() function string s = ""; if (debug_messages){ integer i; for (i = 0; i < llGetListLength(l); i++){ s += llList2String(l,i); if (i < llGetListLength(l) - 1) s += ", "; } if (s == "" ![]() llSay(0,"LIST IS EMPTY" ![]() }else{ llSay(0,s); } } return TRUE; } //- - - - - - - - - - - - - - - - integer q(){ llSay(0,"This script is provided free of charge. Please contact Meiyo Sojourner if you paid for it." ![]() return TRUE; } //- - - - - - - - - - - - - - - - float sayList(list l) // Dumps the contents of { // the list into the chat string s = ""; integer i; for (i = 0; i < llGetListLength(l); i++){ s += llList2String(l,i); if (i < llGetListLength(l) - 1) s += ", "; } if (s == "" ![]() llWhisper(0,"LIST IS EMPTY" ![]() }else{ llWhisper(0,s); } return TRUE; } //- - - - - - - - - - - - - - - - float sayList2(list l) // Dumps the contents of the list { // into the chat one line at a time integer i; for (i = 0; i < llGetListLength(l); i++){ llWhisper(0,llList2String(l,i)); } return TRUE; } //- - - - - - - - - - - - - - - - integer isIn(list test_list, list test_item) // Looks for test_item { // in test_list integer i; for (i = 0; i < llGetListLength(test_list); i++){ if (llList2String(test_item, 0) == llList2String(test_list, i)) return TRUE; } return FALSE; } //- - - - - - - - - - - - - - - - string replace(string main, string old, string new) // Search and replace { // function for strings string temp = ""; list m = llParseString2List(main,["%"],[]); integer i; for(i = 0; i < llGetListLength(m); i ++){ string c = llList2String(m,i); if (c == old){ temp += new; }else{ temp += c; } } return temp; } //- - - - - - - - - - - - - - - - float stopListening() // Kills the listen function { // in order to save resources if(listen_tag != -1) llListenRemove(listen_tag); listen_tag = -1; return TRUE; } //- - - - - - - - - - - - - - - - float removeName(string target_name) // Searches for and deletes { // target_name from auth_list integer i; for (i = 0; i < llGetListLength(auth_list); i++){ if (target_name == llList2String(auth_list, i)){ auth_list = llDeleteSubList(auth_list, i, i); return TRUE; } } return FALSE; } //- - - - - - - - - - - - - - - - integer open(string av_name) // Opens the door. { if (open_sound != "" ![]() llTriggerSound(open_sound, 0.5); if (open_message != "" ![]() llSay(0, replace(open_message,"nn",av_name)); // vv Replace this snippet with custom code to close the door vv rotation rot = llGetRot(); rotation delta = llEuler2Rot(<0,0,PI*pivot_amt*pivot> ![]() rot = delta * rot; llSetRot(rot); llSleep(0.25); rot = delta * rot; llSetRot(rot); // ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ return TRUE; } //- - - - - - - - - - - - - - - - integer close(string av_name) // Closes the door. { if (close_sound != "" ![]() llTriggerSound(close_sound, 0.5); if (close_message != "" ![]() llSay(0, replace(close_message,"nn",av_name)); // vv Replace this snippet with custom code to close the door vv rotation rot = llGetRot(); rotation delta = ZERO_ROTATION; if (old_pivot != 0) { delta = llEuler2Rot(<0,0,PI*pivot_amt*old_pivot*-1> ![]() old_pivot = 0; } else { delta = llEuler2Rot(<0,0,PI*pivot_amt*pivot*-1> ![]() } rot = delta * rot; llSetRot(rot); llSleep(0.25); rot = delta * rot; llSetRot(rot); // ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ return FALSE; } //- - - - - - - - - - - - - - - - //CODE ENTRY //========== default { state_entry() { k = q(); llRequestAgentData(llGetOwner(), DATA_NAME); } dataserver(key queryid, string data) { auth_list += data; llSay(0,"Owner added to Authorized List." ![]() if (startup_message != "" ![]() llSay(0,startup_message); } on_rez(integer rez) { llResetScript(); } touch_start(integer total_number) { list temp = []; if (!door_open){ if ((llGetTime() > autolock_time) && (autolock_time > 0)) { locked = TRUE; } llGetAndResetTime(); if (!locked){ door_open = open(llDetectedName(0)); listen_tag = llListen(0,"","","" ![]() llSetTimerEvent(open_time); } else if (isIn(auth_list, temp += llDetectedName(0))){ debug("authorized" ![]() door_open = open(llDetectedName(0)); listen_tag = llListen(0,"","","" ![]() llSetTimerEvent(open_time); } else { llSay(0, replace(lock_message,"nn",llDetectedName(0))); } } else { door_open = close(llDetectedName(0)); } debug("TEMP =" ![]() debugList(temp); debug("AUTH_LIST = " ![]() debugList(auth_list); } timer() { stopListening(); if (door_open){ door_open = close("the script" ![]() } } listen(integer chan, string name, key id, string msg) { list temp = []; if (isIn(auth_list, temp += name)){ list n = llParseString2List(msg, [" "], []); string cmd_a = llList2String(n, 0); string cmd_b = llList2String(n, 1); string cmd_c = llList2String(n, 2); integer len = 0; string first = ""; string last = ""; if (llToLower(cmd_a) == "lock" ![]() locked = TRUE; llSay(0,"Door Locked" ![]() } if (llToLower(cmd_a) == "unlock" ![]() locked = FALSE; llSay(0,"Door Unlocked" ![]() } if (llToLower(cmd_a) == "add" ![]() if ((cmd_b == "" ![]() ![]() llSay(0, "Incorrect Name Format!" ![]() }else{ temp = []; // Normalize Name len = llStringLength(cmd_b); first = llToUpper(llGetSubString(cmd_b, 0, 0)) + llToLower(llGetSubString(cmd_b, 1, len)); len = llStringLength(cmd_c); last = llToUpper(llGetSubString(cmd_c, 0, 0)) + llToLower(llGetSubString(cmd_c, 1, len)); string new_name = first + " " + last; if(!isIn(auth_list, temp += new_name)){ auth_list += new_name; llSay(0, new_name + " added to list." ![]() }else{ llSay(0, new_name + " was already on the list." ![]() } } } if ((llToLower(cmd_a) == "remove" ![]() ![]() if ((cmd_b == "" ![]() ![]() llSay(0, "Incorrect Name Format!" ![]() }else{ // Normalize Name len = llStringLength(cmd_b); first = llToUpper(llGetSubString(cmd_b, 0, 0)) + llToLower(llGetSubString(cmd_b, 1, len)); len = llStringLength(cmd_c); last = llToUpper(llGetSubString(cmd_c, 0, 0)) + llToLower(llGetSubString(cmd_c, 1, len)); string kill_name = first + " " + last; integer authorized = TRUE; if (llKey2Name(llGetOwner()) == kill_name) { if (id == llGetOwner()) { llSay(0, "Removing Owner from access list" ![]() } else { authorized = FALSE; llSay(0, "Only the door's owner may remove themselves from the access list" ![]() } } if (authorized == TRUE) { if (removeName(kill_name)){ llSay(0,"Name Successfully Removed" ![]() }else{ llSay(0,"Name Not Found!" ![]() } } } } if (((llToLower(cmd_a) == "say" ![]() ![]() ![]() sayList(auth_list); } if (((llToLower(cmd_a) == "say" ![]() ![]() ![]() sayList2(help_message); } if (((llToLower(cmd_a) == "say" ![]() ![]() ![]() show_status(); } if ((llToLower(cmd_a) == "change" ![]() ![]() ![]() float foo = llList2Float(n, 2); if (foo < 10){ llSay(0, "Invalid Time Specified!" ![]() }else{ open_time = (integer)foo; llSay(0, "Open time changed to " + cmd_c + " seconds." ![]() } } if ((llToLower(cmd_a) == "pivot" ![]() { if ((llToLower(cmd_b) == "left" ) || (llToLower(cmd_b) == "counterclockwise" ![]() old_pivot = pivot; pivot = 1; llSay(0, "pivot set to left (counterclockwise)" ![]() } if ((llToLower(cmd_b) == "right" ![]() old_pivot = pivot; pivot = -1; llSay(0, "pivot set to right (counterclockwise)" ![]() } } if ((llToLower(cmd_a) == "autolock" ![]() ![]() float foo = llList2Float(n, 2); if (foo < 0){ llSay(0, "Invalid Autolock Time Specified - must be 0 or more minutes!" ![]() }else if (foo == 0) { autolock_time = 0; llSay(0, "Autolock disabled" ![]() }else{ autolock_time = (integer)(foo * 60); llSay(0, "Autolock time changed to " + cmd_c + " minutes." ![]() } } } } } |
Soen Eber
Registered User
Join date: 3 Aug 2006
Posts: 428
|
04-21-2007 08:56
Version 1.3 now includes a group access option
I have also removed all case-sensitive checks and replaced them with Insensitive checks - so for example Martin McCoy will now be recognized. Multi-User Lockable Door Command Set When first rezzed, the door will automatically assign the owner of the door to the door's access list. Only the door's owner will be able to remove themselves from the access list. (you may use 'show' or 'say' interchangeably) : 'show help' - Displays this file : 'show status' - Display door status : 'lock' - Sets the door to Locked mode : 'unlock' - Sets the door to Unlocked mode : 'pivot [left|right|clockwise|counterclockwise]' - Sets the door pivot to left (counterclockwise) or right (clockwise) : 'add [name]' - Replace [name] with the av you want to add to the list : 'remove [name]' - Replace [name] with an av you want to delete : 'show list' - Shows who is on the All Access list : 'group access [YES|NO] - Sets group access to the door : 'change time [time]' - Replace [time] with the number of seconds : you want the door to stay open and listen. : 'autolock time [time]' - Replace [time] with the number of minutes before the doors lock automatically. Zero value disables autolock. Initial settings are : Door is locked : open time = 20 seconds : autolock time = 5 minutes : Door pivot = left (counterclockwise) : Authorized Users = (the door's owner) : group access = NO CODE
|
Usagi Musashi
UM ™®
Join date: 24 Oct 2004
Posts: 6,083
|
04-23-2007 02:15
Thank You
![]() |
Marc Broderick
Registered User
Join date: 28 Aug 2006
Posts: 2
|
04-24-2007 10:41
arent locking doors somewhat novelty in SL?
Even with a locked door, cant someone cam around inside and choose sit on an object and still get in? |
Slayora DeSantis
Registered User
Join date: 29 Dec 2006
Posts: 66
|
Door problems
04-26-2007 17:48
I post this at another thread, but i realized that it was your script!
![]() I put the script in a door, and it is not opening correctly, not matter which direction I place it in. Is there something that I'm not doing? Thanks |
Daz Honey
Fine, Fine Artist
Join date: 27 Jun 2005
Posts: 599
|
show help not working?
04-29-2007 13:03
am i missing something here (marbles etc)? the "touch door and say 'show help'" doesnt work no matter what i do. I'd really like to get this door script to work.
_____________________
All children are artists. The problem is how to remain an artist once he grows up. - Pablo Picasso
|
Soen Eber
Registered User
Join date: 3 Aug 2006
Posts: 428
|
04-30-2007 05:50
Daz, I sent you a command set and working door using the existing code, and it seems to be working. I would like to work with you if there continue to be issues - IM me nights/weekends.
Marc: Locks exist to keep honest people honest. The alternative is to buy a private island and set it as private, that's the only sure-fire way. |
Zephyrin Zabelin
Registered User
Join date: 10 May 2007
Posts: 153
|
05-13-2007 03:29
In The Sims community, I am known as the lockable door modder. This is similar to how I make doors there, by storing the IDs of the authorised people actually on the door. But I think it would be rather nice in SL to have actual keys that can be given out to people (non-copyable of course!) and have the door detect if you are a keyholder. I have only been to one class on Linden scripting, so I am not yet aware whether it is possible for a script to search an AV's inventory to see if it contains a particular class of item?
|
Cristalle Karami
Lady of the House
![]() Join date: 4 Dec 2006
Posts: 6,222
|
05-31-2007 19:41
I don't program, but if you make an attachment that, when worn, sends a message to the door, maybe that could function as the key.
|
Alicia Sautereau
if (!social) hide;
![]() Join date: 20 Feb 2007
Posts: 3,125
|
07-09-2007 20:42
multiple sliding door version based on violetann Petion`s code with the option to use a door alpha/phantom collision detector:
main door (all llSay() commands/help/info) CODE
the stripped down version wich acts as the child (no help, no confirmations, nada to avoid spam(cept say list)) CODE
and the phantom prim u can just drop and set the channel right CODE
not good in coding but hope i got it right without much waste of resources ![]() |
Dragger Lok
(loading ...)
Join date: 10 Sep 2006
Posts: 228
|
Anyone Have This Script?
07-14-2007 10:14
http://www.slexchange.com/modules.php?name=Marketplace&file=item&ItemID=27466 Both modified to work with double doors, and adds an enforcer level so authorized people can only access a locked door, not change the authorized list or lock and unlock the door. It's free ![]() --edit I put the link to the gift version on accident (costs $1L so you can have it delivered to another) fixed link to the truely free version Slex has it unavailable- creator can't get inworld- |
Petteri Yiyuan
Registered User
Join date: 4 Mar 2007
Posts: 56
|
08-03-2007 01:32
Is there sliding door version available for this script?
|
Malia Writer
Unemployed in paradise
![]() Join date: 20 Aug 2007
Posts: 2,026
|
08-30-2007 09:31
I am new at this, so please forgive the need for extra help...
Just placed this script (Soen's v.1.3) into a door. The door now rotates vertically when opened; I have read through this thread but am still not quite clear how to fix this, can someone help? Also, it doesn't seem to recognize me as the owner, it says "When first rezzed, the door will automatically assign the owner of the door to the door's access list. Only the door's owner will be able to remove themselves from the access list." In noob terms, does this mean that I need to take the door into my inventory and place it again? And another possibly stupid question.... can't I just "lock" the door by turning the script off altogether? Then it would just be a wall to anyone but me... ![]() Advice appreciated please! |
Malia Writer
Unemployed in paradise
![]() Join date: 20 Aug 2007
Posts: 2,026
|
08-30-2007 11:43
Forum post: door lock
I am new at this, so please forgive the need for extra help... Just placed this script (Soen's v.1.3) into a door. The door now rotates vertically when opened; I have read through this thread but am still not quite clear how to fix this, can someone help? Also, it doesn't seem to recognize me as the owner, it says "When first rezzed, the door will automatically assign the owner of the door to the door's access list. Only the door's owner will be able to remove themselves from the access list." In noob terms, does this mean that I need to take the door into my inventory and place it again? And another possibly stupid question.... can't I just "lock" the door by turning the script off altogether? Then it would just be a wall to anyone but me... ![]() Advice appreciated please! |
Myla Astonia
Myla Astonia
Join date: 10 Dec 2006
Posts: 2
|
entire group instead of seperate avies
09-29-2007 10:53
What if you want to ad your own (entire) group to have access the group isn't that big but still a group-ad is pretty conveniant and maybe still ad seperate avies aswell.
|
Nazz Niven
Registered User
Join date: 11 Jan 2007
Posts: 9
|
10-23-2007 17:51
I love this script, but now I'm wondering if instead of adding the names one by one...is it possible to have group access to it?
Would appreciate any help I can get. thanks. |