Jump to content

Moose: How to get the current time?


Frag

Recommended Posts

Hi guys,

 

two questions here.

 

I want to calculate the time it take for a plane to go from zone A to zone B.

 

I wanted to use the standard LUA command os.time() but it seems that we cannot use it in DCS. Is the LUA interpreter too old?

 

What are my option to pickup the start time, end time and calculate the difference between them with moose?


Edited by Frag
Link to comment
Share on other sites

All os commands are forbidden in DCS by default. Also io and lfs. You would need to comment out the sanatizeModule lines in the MissionScripting.lua in the DCS root/Scripts folder.

 

But you don't need that or Moose for what you want. Use the build in DCS timer functions https://wiki.hoggitworld.com/view/DCS_singleton_timer

 

Eg

 

timeA=timer.getTime()
....
timeB=timer.getTime()
....
deltaT=timeB-timeA  -- Duration between event A and B in Seconds.

A warrior's mission is to foster the success of others.

i9-12900K | MSI RTX 3080Ti Suprim X | 128 GB Ram 3200 MHz DDR-4 | MSI MPG Edge Z690 | Samung EVO 980 Pro SSD | Virpil Stick, Throttle and Collective | MFG Crosswind | HP Reverb G2

RAT - On the Range - Rescue Helo - Recovery Tanker - Warehouse - Airboss

Link to comment
Share on other sites

All os commands are forbidden in DCS by default. Also io and lfs. You would need to comment out the sanatizeModule lines in the MissionScripting.lua in the DCS root/Scripts folder.

 

But you don't need that or Moose for what you want. Use the build in DCS timer functions https://wiki.hoggitworld.com/view/DCS_singleton_timer

 

Eg

 

timeA=timer.getTime()
....
timeB=timer.getTime()
....
deltaT=timeB-timeA  -- Duration between event A and B in Seconds.

 

This is EXACTLY what I was looking for. Thanks a LOT buddy!

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...