Guest User

Export.lua

a guest
May 17th, 2024
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. function LuaExportStart()
  2.  
  3. package.path = package.path..";"..lfs.currentdir().."/LuaSocket/?.lua"
  4. package.cpath = package.cpath..";"..lfs.currentdir().."/LuaSocket/?.dll"
  5.  
  6. socket = require("socket")
  7. IPAddress = "127.0.0.1"
  8. Port = 31090
  9.  
  10. MySocket = socket.try(socket.connect(IPAddress, Port))
  11. MySocket:setoption("tcp-nodelay",true)
  12. end
  13.  
  14. function LuaExportBeforeNextFrame()
  15. end
  16.  
  17. function LuaExportAfterNextFrame()
  18. local IAS = LoGetIndicatedAirSpeed()
  19. socket.try(MySocket:send(string.format("IAS: %.4f \n",IAS)))
  20. end
  21.  
  22. function LuaExportStop()
  23.  
  24. if MySocket then
  25. socket.try(MySocket:send("exit"))
  26. MySocket:close()
  27. end
  28. end
  29.  
  30. function LuaExportActivityNextEvent(t)
  31. end
Advertisement
Add Comment
Please, Sign In to add comment