Jump to content

CHIME SCRIPT


CyberSpyder Swords
 Share

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

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

Recommended Posts

Hello all and thank you for looking,

 

I have just recently started to build in SL and have been looking at scripts trying to see what i can learn.  I have built a really unique grandfather clock in world and it already has a clock script (not a pim script for each individual hand).  My question is this,  all i want to do is have the clock chime on each hour with the correct chimes per hour. I have the 12 sound files and i just need the script to sync with the owners time zone and chime accordingly.  Any help would be greatly appreciated.

 

Thanks

CyberSpyder Swords

Link to comment
Share on other sites

There are several very nice clock scripts in SL that have chimes as well.  Beverly Larkin wrote one a long time ago that has been modified by several people, including Ceera Murikami.  This forum really isn't the best place to come looking for a script, because we're really here as scripters to share ideas and help each other learn more skills. I can't find a link to Beverly/Ceera's script offhand, but if you do a deep search for it, I'm sure you can turn it up.  Start looking in the old library archives >>> http://community.secondlife.com/t5/LSL-Library/Tip-Don-t-forget-we-have-a-large-archived-Scripting-Library/td-p/700711 .

Link to comment
Share on other sites

Thanks for your reply,  i had looked over Ceera's clock script before and although it's very well thought out, it's not exactly what i'm looking for.  I just need thescript to get the owners local time, and chime on the hour with the 12 different sound files. It doesn't need to tell time or even be linked to the clock hands. I have found several clock scripts out there, but none that allow for different sounds specified by the hour of the day.

 

I will keep looking and reading and reverse engineering though to see what i can come up with.

 

Thanks Again

CyberSpyder Swords

Link to comment
Share on other sites

Thanks for your reply.  I did find Ceera's script and looked it over, but it's not exactly what i'm looking for. I just need a script to read the time and play a sound on the hour. It doesn't need to tell time, just play a specific sound at the right time. 

 

Thanks again

CyberSpyder Swords

Link to comment
Share on other sites

Oh, well, modifying Ceera's script to do just  that should be quite simple.  She already has the functions set to preload and then play the sound files.  All you have to do is specify a different one of your 12 sound files for each hour, triggered by the calculated hour.  The only mildly difficult part -- calculating the time correctly -- is already in the script. You can easily remove the few lines and the companion scripts that move the hands of the clock.

Link to comment
Share on other sites

In that case, I'd start by looking at the user function at http://wiki.secondlife.com/wiki/LlGetGMTclock

That turns the time into strings, but it shows you how to do the calculations to turn the GMT clock time into hours and minutes, allowing for local time zones, so you can adapt that reasonably simply, I think.

I would then have it calculate how long it is until the next top of the hour, and set a timer event to fire then.   In the timer event, I would check what o'clock it was, use that to set the initial value of integer oClock and then use that to look up in a list what sound to play, and play it.  

Then I'd move to state running, where I'd set a timer event for an hour hence in state entry.   Then just advance oClock by one every hour and play the right sound, resetting to 0 after midnight.

Link to comment
Share on other sites

ever looks at code you wrote and have no memory of writting it but instantly recognize it?

here's a little help for the OP

integer gIntHrs;default{    state_entry(){        llSetTimerEvent( 30.0 );    }        timer(){        if ((gIntHrs = (llGetUnixTime() % 86400) / 3600) != gIntHrs){            //-- hour changed        }    }}

 

Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 4842 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...