Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 23rd, 2024, 8:31 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Simple Script , but i need help Please
PostPosted: December 22nd, 2007, 1:47 pm 
Offline

Joined: February 12th, 2005, 5:27 pm
Posts: 177
Location: Canada
Opus: Pro
OS: Win7
Merry Christmas All

I have created a simple clock displaying the UTC hours , now the problem is that if you leave the clock open , it doesn't roll over when the hour changes . I can't seem to find a refrsh script OR some way to refresh the UTC HOURS .

Can any one steer my head around this simple mistake i am making


Al

I attached the imp


You do not have the required permissions to view the files attached to this post.

_________________
-------------------------------------------------------
Win7 AMD +5000 Dual Core with 4 gig ram Geforce 9600 OPUS V7.05 Novice to Scripts/willing to learn , Mp3 Files must be 128kb


Last edited by Al Barnes on December 22nd, 2007, 8:31 pm, edited 1 time in total.

Top
 Profile Visit website  
 
 Post subject:
PostPosted: December 22nd, 2007, 4:47 pm 
Offline

Joined: November 25th, 2004, 1:24 pm
Posts: 512
Location: Scotland
Opus: 9.75
OS: Win 10
System: Asus i7-7700K 16Gb
currHour = myDate.getUTCHours()

gets the current hour only when it is called in a script, but isn't updated, so you need to keep 'getting' the hour.


Sandy

_________________
Whoever designed this, never actually used it!


Top
 Profile  
 
 Post subject:
PostPosted: December 22nd, 2007, 8:31 pm 
Offline

Joined: February 12th, 2005, 5:27 pm
Posts: 177
Location: Canada
Opus: Pro
OS: Win7
sandyn wrote:
currHour = myDate.getUTCHours()

gets the current hour only when it is called in a script, but isn't updated, so you need to keep 'getting' the hour.


Sandy



So how do you keep getting the currect hour ?? is there a refresh script OR some way to creat a timed loop

Al

_________________
-------------------------------------------------------
Win7 AMD +5000 Dual Core with 4 gig ram Geforce 9600 OPUS V7.05 Novice to Scripts/willing to learn , Mp3 Files must be 128kb


Top
 Profile Visit website  
 
 Post subject:
PostPosted: December 22nd, 2007, 8:56 pm 
Offline

Joined: November 25th, 2004, 1:24 pm
Posts: 512
Location: Scotland
Opus: 9.75
OS: Win 10
System: Asus i7-7700K 16Gb
why not just use the SYSTEM_TIME_HOUR........MINUTE.......SECOND or the 12HOUR format. Insert the variables into a text box and they are automatically updated

Sandy

_________________
Whoever designed this, never actually used it!


Top
 Profile  
 
 Post subject:
PostPosted: December 22nd, 2007, 11:41 pm 
Offline

Joined: February 12th, 2005, 5:27 pm
Posts: 177
Location: Canada
Opus: Pro
OS: Win7
sandyn wrote:
why not just use the SYSTEM_TIME_HOUR........MINUTE.......SECOND or the 12HOUR format. Insert the variables into a text box and they are automatically updated

Sandy


Hi Sandy ,

The reason for this is I play in a group of online gamers from all over the world and we use UTC Time as our clock that way we are always in time with each other.....

Al

_________________
-------------------------------------------------------
Win7 AMD +5000 Dual Core with 4 gig ram Geforce 9600 OPUS V7.05 Novice to Scripts/willing to learn , Mp3 Files must be 128kb


Top
 Profile Visit website  
 
 Post subject:
PostPosted: December 23rd, 2007, 12:00 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Al

As a workaround, you could Calc the difference between the UTC hour and SYS clock hour once. Then just run a clock that is SYS TIME plus or minus the offset.

Curious. Is this an Opus game? Are you having the players operate off of a common database?

_________________
_good things come to those who wait(0)_


Top
 Profile  
 
 Post subject:
PostPosted: December 23rd, 2007, 12:48 am 
Offline

