So, I created a Reverse Camping Chair.
It is just like a normal camping chair, except you pay it for the privilege of sitting there. You see, after a certain amount of time the chair unsits you and tells you to pay up! It accepts money. The more you pay, the longer you can sit or continue to sit. The first 2 units of time are free. If you stand up before you balance has ticked down to 0, the balance is lost.
Someone interacting with this chair is supposed to go like this:
Camping chair hovertext says "L$2 for 1 minute".
Person: Ooo a camping chair! money money money
Person Sits on it. Camping chair hovertext says "Money:2".
Person: Ooo yeah 2L already!
60 Seconds pass.
Reverse Camping Chair: Get off!
Reverse Camping Chair: Deposit L$2 to continue using this chair.
Person: *whimper*
Based on /15/60/75612/1.html
Place root prim of chair. Adjust sitTarget to match the kind of seat, but be careful not to set the offset field to <0,0,0>.
It's not the best design. I tried to whip it up as quickly as possible. Improvements can be made that reduce code repetition.
integer initCampMoney = 2;
integer campmoney = 2;
integer campsubtract = 2;
integer camptime = 60;
string reciever;
vector offset = <0.0, 0.0, 0.1>;
rotation rot = <0.0, 0.0, 0.0, 0.0>;
default {
state_entry() {
llSetText("\nL$"+(string)campsubtract+" for 1 minute",<0,1,0>,1);
llSitTarget(offset,rot);
llSetPayPrice(PAY_HIDE, [campsubtract, campsubtract*2, campsubtract*4, campsubtract*8]);
}
changed(integer change) { // something changed
if (change & CHANGED_LINK) { // and it was a link change
llSleep(0.5); // llUnSit works better with this delay
if (llAvatarOnSitTarget() != NULL_KEY) { // somebody is sitting on me
reciever = llAvatarOnSitTarget();
llSetText("Money:"+(string)campmoney,<0,1,0>,1);
if (campmoney <= 0) {
//balance below zero. get out!
llSay(0, "Get off!"
;
llUnSit(llAvatarOnSitTarget()); // unsit him
} else {
llSetTimerEvent(camptime);
}
} else {;
reciever="";
campmoney=initCampMoney;
llSetText("L$"+(string)campsubtract+" for 1 minute",<0,1,0>,1);
llSetTimerEvent(0);
}
}
}
money(key id, integer amount)
{
campmoney = campmoney + amount;
llSetText("Money:"+(string)campmoney,<0,1,0>,1);
}
timer() {
campmoney = campmoney-campsubtract;
llSetText("Money:"+(string)campmoney,<0,1,0>,1);
llSleep(0.5); // llUnSit works better with this delay
if (llAvatarOnSitTarget() != NULL_KEY) {
if (campmoney <= 0) {
//balance below zero. get out!
llSay(0, "Get off!"
;
llUnSit(llAvatarOnSitTarget()); // unsit him
llSay(0,"Deposit L$"+(string)campsubtract+" to continue using this chair."
;
}
} else {
reciever="";
campmoney=initCampMoney;
llSetText("L$"+(string)campsubtract+" for 1 minute",<0,1,0>,1);
llSetTimerEvent(0);
}
}
}
integer campmoney = 2;
integer campsubtract = 2;
integer camptime = 60;
string reciever;
vector offset = <0.0, 0.0, 0.1>;
rotation rot = <0.0, 0.0, 0.0, 0.0>;
default {
state_entry() {
llSetText("\nL$"+(string)campsubtract+" for 1 minute",<0,1,0>,1);
llSitTarget(offset,rot);
llSetPayPrice(PAY_HIDE, [campsubtract, campsubtract*2, campsubtract*4, campsubtract*8]);
}
changed(integer change) { // something changed
if (change & CHANGED_LINK) { // and it was a link change
llSleep(0.5); // llUnSit works better with this delay
if (llAvatarOnSitTarget() != NULL_KEY) { // somebody is sitting on me
reciever = llAvatarOnSitTarget();
llSetText("Money:"+(string)campmoney,<0,1,0>,1);
if (campmoney <= 0) {
//balance below zero. get out!
llSay(0, "Get off!"
;llUnSit(llAvatarOnSitTarget()); // unsit him
} else {
llSetTimerEvent(camptime);
}
} else {;
reciever="";
campmoney=initCampMoney;
llSetText("L$"+(string)campsubtract+" for 1 minute",<0,1,0>,1);
llSetTimerEvent(0);
}
}
}
money(key id, integer amount)
{
campmoney = campmoney + amount;
llSetText("Money:"+(string)campmoney,<0,1,0>,1);
}
timer() {
campmoney = campmoney-campsubtract;
llSetText("Money:"+(string)campmoney,<0,1,0>,1);
llSleep(0.5); // llUnSit works better with this delay
if (llAvatarOnSitTarget() != NULL_KEY) {
if (campmoney <= 0) {
//balance below zero. get out!
llSay(0, "Get off!"
;llUnSit(llAvatarOnSitTarget()); // unsit him
llSay(0,"Deposit L$"+(string)campsubtract+" to continue using this chair."
;}
} else {
reciever="";
campmoney=initCampMoney;
llSetText("L$"+(string)campsubtract+" for 1 minute",<0,1,0>,1);
llSetTimerEvent(0);
}
}
}
but it will not deter Bots alas.