spinter Posted May 21, 2009 Share Posted May 21, 2009 Sorry my Problem is: Create a server with vb.net for read data BlackShark. There is an example in vb or c for create server? ====VIAF==== Spinter 155° "Pantere Nere" TsSimComms My Site aiupgrade.net Link to comment Share on other sites More sharing options...
spinter Posted May 22, 2009 Author Share Posted May 22, 2009 I can not help anyone? ====VIAF==== Spinter 155° "Pantere Nere" TsSimComms My Site aiupgrade.net Link to comment Share on other sites More sharing options...
Acedy Posted May 22, 2009 Share Posted May 22, 2009 (edited) Black Shark supports only direct data export via Lua, not C or VB, so the easiest thing would be to create a socket using the Lua Socket library, which sends data to your application via TCP or UDP. It should be no problem to write the application in another language, as long as it interprets the byte-stream/-segments it receives from the socket correctly. There is a tutorial about Lua exporting here, which also includes an example of how to communicate via sockets: http://www.digitalcombatsimulator.com/index.php?end_pos=567&scr=default&lang=en However this contains more or less the same information as the Export.lua file itself. Note that both the file and the tutorial above are not completely up to date anymore, so it's a bit of a trial and error process. For example some of the LoXYZ() exporting functions don't work in Black Shark, and there are a lot more new arguments for the LoSetCommand() function to control the Black Shark and the environment. And here you can find the Lua Socket reference: http://www.tecgraf.puc-rio.br/~diego/professional/luasocket/ What exactly are you trying to do? Edited May 22, 2009 by Acedy [sIGPIC][/sIGPIC] *** SERVMAN SERVER MANAGEMENT MOD V2 FOR DCS:BS V1.0.1 *** *** VERSION FOR FC2 *** Link to comment Share on other sites More sharing options...
spinter Posted May 22, 2009 Author Share Posted May 22, 2009 thanks Acedy ====VIAF==== Spinter 155° "Pantere Nere" TsSimComms My Site aiupgrade.net Link to comment Share on other sites More sharing options...
spinter Posted May 22, 2009 Author Share Posted May 22, 2009 Ok server solved because in multiplayer but I can not export? ====VIAF==== Spinter 155° "Pantere Nere" TsSimComms My Site aiupgrade.net Link to comment Share on other sites More sharing options...
JG14_Smil Posted May 22, 2009 Share Posted May 22, 2009 thank you for that post Acedy. Link to comment Share on other sites More sharing options...
spinter Posted May 23, 2009 Author Share Posted May 23, 2009 in multiplayer I can not extract any data, where am I wrong? ====VIAF==== Spinter 155° "Pantere Nere" TsSimComms My Site aiupgrade.net Link to comment Share on other sites More sharing options...
JG14_Smil Posted May 23, 2009 Share Posted May 23, 2009 export is disabled in MP to stop cheating. You would need a server that uses export enabled. Link to comment Share on other sites More sharing options...
Distiler Posted May 23, 2009 Share Posted May 23, 2009 Spinter what are you trying to do? (so we can help better) To export data in mp, I think server's /config/export/config.lua has to be edited to "EnableExportScript = true" AMD Ryzen 1400 // 16 GB DDR4 2933Mhz // Nvidia 1060 6GB // W10 64bit // Microsoft Sidewinder Precision 2 Link to comment Share on other sites More sharing options...
JG14_Smil Posted May 23, 2009 Share Posted May 23, 2009 Lua question Hello, I have been reading from the link... http://www.digitalcombatsimulator.com/index.php?end_pos=567&scr=default&lang=en ...to learn about lua exporting. I have searched my BS folders, but cannot find the Listener.lua and Talker.lua files the tutorial mentions. I've installed BS to another partition, could it have interferred with the lua files installation? thanks for any help. I really do want to lean more about this... smil Link to comment Share on other sites More sharing options...
PanelBuilder Posted May 24, 2009 Share Posted May 24, 2009 And here you can find the Lua Socket reference: http://www.tecgraf.puc-rio.br/~diego/professional/luasocket/ What exactly are you trying to do? Thanks so much. This sounds like just what the doctor ordered. As for me, I was trying to export to a serial port -- a usb board configured as a serial port -- without much success. I'm thinking now I should configure it as some kind of HID device. So far I've just got it working as a keyboard so I can send keystrokes to the sim. What's everyone else doing? Link to comment Share on other sites More sharing options...
PanelBuilder Posted May 24, 2009 Share Posted May 24, 2009 Hello, I have been reading from the link... http://www.digitalcombatsimulator.com/index.php?end_pos=567&scr=default&lang=en ...to learn about lua exporting. I have searched my BS folders, but cannot find the Listener.lua and Talker.lua files the tutorial mentions. smil I can't find them either. I don't think they exist. What are you trying to do? Let's keep this thread going as a place we can talk about this stuff. Cheers, Colin Link to comment Share on other sites More sharing options...
spinter Posted May 24, 2009 Author Share Posted May 24, 2009 export is disabled in MP to stop cheating. You would need a server that uses export enabled. My config.lua Enabled EnableExportScript = true ok I export data in singleplayer all ok! multiplayer no export nine data!!! My example export.lua dofile("./Scripts/Aircrafts/Ka-50/Cockpit/devices.lua") function LuaExportStart() dofile("./LuaSocket/Socket.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 socket.try(c:send("Connect")) end function LuaExportBeforeNextFrame() end function LuaExportAfterNextFrame() end function LuaExportActivityNextEvent(t) local tNext = t tNext = tNext + 1.0 local R_800 = GetDevice(devices.R_800) local frequency = R_800:get_frequency() socket.try(c:send(string.format(frequency))) return tNext end function LuaExportStop() -- Works once just after mission stop. socket.try(c:send("Quit")) -- to close the listener socket c:close() end ====VIAF==== Spinter 155° "Pantere Nere" TsSimComms My Site aiupgrade.net Link to comment Share on other sites More sharing options...
PanelBuilder Posted May 24, 2009 Share Posted May 24, 2009 My config.lua Enabled EnableExportScript = true ok I export data in singleplayer all ok! end Hi Spinter, Can I ask, what are you exporting to? If I understood that it would really help me get a handle on this. Thanks, Colin Link to comment Share on other sites More sharing options...
spinter Posted May 24, 2009 Author Share Posted May 24, 2009 I have to export the R800 radio frequencies for a project teamspeak ====VIAF==== Spinter 155° "Pantere Nere" TsSimComms My Site aiupgrade.net Link to comment Share on other sites More sharing options...
PanelBuilder Posted May 24, 2009 Share Posted May 24, 2009 Ah. Cool. Link to comment Share on other sites More sharing options...
JG14_Smil Posted May 24, 2009 Share Posted May 24, 2009 I can't find them either. I don't think they exist. What are you trying to do? Let's keep this thread going as a place we can talk about this stuff. Cheers, Colin Thanks, in hindsight I figured those files were from a LockOn installation and not the same as BS. I was just hoping to learn from the examples. I don't even know enough yet to explain what I want to do... :) I have an Epic card setup. Epic is an input/output card from the mid to late nineties. It was mostly used by simmers with MS FS and can use 'pigeon holes' to get data from the flight sim to trigger switches and events in a cockpit. I currently can wire up 512 switches, 16 analog axis, 8 virtual axis and (at this time) 32 lights or outputs. I can run guages, encoders for full motion, ect. I am nowhere near smart enough to do all that alone, but I can get help from several places. I'm trying to learn before I ask so I can make it easier for those that help me. :) I am guessing I need events from BS (at this time I am most intetrested in anunciator and indicator lights) to be true or false, sent to a socket(?) or port with a memory range or ID that the Epic can see (or some program to act between the Epic and flight sim). I believe it uses C++. I really did not mean to hijack the original thread and just want to learn what i can. I'll ask better questions when I can :) thanks Link to comment Share on other sites More sharing options...
Maj. Raptor Posted May 25, 2009 Share Posted May 25, 2009 (edited) Thanks, in hindsight I figured those files were from a LockOn installation and not the same as BS. I was just hoping to learn from the examples. I don't even know enough yet to explain what I want to do... :) I have an Epic card setup. Epic is an input/output card from the mid to late nineties. It was mostly used by simmers with MS FS and can use 'pigeon holes' to get data from the flight sim to trigger switches and events in a cockpit. I currently can wire up 512 switches, 16 analog axis, 8 virtual axis and (at this time) 32 lights or outputs. I can run guages, encoders for full motion, ect. I am nowhere near smart enough to do all that alone, but I can get help from several places. I'm trying to learn before I ask so I can make it easier for those that help me. :) I am guessing I need events from BS (at this time I am most intetrested in anunciator and indicator lights) to be true or false, sent to a socket(?) or port with a memory range or ID that the Epic can see (or some program to act between the Epic and flight sim). I believe it uses C++. I really did not mean to hijack the original thread and just want to learn what i can. I'll ask better questions when I can :) thanks Hey JG, I'm using Epic too. I wrote a Tool for Lock on two years ago (EpiFC). But only for MCP using QProcs. I'm planing to develop a complete interface for DCS using PH's and Qprocs. But I think it would be clever to wait for the PCIP, so I can avoid Problems with the current "Franken.lua". Maybe we can share some info. Regards Raptor Edited May 25, 2009 by Maj. Raptor Link to comment Share on other sites More sharing options...
JG14_Smil Posted May 25, 2009 Share Posted May 25, 2009 Great news. thank you very much Raptor. will stay in touch and plenty of work to do before I need any export :) Link to comment Share on other sites More sharing options...
spinter Posted May 25, 2009 Author Share Posted May 25, 2009 Bicouse some in multy? Lua::Config::call error LuaExportActivityNextEvent:./Config/Export/Export.lua:26: attempt to call global 'GetDevice' (a nil value) ====VIAF==== Spinter 155° "Pantere Nere" TsSimComms My Site aiupgrade.net Link to comment Share on other sites More sharing options...
spinter Posted May 27, 2009 Author Share Posted May 27, 2009 is correct im use for send my listner vb.net ? dofile("./LuaSocket/Socket.lua") ====VIAF==== Spinter 155° "Pantere Nere" TsSimComms My Site aiupgrade.net Link to comment Share on other sites More sharing options...
Recommended Posts