I'm doing some code for my logitech mouse with lua but I can't find any way to communicate with my pc at all. No lib available here so I can't even send smth to cmd, write file, launch .bat and etc. At least I wasn't successful at this.
The only place where you can output some info is the log window. So the title asks main problem of this topic: Is there any way to get data from logitech lua log console?
To run a .bat file from LGS Lua script:
Create a shortcut action
RUN_BAT_FILE
your_bat_file.bat
C:\Path\to\folder
Now you can:
RUN_BAT_FILE
from Commands
pane to the big picture of the mouse)PlayMacro("RUN_BAT_FILE")
Please note that console window will be brought to the front, and your game will switch off fullscreen mode and will lose keyboard focus.
That is a very nasty thing while you're playing.
But you can invoke windowless applications without interfering the game.
To pass a long message from LGS Lua script to external program:
You can send strings by invoking OutputDebugMessage
in your LGS script
and receive them in your external program by means of LGS Debug Interceptor.dll
.
To pass information from your external program to your LGS Lua script:
The best way I'm aware of is the following:
Your external program can create a .lua-file and your LGS Lua script can execute it and receive the result (a tuple of Lua values return
ed by this script)
data = dofile[[c:\some_script.lua]]