Jump to content

Mailbox script with specific users


Kaia Kiyori
 Share

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

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

Recommended Posts

So I have a basic mailbox script that I can touch and it gives me options to read or delete a notecard in an object.

What I'd like to be able to add to it is the ability to assign certain individuals to have that same option to read or delete, without having to give them edit rights where they can just take a copy.

Link to comment
Share on other sites

Alternatively, use the LSD as storage for UUIDs.

Saves a lot of space in the script.

You can, like, create keys "_acc:<UUID>" with value "RW", "RO", etc.

Search the LSD for the key of a user's UUID, and if listed (key found), check the value for what privileges the user have, and act accordingly.

  • Like 1
Link to comment
Share on other sites

21 hours ago, Marvin Benelli said:

touch_start(integer num){
     if(llListFindList(gWhiteList,[llDetectedKey(0)])>=0){
          Your Mailbox code
     }

Where gWhiteList holds the uuid’s of allowed avatars

 

One, what is the Mailbox code and how do I obtain it?

Two, where, exactly does the UUID go in that string? If you could put in some zeros as example numbers as a place holder for a UUID?

Link to comment
Share on other sites

1 hour ago, Kaia Kiyori said:

One, what is the Mailbox code and how do I obtain it?

That must refer to the "basic mailbox script" mentioned in the OP, assuming you wrote or have the source code for that script. This forum is to help people write LSL scripts, which kind of presupposes that the script code is available to extend.

Now, a basic mailbox script based on notecards is not an insurmountable obstacle, and maybe there's one in a script library somewhere, dunno.

 

 

Link to comment
Share on other sites

On 2/3/2023 at 12:37 AM, Marvin Benelli said:

touch_start(integer num){
     if(llListFindList(gWhiteList,[llDetectedKey(0)])>=0){
          Your Mailbox code
     }

17 minutes ago, Marvin Benelli said:

gWhiteList is supposed to be a global variable of type list and it could be assigned like gWhiteList = ["8faa4bda-733d-429c-95ec-ef8449604cc9",llGetOwner(),....];

The result from llDetectedKey has to be typecast to string, otherwise llListFindList will never find any results, because the "keys" in the global list will be strings.

Link to comment
Share on other sites

11 hours ago, Wulfie Reanimator said:

The result from llDetectedKey has to be typecast to string, otherwise llListFindList will never find any results, because the "keys" in the global list will be strings.

Good point, Wolfie!

Alternatively:

gWhiteList = [(key)”8faa4bda-733d-429c-95ec-ef8449604cc9",llGetOwner(),....];

Link to comment
Share on other sites

5 hours ago, Marvin Benelli said:

gWhiteList = [(key)”8faa4bda-733d-429c-95ec-ef8449604cc9",llGetOwner(),....];

typecasts and function calls don't work in global variables. You can of course do it in state_entry() but if you're making a script in which you expect people to edit variables directly, it's good and common practice to place the 'configuration variables' at the very top of the script, rather than expecting people to scroll down.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 447 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...