Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Rental Bot v1.5 Help 20 Linked

Ody Naglo
Registered User
Join date: 1 Apr 2008
Posts: 31
10-06-2008 09:33
I Edited this script to my liking but it seems when I link 20 or more together some of there menus wont work I tried a few things already editing out chan = getname and changing random channel to a set channel it keeps doing it. It only fixes when I go into the script of the broken rental bot and reset it. Reset other scripts dont work nore does the on rez reset. Im at a total loss please help =) I know its a long code forgive me. Anyone who solves this will get a few goodies from my stock of items for sale on SLX.


Plz note this isent a reset script help thread there is something else I think that is casuing this. Becuase like 15 of thos 20 do work just fine.

CODE


integer chan = 999999;

list splitwith;

list splitname;

string ownername;

integer not_registered = TRUE;

vector original_location;

vector original_scale;

integer objects = 25; // objects

integer price = 350; // price

integer weeks = 1; // weaks

vector offset = <0, -3, 0>;

integer mature = 0;

string rentor;

string rentorkey;

integer rented = FALSE;

string rentperiod;

integer numListen;

integer randchannel;

integer editmode;

integer stopper;

string daterented;

integer rentedweeks;

integer timerevent;

default

{

on_rez(integer change)

{

llResetScript();

chan = (integer)llGetObjectName();

editmode = 0;

llSetText("FOR RENT",<.80,.35,0>, 2.0);

llMessageLinked(LINK_SET, chan,"setdesc",llGetOwner());

llInstantMessage(llGetOwner(),"for help click item then select help from menu");

llSetTexture("rentit", ALL_SIDES);

llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);

llListen(chan,"","","");

randchannel = (integer)llFrand(10000000);

llListen(randchannel,"","","");

editmode = 0;

timerevent = 0;

rented = FALSE;

}

listen(integer c, string n, key id, string m)

