dana
New Member
Posts: 2
|
Hi
Mar 23, 2006 14:09:30 GMT -5
Post by dana on Mar 23, 2006 14:09:30 GMT -5
Hello everyone, I found my way here because I want to write some intelligent macros based on Time of Day and Day of Week. I know fxiiread is broken, but I think I can still do this reasonably well by polling the clock every so often. Just have to deal with clock spam in your chatlog. So, wish me luck! Dana
|
|
sdphantom
Full Member
Savior and Destroyer
Posts: 230
|
Hi
Mar 23, 2006 17:56:25 GMT -5
Post by sdphantom on Mar 23, 2006 17:56:25 GMT -5
Welcome.
As for getting clock information, you don't have to spam "/clock" to FFXI to get the time. The Lua core itself is independant of FFXI, it's just the FFXI libraries of Lunar (the addon) that's bust. Check out the Lua Documentation, the link for it is in my sig.
In the Lua core, os.time() gives you the system time in seconds since midnight, Jan 1st, 1970 GMT.
os.time(), when called with a time argurment, calculates the value given that local time. Called without arguements returns the current time in GMT.
Examples:
To get your GMT offset in seconds.os.time({year=1970,month=1,day=1,hour=0,min=0,sec=0})
To get the current GMT time (time of day in seconds).math.mod(os.time(),86400)
To get the current way of week (also based off GMT).math.floor(math.mod(os.time(),86400*7)/86400)
|
|
Sufo
New Member
Extreme Web Designer and Scripter
Posts: 48
|
Hi
Mar 23, 2006 18:22:04 GMT -5
Post by Sufo on Mar 23, 2006 18:22:04 GMT -5
hmmm i see sdphantom gave RL time for the game. but what i got from it is that maybe you want to get the in-game time?
|
|
sdphantom
Full Member
Savior and Destroyer
Posts: 230
|
Hi
Mar 23, 2006 18:41:50 GMT -5
Post by sdphantom on Mar 23, 2006 18:41:50 GMT -5
Game time is a little more involved in mathematics, but if you're interested in that instead, take a look through this thread.
|
|