a quick script request...

Tuesday, August 3, 2004 by Latin4567 | Discussion: WinCustomize Talk

I am hoping that someone like martin or tiggz will read this....
i need a script for an object to change states 4 times:

first state: daytime

second state: Sunset

third state: Night-time

fourth state: Sunrise

if anyone can do this that would be great!

btw: Please go back to the desktopX Project forums, everyone has abbandoned them!
[Message Edited]
Kevin_C
Reply #1 Tuesday, August 3, 2004 9:48 AM
latin, this is relatively easy to do without much of a script at all. Are you wanting these state changes to occur when something is clicked, or based on a time frame, or perhaps some other criteria? Basically, you can setup 4 states in your DX object and then use a persistent variable to store the current state and have a timer with a function that checks the current state and changes to the next if necessary. If you provide a few more details as to what you are wanting to do and how you would like it to work it should be fairly easy to explain how to do it.
paxx
Reply #2 Tuesday, August 3, 2004 10:18 AM
The problem in your script is that sunset and sunrise is never at the same time, and to further the complexity also changes depending on where you are in the world.  The only way this could be done is if there is a web site somewhere that returns the exact time of the sunset and sunrise each day depending on your location. Then that info could be retrieved, then a simple timer could change the state depending on the time.
paxx
Reply #3 Tuesday, August 3, 2004 10:29 AM
OK, I found a site that returns the info: http://www.cavu.com/sunset.html  So I guess it shouldn't be too hard to make.  If I have time I might give it a shot some time if nobody else voluteers.
Tiggz
Reply #4 Tuesday, August 3, 2004 10:33 AM
sunrise and sunset times can be retrieved from weather.com - if you peek thru the dx object library you will find a few weather objects that display this info
Latin4567
Reply #5 Tuesday, August 3, 2004 11:52 AM
thanks guys, so can any of you do the script?
paxx
Reply #6 Tuesday, August 3, 2004 9:14 PM

K, I'm slowly working on it, except it's taking me a little while, i'm no expert on this. But it's a fun challenge.

A question though: The imae for sunset and sunrise obviously won't just be displayed for 1 minute. How long do you want the image showing? For 30 minutes after? If sunset is at 8:32 PM, you want that image showing until what time? 30 minutes would be 9:02 PM. How's that? Or 15 minutes?

paxx
Reply #7 Tuesday, August 3, 2004 9:18 PM

I found this info on another site :

Civil Twilight Start: 05:08
Sunrise:              05:41

Sunset:               20:19
Civil Twilight End:   20:52

I'm using weather.com for my script but it doesn't have the details this other site has. But weather.com makes it much easier though because of its XML feed.  Anyway, it seems sunrise starts about 30 BEFORE and sunset ends about 30 minutes after. I'll script it like that.

paxx
Reply #8 Wednesday, August 4, 2004 12:22 AM
K. You got mail, Latin.
Latin4567
Reply #9 Wednesday, August 4, 2004 9:39 AM
thanks!

Please login to comment and/or vote for this skin.

Welcome Guest! Please take the time to register with us.
There are many great features available to you once you register, including:

  • Richer content, access to many features that are disabled for guests like commenting on the forums and downloading skins.
  • Access to a great community, with a massive database of many, many areas of interest.
  • Access to contests & subscription offers like exclusive emails.
  • It's simple, and FREE!



web-wc01