{

stopper = 0;

string objectname;

objectname = llGetObjectName();

if (m == "Vacent" && c == randchannel && id == llGetOwner() && rented == TRUE)

{

llSetText("FOR RENT",<.80,.35,0>, 2.0);

llMessageLinked(LINK_SET, chan,"setdesc",llGetOwner());

llSetTexture("rentit", ALL_SIDES);

llSetPos(original_location);

llSetScale(original_scale);

llListenRemove(numListen);

numListen = llListen(chan, "", "", "" );

rentperiod = "";

rentor = "";

rentorkey = NULL_KEY;

rented = FALSE;

daterented = "";

rentedweeks = 0;

timerevent = 0;

llSetTimerEvent(0);

llSay(0, objectname + " is vacent");

}

if (m == "Mature" && c == randchannel && id == llGetOwner())

{

mature = 1;

llOwnerSay("set to Mature Area");

}

if (m == "Renter info" && c == randchannel && id == llGetOwner())

{

integer weeks2;

weeks2 = timerevent / 7 / 24 / 60 / 60;

integer days;

days = timerevent / 24 / 60 / 60 - (weeks2 * 7);

integer hours;

hours = timerevent / 60 / 60 - (weeks2 * 7 * 24) - (days * 24);

integer mins;

mins = timerevent / 60 - (weeks2 * 7 * 24 * 60) - (days * 24 * 60) - (hours * 60);

integer seconds;

seconds = timerevent - (weeks2 * 7 * 24 * 60 * 60) - (days * 24 * 60 * 60) - (hours * 60 * 60) - (mins * 60);

llInstantMessage(llGetOwner(),"Renter name: " + rentor);

llInstantMessage(llGetOwner(),"Rented Date: " + daterented);

llInstantMessage(llGetOwner(),"Rented Left: " + (string)weeks2 + " weeks | " + (string)days + " days | " + (string)hours + ":" + (string)mins + ";" +(string)seconds);

if (rentedweeks >= 2)

{

llInstantMessage(llGetOwner(),"Rented amount: " + (string)rentedweeks + " weeks");

}

if (rentedweeks == 1)

{

llInstantMessage(llGetOwner(),"Rented amount: " + (string)rentedweeks + " week");

}

if (rentedweeks <= 0)

{

llInstantMessage(llGetOwner(),"Rented amount: N/A");

}

}

if (m == "PG" && c == randchannel && id == llGetOwner())

{

mature = 0;

llOwnerSay("set to PG Area");

}

if (m == "Status" && c == randchannel && id == llGetOwner())

{

string mit;

llInstantMessage(llGetOwner(),"Prim's set to " + (string)objects);

llInstantMessage(llGetOwner(),"Week's set to " + (string)weeks);

llInstantMessage(llGetOwner(),"Offset set to " + (string)offset);

if (mature == 1)

{

mit = "Yes";

}

else

{

mit = "No";

}

llInstantMessage(llGetOwner(),"Regen Mature: " + (string)mit);

}

if(m == "Edit Mode" && editmode == 0 && stopper == 0 && c == randchannel && id == llGetOwner())

{

stopper = 1;

editmode = 1;

llInstantMessage(llGetOwner(),"editmode on");

}

if(m == "Edit Mode" && editmode == 1 && stopper == 0 && c == randchannel && id == llGetOwner())

{

stopper = 1;

editmode = 0;

llInstantMessage(llGetOwner(),"editmode off");

}

if (m == "Help" && c == randchannel && id == llGetOwner())

{

llGiveInventory(llGetOwner(), "Rentals Help");

}

if (llGetSubString(m,0,8) == "set weeks" && id==llGetOwner() && editmode == 1)

{

weeks = (integer)llGetSubString(m,9,llStringLength(m));

llOwnerSay("weeks set to " + (string)weeks);

}

if (llGetSubString(m,0,10) == "set renter " && id==llGetOwner() && editmode == 1)

{

rentor = llGetSubString(m,11,llStringLength(m));

llOwnerSay("renter set to " + rentor);

}

if (llGetSubString(m,0,9) == "set split " && id==llGetOwner() && editmode == 1)

{

id = (key)llGetSubString(m,10,llStringLength(m));

splitwith += id;

splitname += llKey2Name(id);

llOwnerSay(llKey2Name(id) + " added to split with list");

}

if (llGetSubString(m,0,12) == "split remove " && id==llGetOwner() && editmode == 1)

{

string name = llGetSubString(m,13,llStringLength(m));

integer finddata = llListFindList(splitname,(list)name);

if(finddata == -1)

{

llOwnerSay("sorry " + name + " not found");

}else

{

llDeleteSubList(splitwith,finddata,finddata);

llDeleteSubList(splitname,finddata,finddata);

llOwnerSay(name +" removed from shared list");

}

}

if (llGetSubString(m,0,13) == "set rentedfor " && id==llGetOwner() && editmode == 1)

{

string date = llGetTimestamp();

daterented = llGetSubString(date,8,9) + "/" + llGetSubString(date,5,6) + "/" + llGetSubString(date,0,3) + " | Time " + llGetSubString(date,11,15);

original_scale = llGetScale();

original_location = llGetLocalPos();

list renttime = llParseStringKeepNulls(llGetSubString(m,14,llStringLength(m)), [":"], []);

integer days = llList2Integer(renttime,0);

integer hours = llList2Integer(renttime,1);

integer minites = llList2Integer(renttime,2);

integer seconds = llList2Integer(renttime,3);

integer total;

total = (days * 24 * 60 * 60) + (hours * 60 * 60) + (minites * 60) + (seconds);

llSetTexture("info", ALL_SIDES);

llSetPos(original_location + offset);

llSetScale(<0.236,0.236,0.236>);

timerevent = total;

llSetTimerEvent(1);

llOwnerSay("set to " + (string)days + " days " + (string)hours + " hours " + (string)minites + " mins " + (string)seconds + " seconds");

rented = TRUE;

}

if (llGetSubString(m,0,10) == "set offset " && id==llGetOwner() && editmode == 1)

{

offset = (vector)llGetSubString(m,11,llStringLength(m));

llOwnerSay("Offset set to " + (string)offset);

}

if (llGetSubString(m,0,8) == "set prims" && id==llGetOwner() && editmode == 1)

{

objects = (integer)llGetSubString(m,9,llStringLength(m));

llOwnerSay("Prims set to " + (string)objects);

}

if (llGetSubString(m,0,8) == "set price" && id==llGetOwner() && editmode == 1)

{

price = (integer)llGetSubString(m,9,llStringLength(m));

llOwnerSay("Price set to L$" + (string)price);

}

}

link_message(integer sender_num, integer c, string m, key id)

