Package: factoirc
FactoIRC is a bidirectional IRC bridge between Factorio and IRC.
It comes as a plugin for theirc3python module.It can join one or more channels and forward messages back and forth between IRC and Factorio.Some IRC commands are also provided :!rcon: Execute an RCON command and return the result.!players: Get the list of the currently online players.FactoIRC uses the RCON protocol introduced in Factorio 0.13 to forward messages from IRC to Factorio.
As a result, FactoIRCwill not work with Factorio 0.12and earlier versions.Forwarding Factorio chat messages to IRC requires access to the Factorio server output which can be achieved using several methods depending on your setup.CompatibilityOn Windows, forwarding in the IRC -> Factorio direction is only supported starting from Factorio 0.15 and using the console log(–console-log)
:https://forums.factorio.com/viewtopic.php?f=49&t=37108.Join/leave messages should work with Factorio 0.13 but are broken in 0.14 (https://forums.factorio.com/viewtopic.php?f=6&t=30697).
Factorio 0.15 brings them back.InstallationYou’ll need to have Python 3.5 (or later) which can be obtained through your distribution’s package manager
or downloaded fromhttps://www.python.org/(for Windows users).On Windows, make sure to check the“Add Python 3.x to PATH”checkbox when installing.Once Python is installed, FactoIRC can be installed using$pip3installfactoircConfigurationConfiguration is done using theconfig.inifile. Aconfig.example.inifile is provided as an example and contains extensive documentation.Depending on your setup, you will have to use one of thefile,stdinorsystemdmethods.Method 1:file(recommended)This method reads the Factorio chat from a console log.[factoirc]method=filefile=console.logThe console log can be generated using–console-login Factorio 0.15:$factorio--rcon-port=27015--rcon-password=password--start-server=save.zip--console-log=console.logFor Factorio < 0.15, you can redirect the Factorio output to a file to achieve the same behavior (doesn’t work on Windows):$factorio--rcon-port=27015--rcon-password=password--start-server=save.zip>console.logfactorio-initusers can also use theserver.outfile as input.
Note that the systemd service forfactorio-initdoes not save the output into the journal, so you can’t use thesystemdmethod with it.Warning:donotuse thefactorio-current.logfile created by Factorio. It does not contain the chat log.Method 2:systemdjournalThis method applies only if your Factorio server runs under systemd (only for Linux machines) and its output is stored in the journal.In this case, FactoIRC can directly read the log from the journal.You’ll need the following options in your configuration file:[factoirc]method=systemdunit=factorio.serviceFor this method to work, thepython-systemdmodule is required and can be installed via pip:$pip3installpython-systemdMethod 3:stdinThis method reads the Factorio chat log from the standard input stream, it also supports reading from a file via shell redirection.[factoirc]method=stdinYou will need to connect the Factorio chat log output to the FactoIRC bot:$factorio--rcon-port=27015--rcon-password=password--start-server=save.zip|irc3config.iniForwarding customizationYou can customize the forwarding of messages for the different game and irc actions, seeconfig.example.inifor more information.RunningTo run FactoIRC, you just need to use theirc3command with a FactoIRC-enabled config file (seeconfig.example.ini)$irc3config.iniirc3can be started with the-vflag to show more log messages (including those generated by FactoIRC).IRC raw traffic can be shown with-r.Tryirc3-hfor the full list of options.