Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Newb Banner Help?

Keira Wells
Blender Sculptor
Join date: 16 Mar 2008
Posts: 2,371
04-16-2008 10:01
I can't post my exact script at the moment, as I'm not able to get to the script while here at school. However, I can tell what it does and how, and see if that's enough to go on ^_^


I wrote a script (I call it the Newb Calc) that calculates the approximate age of a given avatar. It's accurate down to months, and days if less than a month old, essentially.

To do this, it converts both current date and BORN_DATE to a list, then the elements to integers, and then just does some math with those. If under 2 months (At the moment), it returns the integer AVSTAT as 0, and if over, it's returned as 1.

Basic premise.

Now then, all of that calculation, and declaration of the value of AVSTAT is in the dataserver() event, called by the llRequestAgentData, which is triggered by a touch_start() event.

However, now I wish to take AVSTAT and use it, back in the touch event, to eject them from the land if AVSTAT = 0.

Is this possible? Can I use the value declared in the dataserver event, back in the touch_start event?

If not, how can I manage it so that it bans them under a certain value for AVSTAT? I can only do those calculations and declaration of value within the dataserver event as far as I can tell, so... I'm a bit confused at this point.

Hoping this is worded well enough to understand, if not, then when I get home I'll post the script. Thanks for reading, and any help ^_^
_____________________
Tutorials for Sculpties using Blender!
Http://www.youtube.com/user/BlenderSL
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
04-16-2008 10:59
Is there anything other than the touch event that would cause the dataserver request? Are you being careful to remember the request IDs in case any other scripts in your prim ever make dataserver requests, or in case you start a second such request before getting an answer for the first? Can't you just consider the logic in the dataserver event a natural extension of the code in the touch event?
Keira Wells
Blender Sculptor
Join date: 16 Mar 2008
Posts: 2,371
04-16-2008 11:08
Actually, thinking on it, the touch_start() will be changing to a collision_start() event.

Anyhow, I'm not sure what you mean. With the request ID's, I'm not worrying about it at this point, as I'm just trying to get it to work before I fine tune it. It's the only script in the prim, and unlikely to have people popping in every second or two, as it's for a new sim with no real market yet. So at the moment, I just want to get the idea working, and then make sure that it's not crossing itself.

If I put something like the following into the dataserver event, would it work?

CODE

if (AVSTAT == 0)
{
llEjectFromLand(llDetectedKey(0));
}
else if (AVSTAT == 1)
{
llSay(0, "Welcome to the land, " llKey2Name(llDetectedKey(0));
}


Or could I do an if for AVSTAT inside the collision/touch event? It seems like it would go on the last value for AVSTAT, not the one for the newest agent, if that makes sense.
_____________________
Tutorials for Sculpties using Blender!
Http://www.youtube.com/user/BlenderSL
Travis Lambert
White dog, red collar
Join date: 3 Jun 2004
Posts: 2,819
04-16-2008 12:21
Keira - just a point in case its useful....

I'm not sure if your intention is to llEjectFromLand() people under a minimum age, or to llAddToLandBanList().

If its the latter - I'd advise that you ban with a given duration (float hours), rather than a permanent ban (float zero) - for several reasons:

1. If you ban with a duration, you wont have to clean it up later when the person reaches the age you specify.

2. Parcel banlists can only hold 300 entries. Banning people in the way you describe above may cause your list to fill quickly, also limiting its effectiveness.


Hope this helps! :)


Additionally, there's a freebie at the Shelter called the "Age Detector". Its just a simple conversation starter that spits out the user's age in days to the room, upon click.

The script is full-perm, and written by me. Feel free to snag it & use it for your purposes if its helpful :)
_____________________
------------------
The Shelter

The Shelter is a non-profit recreation center for new residents, and supporters of new residents. Our goal is to provide a positive & supportive social environment for those looking for one in our overwhelming world.
Keira Wells
Blender Sculptor
Join date: 16 Mar 2008
Posts: 2,371
04-16-2008 13:31
From: Travis Lambert
Keira - just a point in case its useful....

I'm not sure if your intention is to llEjectFromLand() people under a minimum age, or to llAddToLandBanList().

If its the latter - I'd advise that you ban with a given duration (float hours), rather than a permanent ban (float zero) - for several reasons:

1. If you ban with a duration, you wont have to clean it up later when the person reaches the age you specify.

2. Parcel banlists can only hold 300 entries. Banning people in the way you describe above may cause your list to fill quickly, also limiting its effectiveness.


Hope this helps! :)


Additionally, there's a freebie at the Shelter called the "Age Detector". Its just a simple conversation starter that spits out the user's age in days to the room, upon click.

The script is full-perm, and written by me. Feel free to snag it & use it for your purposes if its helpful :)

Thank you for your input ^_^

In this particular case, I'm not banning, because it's for an entire sim. I want to just eject if under so many months, and still be able to have people TP'd in if they're needed or whatever, if that makes sense. I don't want to make it impossible for young accounts to be there, just want to restrict it because of the sad reality that is that most new accounts are not yet mature enough in-world to not cause problems in this particular sim. (I'm not against newbies, and this is not my sim. I am doing this scripting to help a friend, and I understand their reasoning. I do not wish to argue about the morality or reasoning behind this script).

I'll check out your script, thanks ^_^ My current one doesn't get that completely accurate, because I was relieved to have figured out how to do it at all, and I'd love to see how I can manage it a bit better ^_^

Now then. i'm now home, and will post my script in about 20 minutes, and rephrase my question, so that it's actually understandable ^_^
_____________________
Tutorials for Sculpties using Blender!
Http://www.youtube.com/user/BlenderSL