{

if(llGetSubString(m,0,8) == "Edit Mode" && editmode == 0 && c == chan)

{

editmode = 1;

llOwnerSay("editmode on");

}

else if(llGetSubString(m,0,8) == "Edit Mode" && editmode == 1 && c == chan)

{

editmode = 0;

llOwnerSay("editmode off");

}

if (llGetSubString(m,0,8) == "set price" && editmode == 1)

{

price = (integer)llGetSubString(m,9,llStringLength(m));

llOwnerSay("Price set to L$" + (string)price);

}

if (llGetSubString(m,0,8) == "set prims" && editmode == 1)

{

objects = (integer)llGetSubString(m,9,llStringLength(m));

llOwnerSay("Prims set to " + (string)objects);

}

}

state_entry()

{

//chan = (integer)llGetObjectName();

editmode = 0;

llSetText("FOR RENT",<.80,.35,0>, 2.0);

llMessageLinked(LINK_SET, chan,"setdesc",llGetOwner());

editmode = 0;

randchannel = (integer)llFrand(10000000);

llSay(0, "Activating...");

ownername = llKey2Name(llGetOwner());

//llWhisper(0, "Asking for permission from owner " + ownername + ".");

llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);

original_location = llGetLocalPos();

original_scale = llGetScale();

llListenRemove(numListen);

rentedweeks = 0;

numListen = llListen(chan, "", "", "" );

llListen(randchannel,"","","");

timerevent = 0;

}

run_time_permissions(integer type)

{

if (type == PERMISSION_DEBIT)

{

ownername = llKey2Name(llGetOwner());

llSay(0, "This space is now available for rent.");

not_registered = FALSE;

}

}

timer() {

timerevent--;

if (timerevent != 0)

{

integer weeks2;

weeks2 = timerevent / 7 / 24 / 60 / 60;

integer days;

days = timerevent / 24 / 60 / 60 - (weeks2 * 7);

integer hours;

hours = timerevent / 60 / 60 - (weeks2 * 7 * 24) - (days * 24);

integer mins;

mins = timerevent / 60 - (weeks2 * 7 * 24 * 60) - (days * 24 * 60) - (hours * 60);

integer seconds;

seconds = timerevent - (weeks2 * 7 * 24 * 60 * 60) - (days * 24 * 60 * 60) - (hours * 60 * 60) - (mins * 60);

llSetText("Rentor: "+rentor+" Rented: "+ daterented + "Rented Left: " + (string)weeks2 + " weeks | " + (string)days + " days | " + (string)hours + ":" + (string)mins + ":" +(string)seconds, <.80,.35,0>, 2.0);

}

else

{

if((key)rentorkey != NULL_KEY)

{

llSetText("FOR RENT",<.80,.35,0>, 2.0);

llMessageLinked(LINK_SET, chan,"setdesc",llGetOwner());

llInstantMessage(rentorkey,"Your rental at " + llGetRegionName() + " has expired");

}

llSay(0,"rental expired");

string objectname;

objectname = llGetObjectName();

llSetTexture("rentit", ALL_SIDES);

llSetPos(original_location);

llSetScale(original_scale);

numListen = llListen(chan, "", "", "" );

rentperiod = "";

rentor = "";

rentorkey = NULL_KEY;

daterented = "";

rentedweeks = 0;

rented = FALSE;

timerevent = 0;

llSetTimerEvent(0);

}

}

touch_start(integer total_number)

{

if(llDetectedKey(0) == llGetOwner())

{

string edit;

if (editmode == 0)

{

edit = "off";

}

if (editmode == 1)

{

edit = "on";

}

llDialog(llGetOwner(),"vender editor \n editmode is set to: " + edit,["Mature","PG","Vacent","Edit Mode","Renter info","Help","Status"],randchannel);

}

else

{

if(rented == FALSE)

{

llSetText("FOR RENT",<.80,.35,0>, 2.0);

llMessageLinked(LINK_SET, chan,"setdesc",llGetOwner());

llSay(0, "This space is for rent. The price is $" +(string)price+ " per week. Prim limit is "+(string)objects+" prims. Obey prim limits to avoid termination of agreement. Rent is non-refundable.");

if (mature == 1)

{

llSay(0, "Usage Restrictions: This spot is for comercial use. Keep within prim limits or face termination of lease.");

} else

{

llSay(0, "Usage Restrictions: This spot is for comercial use. Keep within prim limits or face termination of lease. Keep To PG Rules as in PG Sim");

}

llSay(0, "Right click and pay to rent this space. Minimum rental period is "+(string)weeks+" weeks, at $" +(string)(price*weeks)+". If you have any questions, please feel free to IM " + ownername + ". For Help please IM " + ownername + ".");

}

else

{

integer weeks2;

weeks2 = timerevent / 7 / 24 / 60 / 60;

integer days;

days = timerevent / 24 / 60 / 60 - (weeks2 * 7);

integer hours;

hours = timerevent / 60 / 60 - (weeks2 * 7 * 24) - (days * 24);

integer mins;

mins = timerevent / 60 - (weeks2 * 7 * 24 * 60) - (days * 24 * 60) - (hours * 60);

integer seconds;

seconds = timerevent - (weeks2 * 7 * 24 * 60 * 60) - (days * 24 * 60 * 60) - (hours * 60 * 60) - (mins * 60);

llSay(0, "This space is occupied by " + rentor + " for " + (string)weeks2 + " weeks | " + (string)days + " days | " + (string)hours + ":" + (string)mins + ";" +(string)seconds);

llSay(0, "Max prims is " + (string)objects + ". For help please IM " + ownername + ".");

}

}

}

