Jump to content
The simFlight Network Forums

flynryan692

new Members
  • Posts

    1
  • Joined

  • Last visited

Profile Information

  • Gender
    Male
  • Location
    USA

flynryan692's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. I'm trying to make a lua script that checks the FSX time against the current UTC time and then sets the FSX time to the real UTC time if it isn't already there. So, for example, if I load the default flight and set the time to "dusk" and that UTC time is not accurate, it will update the time to the current UTC time. This is the first time I have ever touched LUA, so I don't know what I am doing. The only programming I have done is in PHP. I came up with this after some googling, but it isn't working, so I am trying to figure out what I am doing wrong. Any help is appreciated! -- FSX UTC Time Synch -- Novbember 2015 -- V 1.0 -- ## Sets FSX Time to UTC ############### while 1 do simHour = ipc.readUB("023B") simMinute = ipc.readUB("023c") Hour = os.date("!%H") Minute = os.date("!%M") if simHour ~= Hour then ipc.writeUB("023B", Hour) end if simMinute ~= Minute then ipc.writeUB("023c", Minute) end ipc.sleep(120) end
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.