-- Sample script to export DCS world telemetry to Teleplot -- Import socket lib package.path = package.path..";.\\LuaSocket\\?.lua" package.cpath = package.cpath..";.\\LuaSocket\\?.dll" socket = require("socket") -- Setup Teleplot UDP socket udp = socket.udp() teleplotAddr = "127.0.0.1" teleplotPort = 47269 udp:settimeout(0) udp:setoption('reuseaddr',true) -- Implement DCS Export hook functions function LuaExportStart() end function LuaExportBeforeNextFrame() end function LuaExportAfterNextFrame() end function LuaExportStop() udp:close() end function LuaExportActivityNextEvent(t) -- Get simulation time in milliseconds local time = LoGetModelTime() * 1000 -- Send Multiple telemetry values to teleplot local altASL = LoGetAltitudeAboveSeaLevel() udp:sendto(string.format("AltitudeAboveSeaLevel:%.0f:%.2f§feet", time, altASL), teleplotAddr, teleplotPort) local altAGL = LoGetAltitudeAboveGroundLevel() udp:sendto(string.format("AltitudeAboveGroundLevel:%.0f:%.2f§feet", time, altAGL), teleplotAddr, teleplotPort) local speedI = LoGetIndicatedAirSpeed() udp:sendto(string.format("IndicatedAirSpeed:%.0f:%.2f§knots", time, speedI), teleplotAddr, teleplotPort) local speedT = LoGetTrueAirSpeed() udp:sendto(string.format("TrueAirSpeed:%.0f:%.2f§knots", time, speedT), teleplotAddr, teleplotPort) local aoa = LoGetAngleOfAttack() udp:sendto(string.format("AngleOfAttack:%.0f:%.2f§degrees", time, aoa), teleplotAddr, teleplotPort) local accel = LoGetAccelerationUnits() udp:sendto(string.format("AccelerationUnitsX:%.0f:%.2f§G", time, accel.x), teleplotAddr, teleplotPort) udp:sendto(string.format("AccelerationUnitsY:%.0f:%.2f§G", time, accel.y), teleplotAddr, teleplotPort) udp:sendto(string.format("AccelerationUnitsZ:%.0f:%.2f§G", time, accel.z), teleplotAddr, teleplotPort) local speedVertical = LoGetVerticalVelocity() udp:sendto(string.format("VerticalVelocity:%.0f:%.2f§feet/sec", time, speedVertical), teleplotAddr, teleplotPort) local pitch, bank, yaw = LoGetADIPitchBankYaw() udp:sendto(string.format("Pitch:%.0f:%.2f§degrees", time, math.deg(pitch)), teleplotAddr, teleplotPort) udp:sendto(string.format("Bank:%.0f:%.2f§degrees", time, math.deg(bank)), teleplotAddr, teleplotPort) udp:sendto(string.format("Yaw:%.0f:%.2f§degrees", time, math.deg(yaw)), teleplotAddr, teleplotPort) udp:sendto(string.format("3D|ADIPitchBankYaw:%.0f:S:cube:W:1:D:2:H:0.5:R:%.2f:0:%.2f", time, pitch, -bank ) , teleplotAddr, teleplotPort) local magneticYaw = LoGetMagneticYaw() udp:sendto(string.format("MagneticYaw:%.0f:%.2f§degrees", time, math.deg(magneticYaw)), teleplotAddr, teleplotPort) return t+0.1 end