money(key giver, integer amount)

{

integer amount2 = amount%price;

integer weeks = amount/price;

if(amount>=price*weeks && amount2==0 && rented == FALSE)

{









llMessageLinked(LINK_SET, chan,"setdesc",(string)giver);

rentedweeks = amount/price;

string date = llGetTimestamp();

daterented = llGetSubString(date,8,9) + "/" + llGetSubString(date,5,6) + "/" + llGetSubString(date,0,3) + " | Time " + llGetSubString(date,11,15);

original_scale = llGetScale();

original_location = llGetLocalPos();

timerevent = 604800*weeks;

//vector offset = <0, 0, 3>;

llInstantMessage(giver, "Correct amount");

rentor = llKey2Name(giver);

rented = TRUE;

rentperiod = (string)weeks;

llInstantMessage(giver, "Prim limit is "+(string)objects+" prims.");

llInstantMessage(giver, "Keep prim limits or risk termination of agreement.Rent is non-refundable. IM " + ownername + " with questions.");

llInstantMessage(giver, "Thank you for renting this space . Thank You For Purchasing "+(string)weeks+" weeks . Feel Free To Put Your stuff in now");

llSetTexture("info", ALL_SIDES);

llSetPos(original_location + offset);

llSetScale(<0.236,0.300,0.236>);

rentorkey = giver;

llSetTimerEvent(1);

if(splitwith != [])

{

integer devide = llGetListLength(splitwith) + 1;

integer totatogive = amount/devide;

integer no;

while(no < llGetListLength(splitwith))

{

key dest = llList2Key(splitwith,no);

llGiveMoney(dest,totatogive);

llInstantMessage(dest,"you have bee payed L$"+ (string)totatogive +" by " + llGetObjectName());

no ++;

}

}

}

else if(rented == TRUE)

{

if (llKey2Name(giver) == rentor && amount>=price*weeks && amount2==0)

{

timerevent += (604800*weeks);

llSay(0, "you have incresed your rental by " + (string)weeks + " weeks");

rentedweeks += weeks;

if(splitwith != [])

{

integer devide = llGetListLength(splitwith) + 1;

integer totatogive = amount/devide;

integer no;

while(no < llGetListLength(splitwith))

{

key dest = llList2Key(splitwith,no);

llGiveMoney(dest,totatogive);

llInstantMessage(dest,"you have bee payed L$"+ (string)totatogive +" by " + llGetObjectName());

no ++;

}

}

}

else

{

llGiveMoney(giver, amount);

llSay(0,"sorry please check rental");

}

}

else

{

llInstantMessage(giver, "Minimum rental period is "+(string)weeks+" weeks, at $" +(string)(price*weeks)+ ". If you have any questions, please feel free to IM" + ownername + ".");

llInstantMessage(giver, "Giving money back.");

llGiveMoney(giver, amount);

}

}

}


Ron Khondji
Entirely unlike.
Join date: 6 Jan 2007
Posts: 224
LSL Editor.
10-06-2008 10:19
I'm not sure if it'll help but if you run the script through the LSL-Editor debugger, there seem to be quite a few errors.

Maybe the script functions better if you fix those errors.

Ody Naglo
Registered User
Join date: 1 Apr 2008
Posts: 31
10-07-2008 11:47
Thank you for responding. I checked thos Errors i dont really understand it =) the script works fine just when its linked to alot of other doors it messes up I dont think settext and the timer is the problem =P. Thanks for the link tho that will help alot when im building scripts.



Edit: I fixed the errors anyways it should be clean now but the problem still persist. Updated Above.


Edit 2: Just ignore the llStrin gLength part I donno why the forums is doing that. cuz when i go to edit its corrected

