removed useless _ folders
This commit is contained in:
3
Age_Check/Age_Check.sol
Normal file
3
Age_Check/Age_Check.sol
Normal file
@@ -0,0 +1,3 @@
|
||||
<Solution name="Age_Check">
|
||||
<Project name="Age_Check" path="Age_Check\Age_Check.prj" active="true"/>
|
||||
</Solution>
|
||||
6
Age_Check/Age_Check/Age_Check.prj
Normal file
6
Age_Check/Age_Check/Age_Check.prj
Normal file
@@ -0,0 +1,6 @@
|
||||
<Project name="Age_Check" guid="D6D9FF6B-6C00-1014-B904-200204C60A89">
|
||||
<Object name="Object" guid="D6DA004E-6C00-1014-B904-200204C60A89">
|
||||
<Script name="Age_Check_1.lsl" guid="D6DA2149-6C00-1014-B904-200204C60A89">
|
||||
</Script>
|
||||
</Object>
|
||||
</Project>
|
||||
69
Age_Check/Age_Check/Object/Age_Check_1.lsl
Normal file
69
Age_Check/Age_Check/Object/Age_Check_1.lsl
Normal file
@@ -0,0 +1,69 @@
|
||||
// :CATEGORY:Avatar Age
|
||||
// :NAME:Age_Check
|
||||
// :AUTHOR:Anonymous
|
||||
// :CREATED:2010-01-10 05:20:56.000
|
||||
// :EDITED:2013-09-18 15:38:47
|
||||
// :ID:19
|
||||
// :NUM:29
|
||||
// :REV:1.0
|
||||
// :WORLD:Second Life
|
||||
// :DESCRIPTION:
|
||||
// Age Check.lsl
|
||||
// :CODE:
|
||||
|
||||
// This is a simple method to verify the age of a person.
|
||||
// It does not use all the fancy leap year detection and whatever stuff.
|
||||
// It compensates for leap years by adding a quarter day to each full year.
|
||||
// For everyday use the accuracy of +/- 1 to 2 days should be sufficient.
|
||||
|
||||
// Free Script. Do not remove this header or the comments if you plan to pass it on to others.
|
||||
// This script may NOT be sold for monetary profit unless it is integrated in some other script
|
||||
// you want or need an age check for.
|
||||
|
||||
// Enjoy.
|
||||
|
||||
key Query;
|
||||
|
||||
default
|
||||
{
|
||||
|
||||
on_rez(integer X) {llResetScript();}
|
||||
|
||||
touch_start(integer X)
|
||||
{
|
||||
llSetText("Verifying your age...",<0,1,0>,1);
|
||||
Query = llRequestAgentData(llDetectedKey(0),DATA_BORN);
|
||||
}
|
||||
|
||||
dataserver(key QID,string Data)
|
||||
{
|
||||
if (QID == Query)
|
||||
{
|
||||
// The following variables are set to account for leap years and assume
|
||||
// the days evenly distributed amongst the 12 months of a year.
|
||||
float YrDays = 365.25;
|
||||
float MnDays = YrDays / 12;
|
||||
float DyInc = 1 / MnDays;
|
||||
// This is the user's birthdate.
|
||||
integer uYr = (integer)llGetSubString(Data,0,3);
|
||||
integer uMn = (integer)llGetSubString(Data,5,6);
|
||||
integer uDy = (integer)llGetSubString(Data,8,9);
|
||||
float uXVal = uYr * YrDays + (uMn - 1) * MnDays + uDy * DyInc;
|
||||
// This is today's date
|
||||
Data = llGetDate();
|
||||
integer Yr = (integer)llGetSubString(Data,0,3);
|
||||
integer Mn = (integer)llGetSubString(Data,5,6);
|
||||
integer Dy = (integer)llGetSubString(Data,8,9);
|
||||
float XVal = Yr * YrDays + (Mn - 1) * MnDays + Dy * DyInc;
|
||||
// We calculate the difference between those two dates to get the number of days.
|
||||
integer DDiff = (integer)(XVal - uXVal);
|
||||
// Here we check if the calculated age fits our requirements.
|
||||
if (DDiff < 180) {
|
||||
llSetText("Age Check Failed!\nYou are younger than 180 days!",<1,1,1>,1);
|
||||
} else {
|
||||
llSetText("Age Check Passed!",<1,1,1>,1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// END //
|
||||
Reference in New Issue
Block a user