Noch eine kleine Ergänzung zu dem Thread:
Die Funktion LuaExportStart() in der Config/export/export.lua ist standardmäßig von Kommentar-Tags eingeschlossen.
[codew26]-- Uncomment this function to enable data export!
--[[
function LuaExportStart()
-- Works once just before mission start.
-- Make initializations of your files or connections here.
-- For example:
-- 1) File
-- local file = io.open("./Temp/Export.log", "w")
-- if file then
-- io.output(file)
-- end
-- 2) Socket
-- dofile "lua.lua"
-- socket = require("socket")
-- host = host or "localhost"
-- port = port or 8080
-- c = socket.try(socket.connect(host, port)) -- connect to the listener socket
-- c:setoption("tcp-nodelay",true) -- set immediate transmission mode
end
--]][/codew26]
Wie bereits in dem oben angebrachten Kommentar des Quelltexts erwähnt, muss man die Kommentar-Tags entfernen ("--[[" und "--]]"), um den Datenexport initialisieren/starten zu können. (Die Funktion io.open("./Temp/Export.log", "w") öffnet beispielsweise im Schreibmodus die Export.log Datei).
Wenn die Kommentare entfernt sind sieht das Ganze dann so aus und das Script von Jetfire sollte funktionieren
[codew26]function LuaExportStart()
-- Works once just before mission start.
-- Make initializations of your files or connections here.
-- For example:
-- 1) File
-- local file = io.open("./Temp/Export.log", "w")
-- if file then
-- io.output(file)
-- end
-- 2) Socket
-- local path = "./luasocket.dll"
-- local f = assert(loadlib(path, "luaopen_socket"))
-- f()
-- local host = host or "localhost"
-- local port = port or 8080
-- if socket then
-- c, e = socket.connect(host, port) -- connect to the listener socket
-- end
end[/codew26]
Viel Spaß!
