Touch Rental Boxes

Creating scripts
Post Reply
User avatar
Roswenthe Blackwell
Posts: 163
Joined: Sat Mar 29, 2014 10:14 pm
Has thanked: 76 times
Been thanked: 158 times

Touch Rental Boxes

Post by Roswenthe Blackwell »

Constance Peregrine wrote:This modifiable set of 2 scripts are for those who wish to keep track of their residents by requiring the box to be clicked on a set time frame...ex: if they do not then you can consider them no longer interested enough and go from there.

rentbox1

Code: Select all

key kRenter;
default
{
  state_entry()
  {
    kRenter=NULL_KEY;
    llSetColor(<0,1,0>,ALL_SIDES);
    llSetText("Touch to rent this spot!",<1,1,1>,1);
  }
  touch_start(integer foo)
  {
    if(kRenter == NULL_KEY)
    {
      kRenter=llDetectedKey(0);
      llSetText("",<1,1,1>,1);
      llWhisper(0,"thx for the renting!");
      llSetColor(<1,0,0>,ALL_SIDES);
    }
    else if(kRenter == llDetectedKey(0))
    {
      kRenter=NULL_KEY;
      llWhisper(0,"Awww I love you bye bye D:");
      llSetColor(<0,1,0>,ALL_SIDES);
      llSetText("Touch to rent this spot!",<1,1,1>,1);
    }
    else
    {
      llSetTimerEvent(5);
      llSetText("Rented by: "+llKey2Name(kRenter),<1,1,1>,1);
    }
  }
  timer()
  {
    llSetTimerEvent(0);
    llSetText("",<1,1,1>,1);
  }
}

rentbox2

Code: Select all

string getFirstName(string name)
{
  return llGetSubString(name, 0, llSubStringIndex(name, " ") - 1);
}

default
{
  touch_start(integer num_detected)
  {
    llSetText(getFirstName(llDetectedName(0)), <1,1,1>, 1);  // 
  }
}


I am trying to use the touch-to-rent rental box scripts posted in the scripts library thread, but I have to admit I'm terrible at scripting. Mainly, what I am trying to figure out is how to set the time limit. I gather that the second script doesn't handle that at all, so I was playing with the first script, but the setTimerEvent didn't seem to do anything.

How can I set a time limit to touch and renew the rental?
User avatar
Constance Peregrine
Posts: 2349
Joined: Sun Dec 23, 2012 11:35 am
Has thanked: 2778 times
Been thanked: 1482 times

Re: Touch Rental Boxes

Post by Constance Peregrine »

it is possible this one no longer works in the current OS...hopefully ppl who actually know what they are talking about will comment-)) [but since I had posted it originally]

it might just need a little tweaking also
Laissez faire et laissez passer, le monde va de lui même!
My little sounds store https://www.kitely.com/market?store=2040306

Ephemeral wanderer...
User avatar
Carlos Loff
Posts: 280
Joined: Sat Dec 28, 2013 8:58 pm
Location: Lisbon - Portugal
Has thanked: 263 times
Been thanked: 191 times
Contact:

Re: Touch Rental Boxes

Post by Carlos Loff »

PRECIOUS PRECIOUS PRECIOUS FOR MEEE - THANKSSSSSSSSSSSSS - I Love Kitely and I Love You, cheers
These users thanked the author Carlos Loff for the post:
Constance Peregrine
Kitely - Meta Lisbon --> grid.kitely.com:8002:Meta Lisbon Startups
Join Me on Meetup --> https://www.meetup.com/metalisbonstartups/
Join Kitely Group --> Meta Lisbon Startups
User avatar
Roswenthe Blackwell
Posts: 163
Joined: Sat Mar 29, 2014 10:14 pm
Has thanked: 76 times
Been thanked: 158 times

Re: Touch Rental Boxes

Post by Roswenthe Blackwell »

Carlos Loff wrote:PRECIOUS PRECIOUS PRECIOUS FOR MEEE - THANKSSSSSSSSSSSSS - I Love Kitely and I Love You, cheers
So you know, they don't completely work, and they're not for payment, though I'm sure someone smart enough could fix that. I really am not looking for payment boxes, but a time limit would be helpful.
User avatar
Constance Peregrine
Posts: 2349
Joined: Sun Dec 23, 2012 11:35 am
Has thanked: 2778 times
Been thanked: 1482 times

