DigitalEngine Posted October 23, 2020 Share Posted October 23, 2020 For whomever may be interested. This is a Export.lua for the sole purpose of exporting the dcs mission (accumulated) time to a port/socket in one second intervals, as a whole number value. function LuaExportStart() package.path = package.path..";"..lfs.currentdir().."/LuaSocket/?.lua" package.cpath = package.cpath..";"..lfs.currentdir().."/LuaSocket/?.dll" socket = require("socket") IPAddress = "127.0.0.1" Port = 31090 MySocket = socket.try(socket.connect(IPAddress, Port)) MySocket:setoption("tcp-nodelay",true) end function LuaExportBeforeNextFrame() end function LuaExportAfterNextFrame() end function LuaExportActivityNextEvent(t) local tNext = t local TIME = LoGetModelTime() -- "%.0f" displays the data in whole seconds, with no decimals. socket.try(MySocket:send(string.format("Time: %.0f \n",TIME))) -- The below writes the data in one second intervals. tNext = tNext + 1 return tNext end function LuaExportStop() if MySocket then socket.try(MySocket:send("exit")) MySocket:close() end end Thanks to @JaBoG32_Dirty, his YouTube Channel "DCS Flighttraining", and his github repository "DCS-Export-Server-Simple". JaBo has a simple TCP DCS viewer with with which you can view the data in real time. Next step, if someone will please help me, is I want to import the data onto a html webpage file, use AJAX, and then format it into a 24hour time format. For example, if the mission starts at 0600, add the accumulated mission (120 seconds) time and display it on the html page as 06:02. Could anyone help me with such a JavaScript code? I've done something similar using data wrote to a .txt file, shown as a static example here, and here. CPU = Intel i7-6700K Motherboard = ASUS ROG Maximus VIII Hero Alpha, w/ the Intel Z170 Chipset, RAM = 64 Gigs of Ripjaws V F4-3400C16Q. GPU = Zotac GTX980ti Amp Extreme Hard-drive = Samsung V-NAD SSD 950 PRO M.2 Link to comment Share on other sites More sharing options...
BlaizzMC Posted January 8, 2021 Share Posted January 8, 2021 Hey, I would be interested in the solution if you found one ! Cheers Nabla Corporation Link to comment Share on other sites More sharing options...
Recommended Posts