Joined: November 25th, 2004, 1:24 pm
Posts: 512
Location: Scotland
Opus: 9.75
OS: Win 10
System: Asus i7-7700K 16Gb
I was going to say just add "currHour = myDate.getUTCHours()" to a ticker, but you could also add a little script using the SYSTEM_TIME_MINUTE and SYSTEM_TIME_SECOND, when they are at 59 59, you wait a couple of seconds then do another getUTCHours.
There will be other ways as well :-)



Sandy

_________________
Whoever designed this, never actually used it!


Top
 Profile  
 
 Post subject:
PostPosted: December 23rd, 2007, 4:36 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Al,

Had a chance to look at this. It seems that's either the 'nature' of the Date functions or it's a bug.

The same 'frozen' effect applies to the other intervals. The 'get' aspect seems to be a snapshot, yet the rest of the time value 'runs'. :?:

Quote:
var myDate = new Date()
currHour = myDate.getUTCSeconds() // temporary test to see the change (No change) sooner


might have to build a loop or use a 'while'. Or other suggested triggers/update approaches.

_________________
_good things come to those who wait(0)_


Top
 Profile  
 
 Post subject: Hi Sandy and Lars
PostPosted: December 23rd, 2007, 1:17 pm 
Offline

Joined: February 12th, 2005, 5:27 pm
Posts: 177
Location: Canada
Opus: Pro
OS: Win7
Hi Sandy and Lar

Thanks for your time,

Sandy i tried to set up a ticker but for some reason it would not reset the time . Lar the reason the other minutes and seconds keep going is becuase I used System_Time_Minute Vars . The Gte_UTC Var seems to only get a 1 time conversion of the hours .....


What i need to do is find out the difference between UTC and my hours and maybe just use System_time +5hr to offset the clock and keep it going , but i have to see if UTC time is offset by X-hours for eveyone LOL .

2 Solution would be to just make a rollover spot to display time and that way it would recal the UTC script for every showing . This would be simple but not really professional for us OPUS guys ( smile )

Merry Christmas guys

_________________
-------------------------------------------------------
Win7 AMD +5000 Dual Core with 4 gig ram Geforce 9600 OPUS V7.05 Novice to Scripts/willing to learn , Mp3 Files must be 128kb


Top
 Profile Visit website  
 
 Post subject:
PostPosted: December 24th, 2007, 1:36 am 
Offline

Joined: November 25th, 2004, 1:24 pm
Posts: 512
Location: Scotland
Opus: 9.75
OS: Win 10
System: Asus i7-7700K 16Gb
The ticker should work---create the clock when the page shows, then add a ticker to repeatedly get the UTC hour. I checked it out and it works fine.
You can also check for a variable change....another way, but I seem to remember that may not work as expected for some system variables.

I believe UTC is just another name for GMT so you are probably 5 hours behind us.....but if only it were as simple as adding 5 hours :-).
So the trick is, in script--if your local hour is less than 8, you add 5 hours, but if it's equal to or greater than 8, you subtract 7. That will give UTC in 12 hour format....
for 24 hour format:- we don't use 24:01...it becomes 00:01, but in the 12 hour format, we use 12:01 (twice)
so if local hour is less than 20, add 5. if greater or equal to 20, subtract 19. That takes care of 00:00, since it's less than 20

It'salso good to have a wee script for hours and minutes less than 10, so it displays 01 02 03 rather than 1 2 3

if(MySecs<10)
{
MySecs=("0"+MySecs)
}


so that's where the GetUTCHours() is very useful--saves all the script.

another non script way is to just change the clock on your PC while playing :-)


Sandy

_________________
Whoever designed this, never actually used it!


Top
 Profile  
 
 Post subject:
PostPosted: December 24th, 2007, 1:59 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Quote:
find out the difference between UTC and my hours


I believe I saw an Opus script function for that. Look for "...timeoffset". Don't know how you'd add that to the live sys clock.

For calcs, check out these 'generic' javascript sites. Syntax may not fit, but ideas may help.
http://www.adobe.com/livedocs/flex/2/langref/Date.html
http://tinyurl.com/38o2g8 (goes to www.allgraphicdesign.com/webdesign/)

_________________
_good things come to those who wait(0)_


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 39 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group