Re: Touch Rental Boxes

Post by Constance Peregrine »

I don't know scripting other than some little mods, sometimes, can the number in this be changed for other periods of time?

llSetTimerEvent(5);
Laissez faire et laissez passer, le monde va de lui même!
My little sounds store https://www.kitely.com/market?store=2040306

Ephemeral wanderer...
User avatar
Roswenthe Blackwell
Posts: 163
Joined: Sat Mar 29, 2014 10:14 pm
Has thanked: 76 times
Been thanked: 158 times

Re: Touch Rental Boxes

Post by Roswenthe Blackwell »

Constance Peregrine wrote:I don't know scripting other than some little mods, sometimes, can the number in this be changed for other periods of time?

llSetTimerEvent(5);
Yeah, I tried that, and it didn't seem to make any difference. The number should be minutes, at least according to what I looked up. Though in SL they used 0.0. Maybe it's days, I dunno. I wish I understood more about scripting.
These users thanked the author Roswenthe Blackwell for the post:
Constance Peregrine
User avatar
Roswenthe Blackwell
Posts: 163
Joined: Sat Mar 29, 2014 10:14 pm
Has thanked: 76 times
Been thanked: 158 times

Re: Touch Rental Boxes

Post by Roswenthe Blackwell »

Roswenthe Blackwell wrote:
Constance Peregrine wrote:I don't know scripting other than some little mods, sometimes, can the number in this be changed for other periods of time?

llSetTimerEvent(5);
Yeah, I tried that, and it didn't seem to make any difference. The number should be minutes, at least according to what I looked up. Though in SL they used 0.0. Maybe it's days, I dunno. I wish I understood more about scripting.
Oh wait, it did work. I set it to 0.4 (with the advice of this LSL Wiki page): and it reset after a minute. So it does work, I just must have had it too high.

Next I'm going to see if I can input a time left line so it shows on the box.
These users thanked the author Roswenthe Blackwell for the post:
Constance Peregrine
User avatar
Roswenthe Blackwell
Posts: 163
Joined: Sat Mar 29, 2014 10:14 pm
Has thanked: 76 times
Been thanked: 158 times

Re: Touch Rental Boxes

Post by Roswenthe Blackwell »

I found a payment rental script that works just fine, though it doesn't quite work as a free rental system.

http://wiki.secondlife.com/wiki/Rental_Cube
These users thanked the author Roswenthe Blackwell for the post (total 2):
Constance PeregrineCarlos Loff
User avatar
Carlos Loff
Posts: 280
Joined: Sat Dec 28, 2013 8:58 pm
Location: Lisbon - Portugal
Has thanked: 263 times
Been thanked: 191 times
Contact:

Re: Touch Rental Boxes

Post by Carlos Loff »

Roswenthe Blackwell wrote:I found a payment rental script that works just fine, though it doesn't quite work as a free rental system.

http://wiki.secondlife.com/wiki/Rental_Cube
I have normal SL payment rental boxes that work on Kitely, reach me Inworld if you want a copy, but the problem is that they don't acknowledge and don't catchup with time lapses when regions are down (non visited) so tenants get loads more time on the countdown than actually remains

Anyway, having many rental boxes on a same area contributes to Lag so your scripts seams better because it will not be used for payment but for renew control - That feature where people must touch to renew works great for me and scripts that work only by touch are not permanent so no Lag

Im going to offer free small homes at my 16 world but I need to be sure people keep using them because they really need them and just don't take them on the beginning and never show-up again, preventing the ones that really need them to start using those homes

So that wonderful touch-renew feature is great and whoever does not show for a hole week looses the free home for the next needy one
Kitely - Meta Lisbon --> grid.kitely.com:8002:Meta Lisbon Startups
Join Me on Meetup --> https://www.meetup.com/metalisbonstartups/
Join Kitely Group --> Meta Lisbon Startups
Post Reply