original_location = llGetLocalPos();

list renttime = llParseStringKeepNulls(llGetSubString(m,14,llStrin gLength(m)), [":"], []);

integer days = llList2Integer(renttime,0);
Ody Naglo
Registered User
Join date: 1 Apr 2008
Posts: 31
10-10-2008 22:20
Anyone? Please =)
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
10-11-2008 07:21
Just out of curiosity, which editor are you using that inserts a blank line between every single line?
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
10-11-2008 07:41
An alternative way of presenting the same data. 763 lines as opposed to 333 lines. This throws no errors:

CODE

integer chan = 999999;
list splitwith;
list splitname;
string ownername;
integer not_registered = TRUE;
vector original_location;
vector original_scale;
integer objects = 25;
integer price = 350;
integer weeks = 1;
vector offset = <0, -3, 0 >;
integer mature = 0;
string rentor;
string rentorkey;
integer rented = FALSE;
string rentperiod;
integer numListen;
integer randchannel;
integer editmode;
integer stopper;
string daterented;
integer rentedweeks;
integer timerevent;

default {
on_rez(integer change) {
llResetScript();
chan = (integer) llGetObjectName();
editmode = 0;
llSetText("FOR RENT", <.80, .35, 0 >, 2.0);
llMessageLinked(LINK_SET, chan, "setdesc", llGetOwner());
llInstantMessage(llGetOwner(), "for help click item then select help from menu");
llSetTexture("rentit", ALL_SIDES);
llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);
llListen(chan, "", "", "");
randchannel = (integer) llFrand(10000000);
llListen(randchannel, "", "", "");
editmode = 0;
timerevent = 0;
rented = FALSE;
}

