Hello,
I currently have the following setup:
A Factorio server that prints out to stdout via lua print and a backend server that reads the stdout, processes it and delivers the result back to the server either via a silent-command or rcon.
But to spare all the connected players and the unneccessary messages via print that really shouldn't reach them, I was wondering if the lua print could be extended with a parameter that would allow one to specify to what client to send this message to.
This would allow me to print messages only to the servers stdout that the backend can parse and would stop the unneccessary messages to all the connected clients.
This can also be used for other scenarios where you intend to only print information to the servers console but wouldn't want to print it to all the connected clients.
Thank you in advance,
/Gerkiz
Extend lua print()
Extend lua print()
Last edited by Gerkiz on Tue Oct 10, 2023 11:57 am, edited 1 time in total.
Re: extend LuaGameScript::print()
What's the reason why you don't use write_file?
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.
Re: extend LuaGameScript::print()
You could try using a named pipe to avoid writing a real file.
Re: extend LuaGameScript::print()
I'll probably do just this. Thank you!atomizer wrote: ↑Fri Oct 06, 2023 5:43 pmYou could try using a named pipe to avoid writing a real file.
Re: extend LuaGameScript::print()
To fill in on this, apparently I've totally looked up the wrong print function. I apologize for the misleading information.
I've previously mentioned that I would like for the LuaGameScript::print to be extended. But it's not correct one that I initially thought about.
This is the print function that I would like to get extended.
https://lua-api.factorio.com/latest/aux ... A2-print()
I've previously mentioned that I would like for the LuaGameScript::print to be extended. But it's not correct one that I initially thought about.
This is the print function that I would like to get extended.
https://lua-api.factorio.com/latest/aux ... A2-print()