Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

rentbox

Leander Tyles
Registered User
Join date: 12 Jan 2010
Posts: 5
02-06-2010 09:37
im not realy a scriptor but i can peice things together,
i made a multi-user-rentbox which uses a list to hold the data and added the ability to extend your lease if already in the list...
but still so many features missing like min/max time, refund, expiration warnings, expired, max renters, arrears, under & overpaying.


ill probally give up before doing all that, i know thiers open source rent scripts out thier but any multi user versions like mine?

list g_RENTERS;
list g_LENGHT;
list g_PRIMS;

// configuration
integer config_rentwarning = 3;
integer config_graceperiod = 3;
integer config_rate = 43;
integer config_min_days = 7;

integer DAYSEC = 86400;

// data about renter
string name_rented;
key name_rented_key;
integer lenght_rented_until;

string timespan(integer time)
{
integer days = time / DAYSEC;
integer curtime = (time / DAYSEC) - (time % DAYSEC);
integer hours = curtime / 3600;
integer minutes = (curtime % 3600) / 60;
integer seconds = curtime % 60;

return (string)llAbs(days) + " days, " + (string)llAbs(hours) + " hours, "
+ (string)llAbs(minutes) + " minutes, " + (string)llAbs(seconds) + " seconds";

}

string get_rentalbox_info()
{
return llGetRegionName() + " @ " + (string)llGetPos() + "Expire: " + timespan(lenght_rented_until - llGetUnixTime()) + ";)";
}




default
{
state_entry()
{
llSetTimerEvent(900); //15 minute checks

}
touch_start(integer int)
{
integer x;
integer Length = llGetListLength(g_RENTERS);
for (x = 0;x < Length;x++)
{
string name = llList2String(g_RENTERS,x);
string amount = llList2String(g_LENGHT,x);
//
string times = llList2String(g_PRIMS,x);
string tick;
tick = timespan(lenght_rented_until - llGetUnixTime());

llSay(0,(string)name + "Lenght: " + (string)tick);
}
}

money(key giver, integer amount)
{

name_rented = llKey2Name(giver);
name_rented_key = giver;
integer Position = llListFindList(g_RENTERS,(list)name_rented);

if (Position == -1)
{

integer credit = (amount - (amount % config_rate))/config_rate;
lenght_rented_until = llGetUnixTime() + (credit * (24*60*60));

g_RENTERS += name_rented;
g_LENGHT += lenght_rented_until;
// g_PRIMS += prims_rented;

llInstantMessage(llGetOwner(), "NEW LEASE STARTED - $" + (string)(amount - (amount % config_rate)) + "L - " + get_rentalbox_info() );

}

if (Position != -1)
{

integer credit = (amount - (amount % config_rate))/config_rate;
lenght_rented_until = lenght_rented_until + (credit * (24*60*60));
llSay(0,"Your lease has been extended.";);

g_RENTERS += name_rented;
g_LENGHT += lenght_rented_until;
// g_PRIMS += prims_rented;

}
}
}
Void Singer
Int vSelf = Sing(void);
Join date: 24 Sep 2005
Posts: 6,973
02-06-2010 15:14
I don't know of any freebie rental box scripts that are more full featured off hand (have you checked the scripting libraries here, on the LSL_Portal, and at lslwiki? )

I'm assuming that's the question... hard to tell since you posted a script with it.

for what it's worth you seem to be headed in the right direction with that script to add those features, although from what I can tell, your plots are all the same size/price? or at least the need to be with that script, so you may want to add some parcel size choosing options, if they're not, or won't be in the future.
_____________________
|
| . "Cat-Like Typing Detected"
| . This post may contain errors in logic, spelling, and
| . grammar known to the SL populace to cause confusion
|
| - Please Use PHP tags when posting scripts/code, Thanks.
| - Can't See PHP or URL Tags Correctly? Check Out This Link...
| -