listen(integer c, string n, key id, string m) {
stopper = 0;
string objectname = llGetObjectName();
if (m == "Vacent" && c == randchannel && id == llGetOwner() && rented == TRUE) {
llSetText("FOR RENT", <.80, .35, 0 >, 2.0);
llMessageLinked(LINK_SET, chan, "setdesc", llGetOwner());
llSetTexture("rentit", ALL_SIDES);
llSetPos(original_location);
llSetScale(original_scale);
llListenRemove(numListen);
numListen = llListen(chan, "", "", "");
rentperiod = "";
rentor = "";
rentorkey = NULL_KEY;
rented = FALSE;
daterented = "";
rentedweeks = 0;
timerevent = 0;
llSetTimerEvent(0);
llSay(0, objectname + " is vacent");
}
if (m == "Mature" && c == randchannel && id == llGetOwner()) {
mature = 1;
llOwnerSay("set to Mature Area");
}
if (m == "Renter info" && c == randchannel && id == llGetOwner()) {
integer weeks2 = timerevent / 7 / 24 / 60 / 60;
integer days = timerevent / 24 / 60 / 60 - (weeks2 * 7);
integer hours = timerevent / 60 / 60 - (weeks2 * 7 * 24) - (days * 24);
integer mins = timerevent / 60 - (weeks2 * 7 * 24 * 60) - (days * 24 * 60) - (hours * 60);
integer seconds = timerevent - (weeks2 * 7 * 24 * 60 * 60) - (days * 24 * 60 * 60) - (hours * 60 * 60) - (mins * 60);
llInstantMessage(llGetOwner(), "Renter name: " + rentor);
llInstantMessage(llGetOwner(), "Rented Date: " + daterented);
llInstantMessage(llGetOwner(), "Rented Left: " + (string) weeks2 + " weeks | " + (string) days + " days | " + (string) hours + ":" + (string) mins + ";" + (string) seconds);
if (rentedweeks >= 2) llInstantMessage(llGetOwner(), "Rented amount: " + (string) rentedweeks + " weeks");
if (rentedweeks == 1) llInstantMessage(llGetOwner(), "Rented amount: " + (string) rentedweeks + " week");
if (rentedweeks <= 0) llInstantMessage(llGetOwner(), "Rented amount: N/A");
}
if (m == "PG" && c == randchannel && id == llGetOwner()) {
mature = 0;
llOwnerSay("set to PG Area");
}
if (m == "Status" && c == randchannel && id == llGetOwner()) {
string mit;
llInstantMessage(llGetOwner(), "Prim's set to " + (string) objects);
llInstantMessage(llGetOwner(), "Week's set to " + (string) weeks);
llInstantMessage(llGetOwner(), "Offset set to " + (string) offset);
if (mature == 1) mit = "Yes";
else mit = "No";
llInstantMessage(llGetOwner(), "Regen Mature: " + (string) mit);
}
if (m == "Edit Mode" && editmode == 0 && stopper == 0 && c == randchannel && id == llGetOwner()) {
stopper = 1;
editmode = 1;
llInstantMessage(llGetOwner(), "editmode on");
}
if (m == "Edit Mode" && editmode == 1 && stopper == 0 && c == randchannel && id == llGetOwner()) {
stopper = 1;
editmode = 0;
llInstantMessage(llGetOwner(), "editmode off");
}
if (m == "Help" && c == randchannel && id == llGetOwner()) llGiveInventory(llGetOwner(), "Rentals Help");
if (llGetSubString(m, 0, 8) == "set weeks" && id == llGetOwner() && editmode == 1) {
weeks = (integer) llGetSubString(m, 9, llStringLength(m));
llOwnerSay("weeks set to " + (string) weeks);
}
if (llGetSubString(m, 0, 10) == "set renter " && id == llGetOwner() && editmode == 1) {
rentor = llGetSubString(m, 11, llStringLength(m));
llOwnerSay("renter set to " + rentor);
}
if (llGetSubString(m, 0, 9) == "set split " && id == llGetOwner() && editmode == 1) {
id = (key) llGetSubString(m, 10, llStringLength(m));
splitwith += id;
splitname += llKey2Name(id);
llOwnerSay(llKey2Name(id) + " added to split with list");
}
if (llGetSubString(m, 0, 12) == "split remove " && id == llGetOwner() && editmode == 1) {
string name = llGetSubString(m, 13, llStringLength(m));
integer finddata = llListFindList(splitname, (list) name);
if (finddata == -1) llOwnerSay("sorry " + name + " not found");
else {
llDeleteSubList(splitwith, finddata, finddata);
llDeleteSubList(splitname, finddata, finddata);
llOwnerSay(name + " removed from shared list");
}
}
if (llGetSubString(m, 0, 13) == "set rentedfor " && id == llGetOwner() && editmode == 1) {
string date = llGetTimestamp();
daterented = llGetSubString(date, 8, 9) + "/" + llGetSubString(date, 5, 6) + "/" + llGetSubString(date, 0, 3) + " | Time " + llGetSubString(date, 11, 15);
original_scale = llGetScale();
original_location = llGetLocalPos();
list renttime = llParseStringKeepNulls(llGetSubString(m, 14, llStringLength(m)),[":"],[]);
integer days = llList2Integer(renttime, 0);
integer hours = llList2Integer(renttime, 1);
integer minites = llList2Integer(renttime, 2);
integer seconds = llList2Integer(renttime, 3);
integer total;
total = (days * 24 * 60 * 60) + (hours * 60 * 60) + (minites * 60) + (seconds);
llSetTexture("info", ALL_SIDES);
llSetPos(original_location + offset);
llSetScale(<0.236, 0.236, 0.236 >);
timerevent = total;
llSetTimerEvent(1);
llOwnerSay("set to " + (string) days + " days " + (string) hours + " hours " + (string) minites + " mins " + (string) seconds + " seconds");
rented = TRUE;
}
if (llGetSubString(m, 0, 10) == "set offset " && id == llGetOwner() && editmode == 1) {
offset = (vector) llGetSubString(m, 11, llStringLength(m));
llOwnerSay("Offset set to " + (string) offset);
}
if (llGetSubString(m, 0, 8) == "set prims" && id == llGetOwner() && editmode == 1) {
objects = (integer) llGetSubString(m, 9, llStringLength(m));
llOwnerSay("Prims set to " + (string) objects);
}
if (llGetSubString(m, 0, 8) == "set price" && id == llGetOwner() && editmode == 1) {
price = (integer) llGetSubString(m, 9, llStringLength(m));
llOwnerSay("Price set to L$" + (string) price);
}
}

link_message(integer sender_num, integer c, string m, key id) {
if (llGetSubString(m, 0, 8) == "Edit Mode" && editmode == 0 && c == chan) {
editmode = 1;
llOwnerSay("editmode on");
}
else if (llGetSubString(m, 0, 8) == "Edit Mode" && editmode == 1 && c == chan) {
editmode = 0;
llOwnerSay("editmode off");
}
if (llGetSubString(m, 0, 8) == "set price" && editmode == 1) {
price = (integer) llGetSubString(m, 9, llStringLength(m));
llOwnerSay("Price set to L$" + (string) price);
}
if (llGetSubString(m, 0, 8) == "set prims" && editmode == 1) {
objects = (integer) llGetSubString(m, 9, llStringLength(m));
llOwnerSay("Prims set to " + (string) objects);
}
}

