nebula
Junior Member
fear.
Posts: 59
|
Post by nebula on Feb 1, 2006 20:55:32 GMT -5
you can actually run everything based on UTC with os.date, my script was jes a simple hack to get some ideas out and to stir up interest i haven't been able to do much with this in awhile, but its interesting to see that people are still tinkering with this, heh, by all means post modifications
|
|
sdphantom
Full Member
Savior and Destroyer
Posts: 230
|
Post by sdphantom on Feb 2, 2006 8:24:37 GMT -5
you can actually run everything based on UTC with os.date, my script was jes a simple hack to get some ideas out and to stir up interest i haven't been able to do much with this in awhile, but its interesting to see that people are still tinkering with this, heh, by all means post modifications Ya, I saw the origional JavaScript code for this a long time ago and immediately recognized it. Although the code I wrote is hardly a mere modification. I just took all the information I know about in-game time and built the code from scratch. I have alot of addons going in as different ideas, but I'm noticing that everything that I put in slows the script down somewhat. I'll probably split up the different sections into seperate scripts and make a launcher to load them.
|
|
sdphantom
Full Member
Savior and Destroyer
Posts: 230
|
Post by sdphantom on Feb 2, 2006 8:47:30 GMT -5
This is a stripped down version, but still should work.
textBox=Graphics.text_CreateObject() Graphics.text_SetColor(255,255,255,255,textBox) Graphics.text_SetFont("Arial Bold",8,textBox) Graphics.text_SetBold(true,textBox) Graphics.text_SetPosition(150,100,textBox)
-- Format Functions function formatDate(time) return string.format("%2d/%02d/%03d",math.mod(math.floor(time/(86400*30)),12)+1,math.mod(math.floor(time/86400),30)+1,math.floor(time/(86400*360))) end
function formatTime(time) return string.format("%2d:%02d:%02d",math.mod(math.floor(time/3600),24),math.mod(math.floor(time/60),60),math.mod(time,60)) end
-- Clock Functions function getWeekday() local days={"Firesday","Earthsday","Watersday","Windsday","Iceday","Lightningsday","Lightsday","Darksday"} return days[math.mod(math.floor(baseTime/86400),8)+1] end
offset=2312874000 baseTime=0 while string.lower(Windower.script_GetCommand())~="exit" do baseTime=os.time()*25+offset Graphics.text_SetText(getWeekday().." "..formatDate(baseTime).." "..formatTime(baseTime),textBox) end
Graphics.text_DeleteAll()
The offset varible is the origional offset calculated, you might want to -20 or -25 to offset for FFXI's GUI/Data lag.
I also removed the individual weekday offset varible that was just set to 0 anyway (no real use).
In the full script, the offset varible is dynamically calculated just once when the script starts from individual offsets for year, month, day, hour, minute, and second. I hope the hand calculation I did and wrote down in my programming notes is correct, lol. ^^;
<<Edit: fixed bug in the time calculation (os.clock() was used instead of os.time() -.-; )>>
|
|
sdphantom
Full Member
Savior and Destroyer
Posts: 230
|
Post by sdphantom on Feb 5, 2006 7:25:16 GMT -5
Here's a screenshot of a few scripts I made using my newly developed ClockLib library. ClockLib is just a series of functions written in Lua to be imported using the dofile() function. It doesn't quite show too well, but the Clock script changes color depending on the day of week and the Calendar script highlights both the current day and day of week as well. The image conversion to JPG dulled out the text, but it is certainly readable.. at least I think so, lol.
|
|
nebula
Junior Member
fear.
Posts: 59
|
Post by nebula on Feb 5, 2006 10:28:01 GMT -5
very neat
|
|
Onitaru
Junior Member
They call me Pope.
Posts: 62
|
Post by Onitaru on Feb 5, 2006 16:45:53 GMT -5
You forgot one thing Moon phase.
|
|
|
Post by phr33k on Feb 5, 2006 20:40:40 GMT -5
Hey shphantom can you please let us use your scripts
|
|
Onitaru
Junior Member
They call me Pope.
Posts: 62
|
Post by Onitaru on Feb 5, 2006 21:20:04 GMT -5
Yeah I'd love to use it but I wish it had the moon phase ; ;
|
|
sdphantom
Full Member
Savior and Destroyer
Posts: 230
|
Post by sdphantom on Feb 6, 2006 7:19:51 GMT -5
I just finnished the main code for these scripts and I didn't forget the moon phase. I just didn't get to it yet before my GF pulled me off to bed. The screenshot is a sample of what I've got up so far and it isn't really in release condition yet. There are a few bugs that need to be worked out and some modifications to optimize the code as well as a few more unfinnished scripts to add to the project. I'll probably get a release out with a control script as soon as I finnish both it and the moon phase script.
|
|
Onitaru
Junior Member
They call me Pope.
Posts: 62
|
Post by Onitaru on Feb 6, 2006 8:16:38 GMT -5
/cheer Oh maybe you should post about it on the windower froum when done. see if we can't get more people to use Lunar On the downside of that we have people bugging the hell out of Tiny so maybe it would be best to have them come here.....of there own free will.
|
|
sdphantom
Full Member
Savior and Destroyer
Posts: 230
|
Post by sdphantom on Feb 11, 2006 5:47:22 GMT -5
I noticed my scripts slowing down over time and made an internal FPS display for the ClockLib library for debug resons.
I also made a separate FPS script on its own to compare to. I made a weird discovery. As expected, the standalone FPS script reported to be faster than the ClockLib internal one, but to my suprise both scripts were slowing down over time.
Meanwhile I was debugging my calendar script (which uses 78 individual text objects >.<; ). It usually takes 10-20 secs to load and up to 1 min in laggy areas like Lower Jeuno. Anyway, after unloading and reloading about once every few mins for couple hours dropped my FPS rate (measured by my FPS script) from 60 to 30 in MH.
Unloading and reloading Lunar doesn't seem to fix this. I haven't run my FPS script alone while just sitting there, doing nothing for a couple hours. I might do that and post the results tomorrow.
|
|
sdphantom
Full Member
Savior and Destroyer
Posts: 230
|
Post by sdphantom on Feb 11, 2006 6:19:53 GMT -5
The moon phase script is done. Just remember that the percent is active, unlike in-game, where the FFXI client freezes the number and current phase when the day starts. Every other phase will change in mid-day at noon game time (a moon phase lasts exactly 10.5 game days).
I'm also working on airship timetables that'll go along with this set of scripts. We'll see how everything goes. The launcher is completed now and the existing scripts have been modified to accept initial positions from the launcher instead of piling up in one spot.
|
|
sdphantom
Full Member
Savior and Destroyer
Posts: 230
|
Post by sdphantom on Feb 11, 2006 7:01:48 GMT -5
The airship script isn't finnished yet, but I decided to publish ClockSuite anyway. I don't have any documentation as of yet to go with it. The 'exit' command to 'clocksuite.lua' would unload all the addon scripts. Just load 'clocksuite.lua' and it'll handle everything. Download HereHere's an updated screenshot (same URL as the old one) I would've cut the image smaller, but my moogle wanted to be included in the pic too. Lol, funny creature.
|
|
sdphantom
Full Member
Savior and Destroyer
Posts: 230
|
Post by sdphantom on Feb 11, 2006 16:05:44 GMT -5
There's a bug in ClockLib that I'm trying to work out. The bug doesn't affect any of the released scripts, but it's giving me some trouble with my airship timer script that I'm currently writing.
When I get the bug fixed and the airship timer finnished, there will be a new version of ClockLib included in the release.
|
|
sdphantom
Full Member
Savior and Destroyer
Posts: 230
|
Post by sdphantom on Feb 22, 2006 4:49:48 GMT -5
The Feb 20th update has pushed this project forward once again.
I have a working airship script to go into ClockSuite. I'm trying to figure a way to compensate for client lag as well. The airships are supposed to depart on the 10th and 40th minute marks. I've actually sat in Jeuno and watched the airships arrive and depart for several hours to find that GFX lag does mess up the times a bit. I decided to put in some code to hopefully compensate for that.
On another note, the buggy function in ClockLib. Currently the bug only shows up when using the offset arguement of the getIntervalStart() function. None of the scripts use the offset argurment, but I left it in there as an idea to hopefully start working on again later.. if I ever come up of a new formula to get it to work right.
|
|