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 11-03-2005, 03:35 AM
Yen Yen is offline
Banned
Yen's Avatar
Join Date: Oct 2005
Location: Nova Scotia, Canada
Posts: 1,085
Yen is an unknown quantity at this point
Send a message via AIM to Yen Send a message via MSN to Yen
Timestamp

I'm on the bug again..

Is there any function that gives you the current date/time?
I think I've seen one used before.. I've attempted to use timevar2 to find the date/time, but it seems to be off. According to the value it was returning, it's only been 10 days. O_o

If there isn't a function, could one be added?
Reply With Quote
  #2  
Old 11-03-2005, 03:38 AM
ZeLpH_MyStiK ZeLpH_MyStiK is offline
Scripter
ZeLpH_MyStiK's Avatar
Join Date: May 2003
Location: NYC
Posts: 553
ZeLpH_MyStiK is on a distinguished road
Send a message via MSN to ZeLpH_MyStiK Send a message via Yahoo to ZeLpH_MyStiK
Quote:
Originally Posted by Yen
I'm on the bug again..

Is there any function that gives you the current date/time?
I think I've seen one used before.. I've attempted to use timevar2 to find the date/time, but it seems to be off. According to the value it was returning, it's only been 10 days. O_o

If there isn't a function, could one be added?
timevar2 can be used to give you the exact time and date. I've scripted one for #gscript, and it worked perfectly well.
__________________
Reply With Quote
  #3  
Old 11-03-2005, 03:40 AM
Yen Yen is offline
Banned
Yen's Avatar
Join Date: Oct 2005
Location: Nova Scotia, Canada
Posts: 1,085
Yen is an unknown quantity at this point
Send a message via AIM to Yen Send a message via MSN to Yen
minutes = timevar2 / 60;
hours = minutes / 60;
days = hours / 24;

Neh?
Reply With Quote
  #4  
Old 11-03-2005, 04:33 AM
Polo Polo is offline
Classic Systems Admin
Join Date: Sep 2002
Location: Vancouver, Canada
Posts: 735
Polo is on a distinguished road
Send a message via AIM to Polo
Quote:
Originally Posted by Yen
I've attempted to use timevar2 to find the date/time, but it seems to be off. According to the value it was returning, it's only been 10 days. O_o
On serverside, timevar2 is unixtime, on clientside, its the time in seconds since the computer was switched on. Could this be the source of your problem?
__________________
Be good little players, or Master Storm will ban you!



Proof that the staff are crazy..
*Ghost Pirate: I'm a little teacup short and stubbe here is my raygun here is my butt
DragonX: Jumping jack rabbits Batman! Our eggo waffles have been stolen! To the batmobile Robin!
X-Mann (RC): I have a head ache
Reply With Quote
  #5  
Old 11-03-2005, 04:36 AM
Yen Yen is offline
Banned
Yen's Avatar
Join Date: Oct 2005
Location: Nova Scotia, Canada
Posts: 1,085
Yen is an unknown quantity at this point
Send a message via AIM to Yen Send a message via MSN to Yen
It's giving me the same thing on both client and serverside..

EDIT: Nevermind. For some odd reason, I had two //#CLIENTSIDE lines.. O-o
Thanks.


But it'd still be nice to be able to read from your computer's clock to get the date/time.
Reply With Quote
  #6  
Old 11-03-2005, 04:47 AM
Polo Polo is offline
Classic Systems Admin
Join Date: Sep 2002
Location: Vancouver, Canada
Posts: 735
Polo is on a distinguished road
Send a message via AIM to Polo
Well what you can do is set the unix time from serverside in a clientr. variable, then interpret that on clientside to adjust the clientside timevar2 to unixtime (by taking the difference, then summing it back on when doing timestamps). It'll be out be a few seconds due to lag, but should be ok.

If your using the timestamps for some kind of secure thing though, you should probably be doing it all on serverside.
__________________
Be good little players, or Master Storm will ban you!



Proof that the staff are crazy..
*Ghost Pirate: I'm a little teacup short and stubbe here is my raygun here is my butt
DragonX: Jumping jack rabbits Batman! Our eggo waffles have been stolen! To the batmobile Robin!
X-Mann (RC): I have a head ache
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 06:05 PM.


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