state_entry() {
editmode = 0;
llSetText("FOR RENT", <.80, .35, 0 >, 2.0);
llMessageLinked(LINK_SET, chan, "setdesc", llGetOwner());
editmode = 0;
randchannel = (integer) llFrand(10000000);
llSay(0, "Activating...");
ownername = llKey2Name(llGetOwner());
llRequestPermissions(llGetOwner(), PERMISSION_DEBIT);
original_location = llGetLocalPos();
original_scale = llGetScale();
llListenRemove(numListen);
rentedweeks = 0;
numListen = llListen(chan, "", "", "");
llListen(randchannel, "", "", "");
timerevent = 0;
}

run_time_permissions(integer type) {
if (type == PERMISSION_DEBIT) {
ownername = llKey2Name(llGetOwner());
llSay(0, "This space is now available for rent.");
not_registered = FALSE;
}
}

timer() {
timerevent--;
if (timerevent != 0) {
integer weeks2 = timerevent / 7 / 24 / 60 / 60;
integer days = timerevent / 24 / 60 / 60 - (weeks2 * 7);
integer hours = timerevent / 60 / 60 - (weeks2 * 7 * 24) - (days * 24);
integer mins = timerevent / 60 - (weeks2 * 7 * 24 * 60) - (days * 24 * 60) - (hours * 60);
integer seconds = timerevent - (weeks2 * 7 * 24 * 60 * 60) - (days * 24 * 60 * 60) - (hours * 60 * 60) - (mins * 60);
llSetText("Rentor: " + rentor + " Rented: " + daterented + "Rented Left: " + (string) weeks2 + " weeks | " + (string) days + " days | " + (string) hours + ":" + (string) mins + ":" + (string) seconds, <.80, .35, 0 >, 2.0);
}
else {
if ((key) rentorkey != NULL_KEY) {
llSetText("FOR RENT", <.80, .35, 0 >, 2.0);
llMessageLinked(LINK_SET, chan, "setdesc", llGetOwner());
llInstantMessage(rentorkey, "Your rental at " + llGetRegionName() + " has expired");
}
llSay(0, "rental expired");
string objectname;
objectname = llGetObjectName();
llSetTexture("rentit", ALL_SIDES);
llSetPos(original_location);
llSetScale(original_scale);
numListen = llListen(chan, "", "", "");
rentperiod = "";
rentor = "";
rentorkey = NULL_KEY;
daterented = "";
rentedweeks = 0;
rented = FALSE;
timerevent = 0;
llSetTimerEvent(0);
}
}

touch_start(integer total_number) {
if (llDetectedKey(0) == llGetOwner()) {
string edit;
if (editmode == 0) edit = "off";
if (editmode == 1) edit = "on";
llDialog(llGetOwner(), "vender editor \n editmode is set to: " + edit, ["Mature", "PG", "Vacent", "Edit Mode", "Renter info", "Help", "Status"], randchannel);
}
else {
if (rented == FALSE) {
llSetText("FOR RENT", <.80, .35, 0 >, 2.0);
llMessageLinked(LINK_SET, chan, "setdesc", llGetOwner());
llSay(0, "This space is for rent. The price is $" + (string) price + " per week. Prim limit is " + (string) objects + " prims. Obey prim limits to avoid termination of agreement. Rent is non-refundable.");
if (mature == 1) llSay(0, "Usage Restrictions: This spot is for comercial use. Keep within prim limits or face termination of lease.");
else llSay(0, "Usage Restrictions: This spot is for comercial use. Keep within prim limits or face termination of lease. Keep To PG Rules as in PG Sim");
llSay(0, "Right click and pay to rent this space. Minimum rental period is " + (string) weeks + " weeks, at $" + (string) (price * weeks) + ". If you have any questions, please feel free to IM " + ownername + ". For Help please IM " + ownername + ".");
}
else {
integer weeks2 = timerevent / 7 / 24 / 60 / 60;
integer days = timerevent / 24 / 60 / 60 - (weeks2 * 7);
integer hours = timerevent / 60 / 60 - (weeks2 * 7 * 24) - (days * 24);
integer mins = timerevent / 60 - (weeks2 * 7 * 24 * 60) - (days * 24 * 60) - (hours * 60);
integer seconds = timerevent - (weeks2 * 7 * 24 * 60 * 60) - (days * 24 * 60 * 60) - (hours * 60 * 60) - (mins * 60);
llSay(0, "This space is occupied by " + rentor + " for " + (string) weeks2 + " weeks | " + (string) days + " days | " + (string) hours + ":" + (string) mins + ";" + (string) seconds);
llSay(0, "Max prims is " + (string) objects + ". For help please IM " + ownername + ".");
}
}
}

