Jump to content

Script Help Please


Myles Harvy
 Share

You are about to reply to a thread that has been inactive for 3074 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

Hi All, 

I have a linkset box which opens on click, all works fine, front sides and top all open great. 

What i would like to do, is stop it from opening, i can do it with a llsleep line as below, but this will reset if sim restarts? So ideally i want to be able to set a date when it starts.

default
{
state_entry()
{
llSleep(50.0);
}

touch_start(integer total_number)
{
llMessageLinked(LINK_SET,999,"","");
}
}

I dont know a great deal about scripts so wouldnt know how to write the lines to getdate etc and was hoping someone maybe able to assist with this.  I was thinking it must be fairly simple to do. 

Any help would be greatfully received.

Link to comment
Share on other sites

Scripts do not normally restart when a region restarts, unless you have told them to with a changed event.

changed (integer Change){    if (Change & CHANGED_REGION_START)    {        llResetScript();    }}

I'm not sure exactly what you are trying to do.  That little script will simply wait for 50 seconds after it is reset.  During that time, you won't be able to click on it (or do anything else, actually.... llSleep does just what it says -- makes the script comatose).  Once that sleep period is over, your script will be clickable, so it will send its link message to whatever script is listening for it.  I'm not sure what that has to do with opening a box, or keeping it from opening, though, unless the touch trigger is your signal to open the box.

Normally, if you want something to happen at a specific time, you run a timer and check against a real clock every time the timer fires.  Your clock could be Unix time or a specific time of day, or the lapsed time since the script was restarted, or whatever.  In your case, Unix time might be best, since you really only seem to want it to toggle ON once, on a specific date.  Take a look at llGetUnixTime() in the LSL wiki. If you need to hire a scripter to write you something, post in the InWorld Employment forum.

 

 

Link to comment
Share on other sites

Yes the script is the trigger to start the other scripts to open the box, it opens the sides, front and lid simutaneouly and putting the sleep line in stops you clicking on it till it runs out. So it does acheive what i wanted, i need to have 25 boxes and allow each to open in turn each day, hence my thought on being able to set a date rather than calulating the time required to set the sleep function to, so each will become clickable in turn. So i will have to do llsleep(86400) on first and llsleep(2160000) on the last.  Which is why i was concerned with it resetting on a restart. Anyway thank you for your message i will take a look, if i cant work it out ill just use llsleep as this seams to be a simple way.

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 3074 days.

Please take a moment to consider if this thread is worth bumping.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share

×
×
  • Create New...