Page 1 of 1

rcon.print() or something along those lines

Posted: Sat Mar 10, 2018 5:44 pm
by riot2212
basically, it would be nice to have the ability to have lua be able to send a response to rcon when you use /c or /silent-command from rcon

an example of the situation that would be nice is something along the lines of
rcon.print(table.tostring(game.forces['player'].item_production_statistics.input_counts))
of course the rcon.print would only work when the command was sent via rcon.

This situation is a good replacement for the current way I (and have seen others) do this, basically the current setup requires me to modify the command.lua game save (so players do not have to download a mod) and the command saves the stats like that to files server side only, then I have a script that connects via ftp to download the files. this process is a time consuming process and uses unnecessary resources, but its a work around for the lack of this ability, first the game only saves the stats every 10 minutes so it doesn't take a huge amount of resources on the server, not that it would if it saved it every 2 minutes or so, 2nd the script downloads the stats every 10 minutes as well, from there its quick, takes less then a 100 milliseconds for my script to parse the data and save it in a readable format for me to show on a website or for my discord bot to read and send it to the discord server on request.

with an rcon.print lua command I could streamline this processes, cut back on the resources this takes, and make it live stats.

Of course this is not the only situation this would give server hosts who use custom code, this would open up the numerous possibilities, and I know I am not the only one who would be interested in this, I know of 2 others on the forums that would like this, and if you look at the mods available, there are several mods that would benefit from this as well

Re: rcon.print() or something along those lines

Posted: Sat Mar 10, 2018 7:23 pm
by Rseding91
I've added exactly that for the next version of 0.16.

Calling "rcon.print(...)" will send the message to the calling rcon instance if any. If there's no calling instance it does nothing.

Re: rcon.print() or something along those lines

Posted: Sun Mar 11, 2018 7:36 pm
by riot2212
sweet, thank you.