Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Looking for a script

Thelxepeia Danton
Registered User
Join date: 7 Jan 2006
Posts: 174
06-11-2006 07:08
Hihihi!

I was looking for a script that would only allow someone who is 90 days or younger to buy something I'm selling.

Can anyone help???

I know the money trees do that, and have seen a few designers also... but just can't seem to find it!

Any help would be appreciated!

Thanks in advance.
Lee Dimsum
Registered User
Join date: 22 Feb 2006
Posts: 118
06-11-2006 07:41
Use llRequestAgentData(key, DATA_BORN); for getting the account's creation date.
Use llGetDate() for getting current date.
Thelxepeia Danton
Registered User
Join date: 7 Jan 2006
Posts: 174
wow...
06-11-2006 08:00
this will only sell to people 90 days or younger?? if i put that in contents/scripts?

Thanks and sorry for asking so many questions..still new to scripting and know hows.

:-)
Ordinal Malaprop
really very ordinary
Join date: 9 Sep 2005
Posts: 4,607
06-11-2006 08:35
You need to use llRequestAgentData, which will return the birthdate in the dataserver() event, then you compare that to the current date. Give it a try and if you can't get it to work, post here again and somebody will give you a hand.
Thelxepeia Danton
Registered User
Join date: 7 Jan 2006
Posts: 174
ugh
06-11-2006 20:21
guess I am not ready for scripting! LOL Where I'm lost at is where you would set the number of days allowed to be old... if you want 60 or 90... etc.

:(
Osgeld Barmy
Registered User
Join date: 22 Mar 2005
Posts: 3,336
06-11-2006 23:54
altho i dont have time to detail everything your wanting to do, here is a functional 90 days or less checker, which can be setup to your needs ill check back in tommarow to see how this thread is going :)

CODE

key user_key; // the uuid of the person interacting with the object

default
{
touch_start(integer num_detected) // when someone touches the object
{
user_key = llDetectedKey(0); // get their key
llRequestAgentData((key)user_key,DATA_BORN); // send a request for birthdate
}
dataserver(key kQueryid, string data) // birthdate request received
{
//turn the data into a float value so we can compare it mathmaticly
float av_total_days = ( ((float)llGetSubString(data,5,6)/12)+ //returned years
((float)llGetSubString(data,8,9)/365)+//returned months
((float)llGetSubString(data,0,3)) ); //returned days


data = llGetDate(); //set data to reflect todays date and do the same process

float td_total_days = ( ((float)llGetSubString(data,5,6)/12)+
((float)llGetSubString(data,8,9)/365)+
((float)llGetSubString(data,0,3)) );

// subtract todays total days - the users total days, convert to integer (no decmial)
integer df_total_days = llRound((td_total_days - av_total_days) * 365);

//if that number is less than or = to 91 do this
// 91 becuase the date from llGetDate() is in GMT time
// so it is 1 day ahead of SL time @ like 7pm SL time or something close to that
if (df_total_days <= 91)
{
llSay(0, llKey2Name(user_key) + " is valid");
}

// if the user is older than 91 days do this
else llSay(0,llKey2Name(user_key) + " is " + (string) df_total_days + " days old");
}
}
Sol Columbia
Ding! Level up
Join date: 24 Sep 2005
Posts: 91
06-12-2006 11:27
I have a vendor script that I provide for free (as long as it's to help out noobs) that does what you're looking for. I'll get you a copy tonight =)
_____________________
Thelxepeia Danton
Registered User
Join date: 7 Jan 2006
Posts: 174
w0000000ts
06-13-2006 21:56
got it, and thank you!

-hugs-