Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 09-19-2011, 02:57 PM
jamitsu89 jamitsu89 is offline
Registered User
Join Date: Jun 2011
Posts: 27
jamitsu89 is an unknown quantity at this point
Accessing Date/Time of Computer Clock.

Is there a way to access the current Date and Time of one's computer clock? I'm looking to incorporate a date and time along with an email when it's sent inside AEON's email system.

Of course I could create a server clock that works on a timezone, and allow players to select their own timezone and have it convert etc, but that's more work than is necessary (particularly as I don't know a lot of timezones).

Many thanks in advance.
Reply With Quote
  #2  
Old 09-19-2011, 04:30 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Not really, on Mac/Linux you can use timevar2 to calculate it but you should be using a server-side clock though. Otherwise players could just set their clock to a time in the past and send emails from 1980 or something wild like that.
__________________
Quote:
Reply With Quote
  #3  
Old 09-19-2011, 10:12 PM
jamitsu89 jamitsu89 is offline
Registered User
Join Date: Jun 2011
Posts: 27
jamitsu89 is an unknown quantity at this point
In response to the 1980 thing, I was going to send along the value of timevar2 then when they receive the email, check their clock time and the current value of timevar2, and simply subtract until it is correct. That way the player sending the email would say it has been sent from 1980 (until they change their clock back), but the player receiving would have it state the correct time it was sent, as per their own computer clock.

But since there's not a way to access said clock I guess I'll just use a server-side clock. Thanks buddy.
Reply With Quote
  #4  
Old 09-20-2011, 02:05 PM
oralgnome oralgnome is offline
doesnt afraid of anything
oralgnome's Avatar
Join Date: Sep 2011
Posts: 34
oralgnome is an unknown quantity at this point
timevar is clientside

edit: timevar2 executed clientside
__________________
Quote:
Originally Posted by CaySedaiSim View Post
Is there a GS2 for retards book..?

Last edited by oralgnome; 09-20-2011 at 11:40 PM..
Reply With Quote
  #5  
Old 09-20-2011, 02:11 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by oralgnome View Post
timevar is clientside
timevar is synchronised between serverside and clientside.
__________________
Reply With Quote
  #6  
Old 09-20-2011, 11:40 PM
oralgnome oralgnome is offline
doesnt afraid of anything
oralgnome's Avatar
Join Date: Sep 2011
Posts: 34
oralgnome is an unknown quantity at this point
Quote:
Originally Posted by Crow View Post
timevar is synchronised between serverside and clientside.
actually I was thinking of the wrong timevar, timevar2 executed clientside retrieves the unix time of your system

timevar increments at like 5 seconds per tick sry
__________________
Quote:
Originally Posted by CaySedaiSim View Post
Is there a GS2 for retards book..?
Reply With Quote
  #7  
Old 09-20-2011, 11:46 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by oralgnome View Post
timevar2 executed clientside retrieves the unix time of your system
Not on Windows.
__________________
Reply With Quote
  #8  
Old 09-21-2011, 12:45 AM
gaben gaben is offline
uhh no
gaben's Avatar
Join Date: Aug 2011
Posts: 47
gaben is an unknown quantity at this point
Quote:
Originally Posted by Crow View Post
Not on Windows.
It works fine on Windows.
__________________
Quote:
Originally Posted by iBeatz View Post
Who came up with this Cheat Engine? The more I read about, the more ingenious the whole thing sounds.
Quote:
Originally Posted by Unixmad
This forums is going worst each day.
Quote:
Originally Posted by ff7chocoboknight View Post
You sure are taking your time leaving, furry.
Quote:
Originally Posted by [email protected] View Post
are u old enough 2 even play Graal little girl???
Reply With Quote
  #9  
Old 09-21-2011, 12:51 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by gaben View Post
It works fine on Windows.
No, it doesn't. On Windows it's the number of seconds since the Graal client has been opened. On Linux and Mac it's the Unix epoch value (same as serverside, but based on the local clock).
__________________
Reply With Quote
  #10  
Old 09-21-2011, 02:06 AM
gaben gaben is offline
uhh no
gaben's Avatar
Join Date: Aug 2011
Posts: 47
gaben is an unknown quantity at this point
Quote:
Originally Posted by cbk1994 View Post
No, it doesn't. On Windows it's the number of seconds since the Graal client has been opened. On Linux and Mac it's the Unix epoch value (same as serverside, but based on the local clock).
Eh, I doubt that but whatever. It takes a real man to admit he's wrong.
__________________
Quote:
Originally Posted by iBeatz View Post
Who came up with this Cheat Engine? The more I read about, the more ingenious the whole thing sounds.
Quote:
Originally Posted by Unixmad
This forums is going worst each day.
Quote:
Originally Posted by ff7chocoboknight View Post
You sure are taking your time leaving, furry.
Quote:
Originally Posted by [email protected] View Post
are u old enough 2 even play Graal little girl???
Reply With Quote
  #11  
Old 09-21-2011, 09:22 AM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by gaben View Post
Eh, I doubt that but whatever. It takes a real man to admit he's wrong.
Man up.
__________________
Reply With Quote
  #12  
Old 09-21-2011, 01:57 PM
furry_mougle furry_mougle is offline
big heart
furry_mougle's Avatar
Join Date: Aug 2011
Posts: 42
furry_mougle is an unknown quantity at this point
Quote:
Originally Posted by Crow View Post
Man up.
I just tested his theory, and sure enough it outputted around 8k seconds which is the accurate time since my computer booted (not Graal).

NO YOU!
__________________
Quote:
Originally Posted by ffcmike View Post
But make sure to change beer.png to Orange Juice.
pay bills to play graal
Reply With Quote
  #13  
Old 09-21-2011, 06:12 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by furry_mougle View Post
I just tested his theory, and sure enough it outputted around 8k seconds which is the accurate time since my computer booted (not Graal).

NO YOU!
I've made some experiments myself several times. I still don't know what it depends on, but on my old XP machine it either showed the seconds since Graal was started (and some more, I'm not sure where it got those extra seconds) or the seconds since the OS booted. It was completely random. On my current machine (7) it seems to always show the seconds since the PC booted.

It didn't really matter though. Given the fact that it's different from the way it works on Linux/Mac it's useless for time/date calculations. Still useful for any delta time stuff though, and that's what it's mostly used for I guess.
__________________
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 05:12 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.