rcon.lua

a simple RCON library written in plain Lua, using LuaSocket (and optionally copas)
i wrote it to interface with Minecraft servers, but it should work with any game that implements the RCON protocol. currently the library does not handle packet fragmentation, but i will definitely add that as soon as it causes issues for me :P

as an example of how to use the library: local rcon = require "rcon" local c = rcon.connect("localhost", 25575) c:send("say hello from rcon!") --> returns empty string (no response) c:send("list") --> returns "There are 0 of a max of 20 players online:" c:close()

the library also provides a command-line tool to send rcon commands, either interactively or by passing arguments usage: rcon [-H hostname] [-P port] [-t] [-s] [-w seconds] -p PASSWORD [command1] [command2] the default hostname is localhost, and the default port is 25575 (the vanilla server default).
if no RCON commands are specified, the tool will enter interactive mode.
multiple commands can be specified, and they will be run in order. commands with spaces in them should be enclosed in quotes.
the -p (password) argument must be provided.
the -t argument will start the interactive terminal even if commands are specified.
the -s argument will silence all non-error output.
the -w argument will wait for the specified number of seconds between each command (but not after the last command).

library reference

download/install

install from Luarocks: luarocks install rcon or manually download the rock (rcon-0.1-1.all.rock) or its source (rcon-0.1.tar.gz)