Bioware Archive
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
SMF - Just Installed!
Home
Help
Login
Register
Bioware Archive
»
Bioware Archive V2
»
Builders - Scripting
»
getting the real day and time
« previous
next »
Print
Pages: [
1
]
Author
Topic: getting the real day and time (Read 376 times)
Legacy_acomputerdood
Sr. Member
Posts: 378
Karma: +0/-0
getting the real day and time
«
on:
April 04, 2013, 12:05:46 pm »
my module restarts every 12 hours from a cronjob, and i want it to keep track if it's currently running in the AM or PM mode (and the day of the month). i'm using nwnx.
my ideas so far:
- have a way for the linix cronjob to pass a flag or variable that OnModuleLoad can read. i'm using nwnx, but i'm not aware of a function to do this. ideas?
- capture a "say" command from the console. is that even possible? nwnx_chat might be able to do it, no?
- use OnModuleLoad to call GetTimeHour to determine AM or PM. but i didn't see a function to get the real-life calendar day.
there has to be an easy way to do this, right? what am i missing here?
Logged
Legacy_acomputerdood
Sr. Member
Posts: 378
Karma: +0/-0
getting the real day and time
«
Reply #1 on:
April 04, 2013, 12:15:39 pm »
nwnx_funcs has GetTimeOfDay() which returns system time in seconds. again, that won't give me the day or month.
'>
Modifié par acomputerdood, 04 avril 2013 - 11:21 .
Logged
Legacy_acomputerdood
Sr. Member
Posts: 378
Karma: +0/-0
getting the real day and time
«
Reply #2 on:
April 04, 2013, 12:58:02 pm »
ahhh, this is a workable solution. nwnx_system has FileReadAll() which will read in the contents of a file from the system.
this way i can use my cronjob to set whatever string i want. much easier.
still curious about other solutions, though.
Logged
Legacy_CaveGnome
Sr. Member
Posts: 432
Karma: +0/-0
getting the real day and time
«
Reply #3 on:
April 04, 2013, 02:54:50 pm »
Hello,
Perhaps, if you don't mind atomic precision, you just can convert system time (or game time using the scale coefficient) seconds in hours, days, months, years and have an initial date & hour reference entered manually to fix the starting point init. But the FileReadAll() seems a better approach if you can grab directly the system time (disclaimer, i don't use nwnx).
Logged
Legacy_virusman
Sr. Member
Posts: 448
Karma: +0/-0
getting the real day and time
«
Reply #4 on:
April 04, 2013, 03:00:59 pm »
You can use SQL time functions if you're using NWNX database plugin.
Logged
Print
Pages: [
1
]
« previous
next »
Bioware Archive
»
Bioware Archive V2
»
Builders - Scripting
»
getting the real day and time