money(key giver, integer amount) {
integer amount2 = amount % price;
weeks = amount / price;
if (amount >= price * weeks && amount2 == 0 && rented == FALSE) {
llMessageLinked(LINK_SET, chan, "setdesc", (string) giver);
rentedweeks = amount / price;
string date = llGetTimestamp();
daterented = llGetSubString(date, 8, 9) + "/" + llGetSubString(date, 5, 6) + "/" + llGetSubString(date, 0, 3) + " | Time " + llGetSubString(date, 11, 15);
original_scale = llGetScale();
original_location = llGetLocalPos();
timerevent = 604800 * weeks;
llInstantMessage(giver, "Correct amount");
rentor = llKey2Name(giver);
rented = TRUE;
rentperiod = (string) weeks;
llInstantMessage(giver, "Prim limit is " + (string) objects + " prims.");
llInstantMessage(giver, "Keep prim limits or risk termination of agreement.Rent is non-refundable. IM " + ownername + " with questions.");
llInstantMessage(giver, "Thank you for renting this space . Thank You For Purchasing " + (string) weeks + " weeks . Feel Free To Put Your stuff in now");
llSetTexture("info", ALL_SIDES);
llSetPos(original_location + offset);
llSetScale(<0.236, 0.300, 0.236 >);
rentorkey = giver;
llSetTimerEvent(1);
if (splitwith !=[]) {
integer devide = llGetListLength(splitwith) + 1;
integer totatogive = amount / devide;
integer no;
while (no < llGetListLength(splitwith)) {
key dest = llList2Key(splitwith, no);
llGiveMoney(dest, totatogive);
llInstantMessage(dest, "you have bee payed L$" + (string) totatogive + " by " + llGetObjectName());
no++;
}
}
}
else if (rented == TRUE) {
if (llKey2Name(giver) == rentor && amount >= price * weeks && amount2 == 0) {
timerevent += (604800 * weeks);
llSay(0, "you have incresed your rental by " + (string) weeks + " weeks");
rentedweeks += weeks;
if (splitwith !=[]) {
integer devide = llGetListLength(splitwith) + 1;
integer totatogive = amount / devide;
integer no;
while (no < llGetListLength(splitwith)) {
key dest = llList2Key(splitwith, no);
llGiveMoney(dest, totatogive);
llInstantMessage(dest, "you have bee payed L$" + (string) totatogive + " by " + llGetObjectName());
no++;
}
}
}
else {
llGiveMoney(giver, amount);
llSay(0, "sorry please check rental");
}
}
else {
llInstantMessage(giver, "Minimum rental period is " + (string) weeks + " weeks, at $" + (string) (price * weeks) + ". If you have any questions, please feel free to IM" + ownername + ".");
llInstantMessage(giver, "Giving money back.");
llGiveMoney(giver, amount);
}
}
}
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum
Ody Naglo
Registered User
Join date: 1 Apr 2008
Posts: 31
10-13-2008 19:44
From: Jesse Barnett
Just out of curiosity, which editor are you using that inserts a blank line between every single line?



LSLEditor the one that guy suggested above =)


Ty for the help ill give it a try sorry about last time I had a really bad week =P
Jesse Barnett
500,000 scoville units
Join date: 21 May 2006
Posts: 4,160
10-13-2008 19:58
From: Ody Naglo
LSLEditor the one that guy suggested above =)


Ty for the help ill give it a try sorry about last time I had a really bad week =P

Hey those bad weeks happen every now and then. Actually I thrilled to see you back and still scripting. Sorry on our end too but we have people come in and try to get free scripts without doing any work themselves sometimes. Every once in a great while we miss one that is truly trying to understand a concept. Please keep coming back and learning!

You are assigning a random channel for randchannel which is good. Any way you have set chan in object description in a couple of them the same?
_____________________
I (who is a she not a he) reserve the right to exercise selective comprehension of the OP's question at anytime.
From: someone
I am still around, just no longer here. See you across the aisle. Hope LL burns in hell for archiving this forum