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?
getting the real day and time
Débuté par
acomputerdood
, avril 04 2013 11:05
#1
Posté 04 avril 2013 - 11:05
#2
Posté 04 avril 2013 - 11:15
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 .
#3
Posté 04 avril 2013 - 11:58
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.
this way i can use my cronjob to set whatever string i want. much easier.
still curious about other solutions, though.
#4
Posté 04 avril 2013 - 01:54
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).
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).
#5
Posté 04 avril 2013 - 02:00
You can use SQL time functions if you're using NWNX database plugin.





Retour en haut






